diff options
author | wei <> | 2006-04-28 05:22:14 +0000 |
---|---|---|
committer | wei <> | 2006-04-28 05:22:14 +0000 |
commit | 19989e32667e653d9dd65066ba26c91562a3cdc8 (patch) | |
tree | 37b83db6fe5460cb083a084931db48f89e8f8f83 | |
parent | eb2a6e9431445b3cb24be4b75f02f07aef70aebc (diff) |
Fixed #68 and update TinyMCE to 2.0.5.1
-rw-r--r-- | .gitattributes | 1 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | framework/3rdParty/TinyMCE/tiny_mce.md5 | 2 | ||||
-rw-r--r-- | framework/3rdParty/TinyMCE/tiny_mce.tar | bin | 3051520 -> 3164160 bytes | |||
-rw-r--r-- | framework/3rdParty/readme.html | 2 | ||||
-rw-r--r-- | framework/Web/Javascripts/js/validator.js | 4 | ||||
-rw-r--r-- | framework/Web/Javascripts/prado/validation3.js | 4 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/THtmlArea.php | 99 | ||||
-rw-r--r-- | tests/FunctionalTests/features/protected/controls/LabeledTextbox.php | 2 | ||||
-rw-r--r-- | tests/FunctionalTests/features/protected/pages/HtmlArea.page | 29 | ||||
-rw-r--r-- | tests/FunctionalTests/tickets/protected/pages/Ticket68.page | 25 |
11 files changed, 106 insertions, 64 deletions
diff --git a/.gitattributes b/.gitattributes index 4cf64834..28d84081 100644 --- a/.gitattributes +++ b/.gitattributes @@ -986,6 +986,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket27.page -text tests/FunctionalTests/tickets/protected/pages/Ticket54.page -text tests/FunctionalTests/tickets/protected/pages/Ticket54Master.php -text tests/FunctionalTests/tickets/protected/pages/Ticket54Master.tpl -text +tests/FunctionalTests/tickets/protected/pages/Ticket68.page -text tests/FunctionalTests/tickets/protected/pages/Ticket72.page -text tests/FunctionalTests/tickets/protected/pages/Ticket72.php -text tests/FunctionalTests/tickets/protected/pages/Ticket93.page -text @@ -1,5 +1,6 @@ Version 3.0.0 May 1, 2006
=========================
+BUG: Ticket#68 - 2 TButtons with THtmlArea causes second button to fail to function (Wei)
BUG: Ticket#70 - Javascript for TDataTypeValidator added (Wei)
BUG: Ticket#131 - TImageMap and TLinkButton continue to postback even client validator fails (Wei)
BUG: Ticket#135 - TBrowserLogRoute reports wrong timings (Qiang)
@@ -18,6 +19,7 @@ ENH: Format string in classes extending TDataGridColumn can now evaluate an expr ENH: Format string in classes extending TListControl can now evaluate an expression (Qiang)
ENH: Custom visual effects can be added to client-side validators. (Wei)
ENH: TJavascript::encode() allows raw javascript code when string begins with "javascript:" (Wei)
+ENH: Update TinyMCE to 2.0.5.1
CHG: Rewrote client-side javascript validators, check your client-side validation behaviour (Wei)
CHG: Updated the javascript Prototype library, a few utilties functions REMOVED, may break your existing javascript code. (Wei)
CHG: Build javascript without compression, only comments are removed. (Wei)
diff --git a/framework/3rdParty/TinyMCE/tiny_mce.md5 b/framework/3rdParty/TinyMCE/tiny_mce.md5 index 861556e5..1ee34468 100644 --- a/framework/3rdParty/TinyMCE/tiny_mce.md5 +++ b/framework/3rdParty/TinyMCE/tiny_mce.md5 @@ -1 +1 @@ -b79c5807630d8324b2c968eb563e9076 *tiny_mce.tar +505c2761e878f40d5451115bd5643355 *tiny_mce.tar diff --git a/framework/3rdParty/TinyMCE/tiny_mce.tar b/framework/3rdParty/TinyMCE/tiny_mce.tar Binary files differindex f57b3509..663abb34 100644 --- a/framework/3rdParty/TinyMCE/tiny_mce.tar +++ b/framework/3rdParty/TinyMCE/tiny_mce.tar diff --git a/framework/3rdParty/readme.html b/framework/3rdParty/readme.html index 923e9056..ea5b05db 100644 --- a/framework/3rdParty/readme.html +++ b/framework/3rdParty/readme.html @@ -37,7 +37,7 @@ projects. </tr>
<tr>
<td><a href="TinyMCE">TinyMCE</a></td>
- <td><a href="http://tinymce.moxiecode.com/">TinyMCE Javascript Content Editor</a> (v2.0.2)</td>
+ <td><a href="http://tinymce.moxiecode.com/">TinyMCE Javascript Content Editor</a> (v2.0.5.1)</td>
<td><a href="tiny_mce/license.txt">GNU LIBRARY GENERAL PUBLIC LICENSE</a></td>
<td>System.Web.UI.WebControls.THtmlArea</td>
<td>TinyMCE is a powerful WYSIWYG editor control for web browsers such as MSIE or Mozilla that enables the user to edit HTML contents in a more user friendly way.</td>
diff --git a/framework/Web/Javascripts/js/validator.js b/framework/Web/Javascripts/js/validator.js index 4519357c..88dfb25e 100644 --- a/framework/Web/Javascripts/js/validator.js +++ b/framework/Web/Javascripts/js/validator.js @@ -434,6 +434,10 @@ getValidationValue : function(control) this.observeDatePickerChanges(); return Prado.WebUI.TDatePicker.getDropDownDate(control).getTime(); } + case 'THtmlArea': + if(typeof tinyMCE != "undefined") +tinyMCE.triggerSave(); +return this.trim($F(control)); default: if(this.isListControlType()) return this.getFirstSelectedListValue(); diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js index d5da977f..1f154fec 100644 --- a/framework/Web/Javascripts/prado/validation3.js +++ b/framework/Web/Javascripts/prado/validation3.js @@ -772,6 +772,10 @@ Prado.WebUI.TBaseValidator.prototype = return Prado.WebUI.TDatePicker.getDropDownDate(control).getTime();
}
+ case 'THtmlArea':
+ if(typeof tinyMCE != "undefined")
+ tinyMCE.triggerSave();
+ return this.trim($F(control));
default:
if(this.isListControlType())
return this.getFirstSelectedListValue();
diff --git a/framework/Web/UI/WebControls/THtmlArea.php b/framework/Web/UI/WebControls/THtmlArea.php index 8e5fcd16..254754ae 100644 --- a/framework/Web/UI/WebControls/THtmlArea.php +++ b/framework/Web/UI/WebControls/THtmlArea.php @@ -78,44 +78,44 @@ Prado::using('System.Web.UI.WebControls.TTextBox'); */
class THtmlArea extends TTextBox
{
- // Qiang: need to clean up the following (too inefficient)
+ /**
+ * @var array list of locale => language file pairs.
+ */
private static $_langs = array(
- 'da' => array('da'),
- 'fa' => array('fa'),
- 'hu' => array('hu'),
- 'nb' => array('nb'),
- 'pt_br' => array('pt_BR'),
- 'sk' => array('sk'),
- 'zh_tw_utf8' => array('zh_TW', 'zh_HK'),
- 'ar' => array('ar'),
- 'de' => array('de'),
- 'fi' => array('fi'),
- 'is' => array('is'),
- 'nl' => array('nl'),
- 'sv' => array('sv'),
- 'ca' => array('ca'),
- 'el' => array('el'),
- 'fr' => array('fr'),
- 'it' => array('it'),
- 'nn' => array('nn'), //what is nn?
-// 'ru' => array('ru'),
- 'th' => array('th'),
- 'cs' => array('cs'),
- 'en' => array('en'),
- 'fr_ca' => array('fr_CA'),
- 'ja' => array('ja'),
- 'pl' => array('pl'),
-// 'ru_KOI8-R' => array('ru'), /// what is this?
- 'zh_cn' => array('zh_CN'),
- 'cy' => array('cy'), //what is this?
- 'es' => array('es'),
- 'he' => array('he'),
- 'ko' => array('ko'),
- 'pt' => array('pt'),
- 'ru_UTF-8' => array('ru'),
- 'tr' => array('tr'),
- 'si' => array('si'),
-// 'zh_tw' => array('zh_TW'),
+ 'ar' => 'ar',
+ 'ca' => 'ca',
+ 'cs' => 'cs',
+ 'da' => 'da',
+ 'de' => 'de',
+ 'el' => 'el',
+ 'en' => 'en',
+ 'es' => 'es',
+ 'fa' => 'fa',
+ 'fi' => 'fi',
+ 'fr' => 'fr',
+ 'fr_CA' => 'fr_ca',
+ 'he' => 'he',
+ 'hu' => 'hu',
+ 'is' => 'is',
+ 'it' => 'it',
+ 'ja' => 'ja',
+ 'ko' => 'ko',
+ 'nb' => 'nb',
+ 'nl' => 'nl',
+ 'pl' => 'pl',
+ 'pt' => 'pt',
+ 'pt_BR' => 'pt_br',
+ 'ru' => 'ru_UTF-8',
+ 'si' => 'si',
+ 'sk' => 'sk',
+ 'sv' => 'sv',
+ 'th' => 'th',
+ 'tr' => 'tr',
+ 'vi' => 'vi',
+ 'zh' => 'zh_cn_utf8',
+ 'zh_CN' => 'zh_cn_utf8',
+ 'zh_HK' => 'zh_tw_utf8',
+ 'zh_TW' => 'zh_tw_utf8'
);
/**
@@ -271,9 +271,12 @@ class THtmlArea extends TTextBox $options['elements'] = $this->getClientID();
$options['language'] = $this->getLanguageSuffix($this->getCulture());
$options['theme'] = 'advanced';
- $options['theme_advanced_buttons1'] = 'formatselect,fontselect,fontsizeselect,separator,bold,italic,underline,strikethrough,sub,sup';
- $options['theme_advanced_buttons2'] = 'justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,outdent,indent,separator,forecolor,backcolor,separator,hr,link,unlink,image,charmap,separator,removeformat,code,help';
+
+ //make it basic advanced to fit into 1 line of buttons.
+ $options['theme_advanced_buttons1'] = 'bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright, justifyfull,separator,bullist,numlist,separator,undo,redo,separator,link,unlink,separator,charmap,separator,code,help';
+ $options['theme_advanced_buttons2'] = ' ';
$options['theme_advanced_buttons3'] = ' ';
+
$options['theme_advanced_toolbar_location'] = 'top';
$options['theme_advanced_toolbar_align'] = 'left';
$options['theme_advanced_path_location'] = 'bottom';
@@ -312,22 +315,10 @@ class THtmlArea extends TTextBox if(!is_null($app))
$variants = $app->getCultureVariants($culture);
- //default the variant to "en"
- if(count($variants) == 0)
- {
- if(empty($culture))
- return 'en';
- $variants[] = strtolower($culture);
- }
-
- // TODO: triple loops???
- foreach(self::$_langs as $js => $langs)
+ foreach($variants as $variant)
{
- foreach($variants as $variant)
- {
- if(in_array($variant, $langs))
- return $js;
- }
+ if(isset(self::$_langs[$variant]))
+ return self::$_langs[$variant];
}
return 'en';
diff --git a/tests/FunctionalTests/features/protected/controls/LabeledTextbox.php b/tests/FunctionalTests/features/protected/controls/LabeledTextbox.php index 33396734..e190abd4 100644 --- a/tests/FunctionalTests/features/protected/controls/LabeledTextbox.php +++ b/tests/FunctionalTests/features/protected/controls/LabeledTextbox.php @@ -7,7 +7,7 @@ class LabeledTextBox extends TCompositeControl {
public function getTextBox()
{
- return $this->textbox;
+ return $this->getRegisteredObject('textbox');
}
public function getLabel()
diff --git a/tests/FunctionalTests/features/protected/pages/HtmlArea.page b/tests/FunctionalTests/features/protected/pages/HtmlArea.page index 8b56f48d..3936e68c 100644 --- a/tests/FunctionalTests/features/protected/pages/HtmlArea.page +++ b/tests/FunctionalTests/features/protected/pages/HtmlArea.page @@ -1,10 +1,25 @@ -<%@ Application.Globalization.Charset="GB2312" %>
+
<com:TContent ID="Content">
- <com:THtmlArea>
- <prop:Options>
- plugins : "contextmenu,paste",
- language: "zh_CN"
- </prop:Options>
- </com:THtmlArea>
+ <com:THtmlArea ID="text1" />
+
+ <com:TRequiredFieldValidator
+ ControlToValidate="text1"
+ ErrorMessage="*" />
+
+ <com:TButton ID="button1" Text="submit 1" />
+
+ <com:TButton ID="button2" Text="submit 2" />
+
+ <com:THtmlArea ID="text2" />
+
+ <com:TRequiredFieldValidator
+ ControlToValidate="text2"
+ ValidationGroup="group2"
+ ErrorMessage="*" />
+
+ <com:TButton ID="button3" ValidationGroup="group2" Text="submit 3" />
+
+ <com:TButton ID="button4" ValidationGroup="group2" Text="submit 4" />
+
</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket68.page b/tests/FunctionalTests/tickets/protected/pages/Ticket68.page new file mode 100644 index 00000000..3936e68c --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket68.page @@ -0,0 +1,25 @@ +
+<com:TContent ID="Content">
+
+ <com:THtmlArea ID="text1" />
+
+ <com:TRequiredFieldValidator
+ ControlToValidate="text1"
+ ErrorMessage="*" />
+
+ <com:TButton ID="button1" Text="submit 1" />
+
+ <com:TButton ID="button2" Text="submit 2" />
+
+ <com:THtmlArea ID="text2" />
+
+ <com:TRequiredFieldValidator
+ ControlToValidate="text2"
+ ValidationGroup="group2"
+ ErrorMessage="*" />
+
+ <com:TButton ID="button3" ValidationGroup="group2" Text="submit 3" />
+
+ <com:TButton ID="button4" ValidationGroup="group2" Text="submit 4" />
+
+</com:TContent>
\ No newline at end of file |