[Jaws-commits] r13270 - in branches/0.8/html: gadgets/ControlPanel/resources include/Jaws/Widgets

afz at jaws-project.com afz at jaws-project.com
Sun Aug 5 11:03:45 UTC 2012


Author: afz
Date: 2012-08-05 11:03:45 +0000 (Sun, 05 Aug 2012)
New Revision: 13270

Added:
   branches/0.8/html/gadgets/ControlPanel/resources/tinymce.css
   branches/0.8/html/gadgets/ControlPanel/resources/tinymce.rtl.css
Removed:
   branches/0.8/html/gadgets/ControlPanel/resources/tinyMCE.css
   branches/0.8/html/gadgets/ControlPanel/resources/tinyMCE.rtl.css
Modified:
   branches/0.8/html/include/Jaws/Widgets/TinyMCE.php
Log:
[TinyMCE]: using new changes in piwi

Deleted: branches/0.8/html/gadgets/ControlPanel/resources/tinyMCE.css
===================================================================
--- branches/0.8/html/gadgets/ControlPanel/resources/tinyMCE.css	2012-08-05 10:56:25 UTC (rev 13269)
+++ branches/0.8/html/gadgets/ControlPanel/resources/tinyMCE.css	2012-08-05 11:03:45 UTC (rev 13270)
@@ -1,14 +0,0 @@
-/* tiny MCE Editor CSS */
-body {
-background-color: #fff;
-}
-body, td, pre {
-font-family:arial, helvetica, sans-serif;
-font-size: 14px;
-line-height: 1.5em;
-padding: 0;
-}
-p {
-padding: 0px;
-margin: 0px;
-}
\ No newline at end of file

Deleted: branches/0.8/html/gadgets/ControlPanel/resources/tinyMCE.rtl.css
===================================================================
--- branches/0.8/html/gadgets/ControlPanel/resources/tinyMCE.rtl.css	2012-08-05 10:56:25 UTC (rev 13269)
+++ branches/0.8/html/gadgets/ControlPanel/resources/tinyMCE.rtl.css	2012-08-05 11:03:45 UTC (rev 13270)
@@ -1,14 +0,0 @@
-/* tiny MCE Editor CSS */
-body {
-background-color: #fff;
-}
-body, td, pre {
-font-family: tahoma, arial, helvetica, sans-serif;
-font-size: 14px;
-line-height: 1.5em;
-padding: 0;
-}
-p {
-padding: 0px;
-margin: 0px;
-}
\ No newline at end of file

Copied: branches/0.8/html/gadgets/ControlPanel/resources/tinymce.css (from rev 13121, branches/0.8/html/gadgets/ControlPanel/resources/tinyMCE.css)
===================================================================
--- branches/0.8/html/gadgets/ControlPanel/resources/tinymce.css	                        (rev 0)
+++ branches/0.8/html/gadgets/ControlPanel/resources/tinymce.css	2012-08-05 11:03:45 UTC (rev 13270)
@@ -0,0 +1,14 @@
+/* tinyMCE Editor CSS */
+body {
+background-color: #fff;
+}
+body, td, pre {
+padding: 0;
+font-size: 14px;
+line-height: 1.5em;
+font-family: arial, helvetica, sans-serif;
+}
+p {
+margin: 0px;
+padding: 0px;
+}
\ No newline at end of file

Copied: branches/0.8/html/gadgets/ControlPanel/resources/tinymce.rtl.css (from rev 13121, branches/0.8/html/gadgets/ControlPanel/resources/tinyMCE.rtl.css)
===================================================================
--- branches/0.8/html/gadgets/ControlPanel/resources/tinymce.rtl.css	                        (rev 0)
+++ branches/0.8/html/gadgets/ControlPanel/resources/tinymce.rtl.css	2012-08-05 11:03:45 UTC (rev 13270)
@@ -0,0 +1,14 @@
+/* tinyMCE Editor CSS */
+body {
+background-color: #fff;
+}
+body, td, pre {
+padding: 0;
+font-size: 14px;
+line-height: 1.5em;
+font-family: tahoma, arial, helvetica, sans-serif;
+}
+p {
+margin: 0px;
+padding: 0px;
+}
\ No newline at end of file

