[geeklog-hg] geeklog: Improved customization for Advanced Editor

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Aug 15 08:41:10 EDT 2013


changeset 9254:f9971705d9f1
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/f9971705d9f1
user: dengen <taharaxp at gmail.com>
date: Thu Aug 15 21:40:33 2013 +0900
description:
Improved customization for Advanced Editor

diffstat:

 public_html/ckeditor/functions.php  |  15 +++++++++++++++
 public_html/fckeditor/functions.php |  24 ++++++++++++++++++++++++
 public_html/lib-common.php          |  18 ++++++++++++------
 3 files changed, 51 insertions(+), 6 deletions(-)

diffs (90 lines):

diff -r 100ffc04eb36 -r f9971705d9f1 public_html/ckeditor/functions.php
--- a/public_html/ckeditor/functions.php	Wed Aug 14 14:01:53 2013 +0900
+++ b/public_html/ckeditor/functions.php	Thu Aug 15 21:40:33 2013 +0900
@@ -53,4 +53,19 @@
 {
 }
 
+/**
+ * Base function for override process to set JavaScript files
+ */
+/*
+function adveditor_setup_ckeditor($custom)
+{
+    global $_CONF, $_SCRIPTS;
+
+    // Add JavaScript
+    $_SCRIPTS->setJavaScriptFile('adveditor_ckeditor', '/ckeditor/ckeditor.js',      true, 110);
+    $_SCRIPTS->setJavaScriptFile('adveditor_main', '/javascript/advanced_editor.js', true, 111);
+    $_SCRIPTS->setJavaScriptFile('adveditor_api_ckeditor', '/ckeditor/functions.js', true, 112);
+    $_SCRIPTS->setJavaScriptFile('adveditor_custom', $custom,                        true, 113);
+}
+*/
 ?>
diff -r 100ffc04eb36 -r f9971705d9f1 public_html/fckeditor/functions.php
--- a/public_html/fckeditor/functions.php	Wed Aug 14 14:01:53 2013 +0900
+++ b/public_html/fckeditor/functions.php	Thu Aug 15 21:40:33 2013 +0900
@@ -51,6 +51,30 @@
  */
 function adveditor_init_fckeditor()
 {
+    global $_CONF, $_SCRIPTS;
+
+    // Add core JavaScript global variables
+    $script  = '<script type="text/javascript">' . LB
+             . 'var geeklogEditorBaseUrl = "' . $_CONF['site_url'] . '";' . LB
+               // Setup editor path for advanced editor JS functions
+             . 'var geeklogEditorBasePath = "' . $_CONF['site_url'] . '/fckeditor/";' . LB
+             . '</script>' . LB;
+    $_SCRIPTS->setJavaScript($script);
 }
 
+/**
+ * Base function for override process to set JavaScript files
+ */
+/*
+function adveditor_setup_fckeditor($custom)
+{
+    global $_CONF, $_SCRIPTS;
+
+    // Add JavaScript
+    $_SCRIPTS->setJavaScriptFile('adveditor_fckeditor', '/fckeditor/fckeditor.js',     true, 110);
+    $_SCRIPTS->setJavaScriptFile('adveditor_main', '/javascript/advanced_editor.js',   true, 111);
+    $_SCRIPTS->setJavaScriptFile('adveditor_api_fckeditor', '/fckeditor/functions.js', true, 112);
+    $_SCRIPTS->setJavaScriptFile('adveditor_custom', $custom,                          true, 113);
+}
+*/
 ?>
diff -r 100ffc04eb36 -r f9971705d9f1 public_html/lib-common.php
--- a/public_html/lib-common.php	Wed Aug 14 14:01:53 2013 +0900
+++ b/public_html/lib-common.php	Thu Aug 15 21:40:33 2013 +0900
@@ -8754,17 +8754,23 @@
     if (empty($footer))   $footer   = true;
     if (empty($priority)) $priority = 100;
 
-    $function = 'adveditor_init_' . $name;
-    if (function_exists($function)) $function();
-
     // Add core JavaScript global variables
     $script  = '<script type="text/javascript">' . LB
              . 'var geeklogEditorName = "' . $name . '";' . LB
-             . 'var geeklogEditorBaseUrl = "' . $_CONF['site_url'] . '";' . LB
-               // Setup editor path for advanced editor JS functions
-             . 'var geeklogEditorBasePath = "' . $_CONF['site_url'] . '/' . $name . '/";' . LB
              . '</script>' . LB;
     $_SCRIPTS->setJavaScript($script);
+
+    $function = 'adveditor_init_' . $name;
+    if (function_exists($function)) $function();
+
+    $function = 'adveditor_setup_' . $name;
+    if (function_exists($function)) {
+        $function($custom);
+        return;
+    }
+
+    if (empty($js)) return;
+
     // Add JavaScript
     $_SCRIPTS->setJavaScriptFile("adveditor_$name", $js,                             $footer, $priority);
     $_SCRIPTS->setJavaScriptFile('adveditor_main', '/javascript/advanced_editor.js', $footer, $priority + 1);



More information about the geeklog-cvs mailing list