diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2013-11-21 16:16:22 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2013-11-26 11:42:51 +0100 |
commit | e0c2726e70dfed543f99560a111a8742630977a3 (patch) | |
tree | e2482a44c78af1ebc1c5de6750aac995836666d0 | |
parent | 388b15cd589298b32c1ade9cc4aa6a6a97411047 (diff) |
Ported THtmlArea
-rw-r--r-- | framework/Web/Javascripts/packages.php | 2 | ||||
-rw-r--r-- | framework/Web/Javascripts/source/prado/controls/htmlarea.js | 32 |
2 files changed, 15 insertions, 19 deletions
diff --git a/framework/Web/Javascripts/packages.php b/framework/Web/Javascripts/packages.php index edd250f1..cc851b15 100644 --- a/framework/Web/Javascripts/packages.php +++ b/framework/Web/Javascripts/packages.php @@ -118,13 +118,13 @@ $dependencies = array( 'datepicker' => array('jquery', 'prado', 'datepicker'), 'activedatepicker' => array('jquery', 'prado', 'datepicker', 'ajax', 'activedatepicker'), 'colorpicker' => array('jquery', 'prado', 'colorpicker'), + 'htmlarea' => array('jquery', 'prado', 'htmlarea'), /* 'dragdrop' => array('prototype', 'prado', 'effects', 'ajax', 'dragdrop'), 'slider' => array('prototype', 'prado', 'slider'), 'keyboard' => array('prototype', 'prado', 'keyboard'), 'dragdropextra' => array('prototype', 'prado', 'effects', 'ajax', 'dragdrop','dragdropextra'), 'accordion' => array('prototype', 'prado', 'effects', 'accordion'), - 'htmlarea' => array('prototype', 'prado', 'htmlarea'), 'htmlarea4' => array('prototype', 'prado', 'htmlarea4'), 'ratings' => array('prototype', 'prado', 'effects', 'ajax', 'ratings'), 'inlineeditor' => array('prototype', 'prado', 'effects', 'ajax', 'inlineeditor'), diff --git a/framework/Web/Javascripts/source/prado/controls/htmlarea.js b/framework/Web/Javascripts/source/prado/controls/htmlarea.js index a425e697..819e853c 100644 --- a/framework/Web/Javascripts/source/prado/controls/htmlarea.js +++ b/framework/Web/Javascripts/source/prado/controls/htmlarea.js @@ -20,19 +20,13 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, { this.options = options; - var obj = this; - this.ajaxresponder = { - onComplete : function(request) - { - if(request && (request instanceof Prado.AjaxRequest)) - obj.checkInstance(); - } - }; this.registerAjaxHook(); this.registerInstance(); }, + + registerInstance: function() { if (typeof tinyMCE_GZ == 'undefined') @@ -74,7 +68,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, Prado.WebUI.THtmlArea.tinyMCELoadState = 255; var wrapper; while(Prado.WebUI.THtmlArea.pendingRegistrations.length>0) - if (wrapper = Prado.Registry.get(Prado.WebUI.THtmlArea.pendingRegistrations.pop())) + if (wrapper = Prado.Registry[Prado.WebUI.THtmlArea.pendingRegistrations.pop()]) wrapper.initInstance(); }, @@ -103,17 +97,19 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, registerAjaxHook: function() { - if (typeof(Ajax)!="undefined") - if (typeof(Ajax.Responders)!="undefined") - Ajax.Responders.register(this.ajaxresponder); + jQuery(document).on('ajaxComplete', this.ajaxresponder.bind(this)); }, deRegisterAjaxHook: function() { - if (typeof(Ajax)!="undefined") - if (typeof(Ajax.Responders)!="undefined") - Ajax.Responders.unregister(this.ajaxresponder); + jQuery(document).off('ajaxComplete', this.ajaxresponder.bind(this)); + }, + + ajaxresponder: function(request) + { + if(request && (request instanceof Prado.AjaxRequest)) + obj.checkInstance(); }, onDone: function() @@ -126,9 +122,9 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, tinyMCE.execCommand('mceFocus', false, this.ID); // when removed, tinyMCE restores its content to the textarea. If the textarea content has been // updated in this same callback, it will be overwritten with the old content. Workaround this. - var curtext = $(this.ID).value; + var curtext = $('#'+this.ID).get(0).value; tinyMCE.execCommand('mceRemoveControl', false, this.ID); - $(this.ID).value = curtext; + $('#'+this.ID).get(0).value = curtext; } catch (e) { @@ -143,7 +139,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control, } }); -Object.extend(Prado.WebUI.THtmlArea, +jQuery.extend(Prado.WebUI.THtmlArea, { pendingRegistrations : [], tinyMCELoadState : 0 |