Modified: branches/0.8/html/include/Jaws/Widgets/TinyMCE.php
===================================================================
--- branches/0.8/html/include/Jaws/Widgets/TinyMCE.php	2012-08-05 10:56:25 UTC (rev 13269)
+++ branches/0.8/html/include/Jaws/Widgets/TinyMCE.php	2012-08-05 11:03:45 UTC (rev 13270)
@@ -71,6 +71,14 @@
     var $_Theme = 'advanced';
 
     /**
+     * Width of the editor
+     * examples: 100%, 600
+     *
+     * @var mixed
+     */
+    var $_Width = '100%';
+
+    /**
      * TinyMCE base actions
      *
      * @access  private
@@ -116,21 +124,15 @@
         $value = str_replace('<', '&lt;', $value);
         $value = str_replace('>', '&gt;', $value);
 
-        $this->_Name  = $name;
-        $this->_Value = $value;
+        $this->_Name   = $name;
+        $this->_Value  = $value;
+        $this->_Gadget = $gadget;
 
         $this->TextArea =& Piwi::CreateWidget('TextArea', $name, $this->_Value, '', '14');
         $this->_Label =& Piwi::CreateWidget('Label', $label, $this->TextArea);
         $this->setClass($name);
 
-        // Add container
         $this->_Container =& Piwi::CreateWidget('VBox');
-        if (!empty($label)) {
-            $this->_Container->PackStart($this->_Label);
-        }
-        $this->_Container->PackStart($this->TextArea);
-
-        $this->_Gadget = $gadget;
         parent::init();
     }
 
@@ -203,7 +205,13 @@
         $toolbars[] = $tinymcePlugins;
         $toolbars[] = $jawsPlugins;
 
-        $this->_XHTML = $this->_Container->Get();
+        $label = $this->_Label->GetValue();
+        if (!empty($label)) {
+            $this->_Container->PackStart($this->_Label);
+        }
+        $this->_Container->PackStart($this->TextArea);
+        $this->_Container->SetWidth($this->_Width);
+        $this->_XHTML .= $this->_Container->Get();
 
         if (!$alreadyLoaded) {
             $this->_XHTML.= '<script language="javascript" type="text/javascript" src="'.
@@ -282,9 +290,9 @@
         //$this->_XHTML.= "cleanup_callback : 'myCustomCleanup',\n";
         $this->_XHTML.= "file_browser_callback : 'jaws_filebrowser_callback',\n";
         if ('rtl' == _t('GLOBAL_LANG_DIRECTION')) {
-            $this->_XHTML.= "content_css : \"gadgets/ControlPanel/resources/tinyMCE.rtl.css\",\n";
+            $this->_XHTML.= "content_css : \"gadgets/ControlPanel/resources/tinymce.rtl.css\",\n";
         } else {
-            $this->_XHTML.= "content_css : \"gadgets/ControlPanel/resources/tinyMCE.css\",\n";
+            $this->_XHTML.= "content_css : \"gadgets/ControlPanel/resources/tinymce.css\",\n";
         }
         $this->_XHTML.= "extended_valid_elements : '" . $this->_ExtendedValidElements . "',\n";
         $this->_XHTML.= "invalid_elements : '" . $this->_InvalidElements . "',\n";
@@ -335,28 +343,6 @@
     }
 
     /**
-     * Set the width of the editor
-     *
-     * @access  public
-     * @param   string  $width  Width
-     */
-    function SetWidth($width)
-    {
-        $currentStyle = $this->_Container->getStyle();
-        if (empty($currentStyle)) {
-            $currentStyle = 'width: '. $width.';';
-        } else {
-            if (strpos($currentStyle, 'width:') === false) {
-                if (substr($currentStyle, -1) != ';') {
-                    $currentStyle = $currentStyle . ';';
-                }
-                $currentStyle = $currentStyle . 'width: '. $width.';';
-            }
-        }
-        $this->_Container->SetStyle($currentStyle);
-    }
-
-    /**
      * Set the TinyMCE theme
      *
      * @access    public
@@ -378,4 +364,12 @@
         return $content;
     }
 
+    /**
+     * @param mixed $width
+     */
+    function setWidth($width)
+    {
+        $this->_Width = $width;
+    }
+
 }
\ No newline at end of file



More information about the Jaws-commits mailing list