diff options
Diffstat (limited to 'framework/Web/UI/WebControls/THtmlArea.php')
-rw-r--r-- | framework/Web/UI/WebControls/THtmlArea.php | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/framework/Web/UI/WebControls/THtmlArea.php b/framework/Web/UI/WebControls/THtmlArea.php index 91f0f033..efe3e6d9 100644 --- a/framework/Web/UI/WebControls/THtmlArea.php +++ b/framework/Web/UI/WebControls/THtmlArea.php @@ -268,9 +268,27 @@ class THtmlArea extends TTextBox return $this->getViewState('CustomPluginPath');
}
+ /**
+ * @return boolean enable compression of the javascript files, default is true.
+ */
+ public function getEnableCompression()
+ {
+ return $this->getViewState('EnableCompression', true);
+ }
+
+ /**
+ * @param boolean enable compression of the javascript files, default is true.
+ */
+ public function setEnableCompression($value)
+ {
+ $this->setViewState('EnableCompression', TPropertyValue::ensureBoolean($value));
+ }
+
public function onPreRender($param)
{
- $this->preLoadCompressedScript();
+ $this->loadJavascriptLibrary();
+ if($this->getEnableCompression())
+ $this->preLoadCompressedScript();
}
/**
@@ -310,8 +328,6 @@ class THtmlArea extends TTextBox protected function preLoadCompressedScript()
{
$scripts = $this->getPage()->getClientScript();
- if(!$scripts->isScriptFileRegistered('prado:THtmlArea'))
- $scripts->registerScriptFile('prado:THtmlArea', $this->getScriptUrl());
$key = 'prado:THtmlArea:compressed';
if(!$scripts->isBeginScriptRegistered($key))
{
@@ -326,6 +342,13 @@ class THtmlArea extends TTextBox }
}
+ protected function loadJavascriptLibrary()
+ {
+ $scripts = $this->getPage()->getClientScript();
+ if(!$scripts->isScriptFileRegistered('prado:THtmlArea'))
+ $scripts->registerScriptFile('prado:THtmlArea', $this->getScriptUrl());
+ }
+
/**
* Registers the editor javascript file and code to initialize the editor.
*/
@@ -342,7 +365,10 @@ class THtmlArea extends TTextBox */
protected function getScriptUrl()
{
- return $this->getScriptDeploymentPath().'/tiny_mce/tiny_mce_gzip.js';
+ if($this->getEnableCompression())
+ return $this->getScriptDeploymentPath().'/tiny_mce/tiny_mce_gzip.js';
+ else
+ return $this->getScriptDeploymentPath().'/tiny_mce/tiny_mce.js';
}
/**
|