[geeklog-cvs] geeklog: Update Advanced Editor functionality so the 'preview' p...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Jan 18 21:10:48 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/b963011d0fbc
changeset: 6696:b963011d0fbc
user:      blaine
date:      Sun Jan 18 21:09:44 2009 -0500
description:
Update Advanced Editor functionality so the 'preview' panel will be selected if preview mode/operation is selected

diffstat:

4 files changed, 21 insertions(+), 13 deletions(-)
public_html/admin/story.php                                            |   12 +++++-
public_html/javascript/advanced_editor.js                              |    2 -
public_html/javascript/storyeditor_fckeditor.js                        |   18 +++++-----
public_html/layout/professional/admin/story/storyeditor_advanced.thtml |    2 -

diffs (95 lines):

diff -r c5560b4eef68 -r b963011d0fbc public_html/admin/story.php
--- a/public_html/admin/story.php	Sun Jan 18 16:48:19 2009 -0500
+++ b/public_html/admin/story.php	Sun Jan 18 21:09:44 2009 -0500
@@ -308,7 +308,6 @@
         $story_templates->set_var ('change_editormode', 'onchange="change_editmode(this);"');
 
         require_once $_CONF['path_system'] . 'classes/navbar.class.php';
-
         $story_templates->set_var ('show_preview', 'none');
         $story_templates->set_var ('lang_expandhelp', $LANG24[67]);
         $story_templates->set_var ('lang_reducehelp', $LANG24[68]);
@@ -367,8 +366,15 @@
             $navbar->add_menuitem($LANG24[84],'showhideEditorDiv("perms",4);return false;',true);
             $navbar->add_menuitem($LANG24[85],'showhideEditorDiv("all",5);return false;',true);
         }
-
-        $navbar->set_selected($LANG24[80]);
+        if ($mode == 'preview') {
+            $story_templates->set_var ('show_preview', '');
+            $story_templates->set_var ('show_htmleditor', 'none');
+            $story_templates->set_var ('show_texteditor', 'none');
+            $story_templates->set_var ('show_submitoptions', 'none');
+            $navbar->set_selected($LANG24[79]);
+        } else {
+            $navbar->set_selected($LANG24[80]);
+        }
         $story_templates->set_var ('navbar', $navbar->generate() );
     }
 
diff -r c5560b4eef68 -r b963011d0fbc public_html/javascript/advanced_editor.js
--- a/public_html/javascript/advanced_editor.js	Sun Jan 18 16:48:19 2009 -0500
+++ b/public_html/javascript/advanced_editor.js	Sun Jan 18 21:09:44 2009 -0500
@@ -31,7 +31,7 @@
         // Reset the current selected navbar tab
         var navbar = document.getElementById('current');
         if (navbar) navbar.id = '';
-        // Cycle thru the navlist child elements - buiding an array of just the link items 
+        // Cycle thru the navlist child elements - buiding an array of just the link items
         var navbar = document.getElementById('navlist');
         var menuitems = new Array(8);
         var item = 0;
diff -r c5560b4eef68 -r b963011d0fbc public_html/javascript/storyeditor_fckeditor.js
--- a/public_html/javascript/storyeditor_fckeditor.js	Sun Jan 18 16:48:19 2009 -0500
+++ b/public_html/javascript/storyeditor_fckeditor.js	Sun Jan 18 21:09:44 2009 -0500
@@ -24,6 +24,7 @@
     }
 
     function change_editmode(obj) {
+        showhideEditorDiv("editor",1);
         if (obj.value == 'html') {
             document.getElementById('html_editor').style.display='none';
             document.getElementById('text_editor').style.display='';
@@ -76,9 +77,8 @@
 
     function swapEditorContent(curmode,instanceName) {
         var content = '';
-        var oEditor = FCKeditorAPI.GetInstance(instanceName) ;
-
-        if (curmode == 'adveditor') { // Switching from Text to HTML mode
+        var oEditor = FCKeditorAPI.GetInstance(instanceName);
+        if (curmode == 'adveditor') { // Switching from Text/HTML mode to AdvancedEditor Mode
             // Get the content from the textarea 'text' content and copy it to the editor
             if (instanceName == 'introhtml' )  {
                 content = document.getElementById('introtext').value;
@@ -90,11 +90,13 @@
                 } catch (e) {}
 
         } else {
-               content = getEditorContent(instanceName);
-              if (instanceName == 'introhtml' )  {
-                  document.getElementById('introtext').value = content;
-              } else {
-                  document.getElementById('bodytext').value = content;
+              content = getEditorContent(instanceName);
+              if (content != '') {
+                  if (instanceName == 'introhtml' )  {
+                      document.getElementById('introtext').value = content;
+                  } else {
+                      document.getElementById('bodytext').value = content;
+                  }
               }
           }
     }
diff -r c5560b4eef68 -r b963011d0fbc public_html/layout/professional/admin/story/storyeditor_advanced.thtml
--- a/public_html/layout/professional/admin/story/storyeditor_advanced.thtml	Sun Jan 18 16:48:19 2009 -0500
+++ b/public_html/layout/professional/admin/story/storyeditor_advanced.thtml	Sun Jan 18 21:09:44 2009 -0500
@@ -212,7 +212,7 @@
                 <p>{permissions_msg}</p>
             </fieldset>
         </div>
-        <div id="se_bottom" style="width:100%; paddin:3px; margin-top:20px;">
+        <div id="se_bottom" style="width:100%; paddin:3px; margin-top:20px;display:{show_submitoptions}">
             <input type="submit" value="{lang_save}" name="mode"{xhtml}>
             <span style="padding-right:10px;padding-left:10px;"><input type="submit" value="{lang_preview}" name="mode"{xhtml}></span>
             <span style="padding-right:50px;"><input type="submit" value="{lang_cancel}" name="mode"{xhtml}></span>



More information about the geeklog-cvs mailing list