summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-11-11 21:01:42 +0100
committerAndreas Gohr <andi@splitbrain.org>2005-11-11 21:01:42 +0100
commitc591aabe4bfdea879a1804e525b40a697ba9afce (patch)
tree6796ffc1993fdff066921576b237954f08194b01 /lib
parent4cb796577ee06e5db0058b4a820243db1b9a48f4 (diff)
downloadrpg-c591aabe4bfdea879a1804e525b40a697ba9afce.tar.gz
rpg-c591aabe4bfdea879a1804e525b40a697ba9afce.tar.bz2
JavaScript Fixes for the toolbar #628
darcs-hash:20051111200142-7ad00-158925aee01bc24378a8bd99ad27a6173ea085dd.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/exe/css.php4
-rw-r--r--lib/exe/js.php20
-rw-r--r--lib/scripts/edit.js14
3 files changed, 15 insertions, 23 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 9874299b0..28c06ea47 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -104,8 +104,8 @@ function css_cacheok($cache,$files){
if(!$ctime) return false; //There is no cache
// some additional files to check
- $files[] = DOKU_CONF.'dokuwiki.conf';
- $files[] = DOKU_CONF.'local.conf';
+ $files[] = DOKU_CONF.'dokuwiki.php';
+ $files[] = DOKU_CONF.'local.php';
$files[] = DOKU_TPLINC.'style.ini';
$files[] = __FILE__;
diff --git a/lib/exe/js.php b/lib/exe/js.php
index b8b8c6401..2e3fe8238 100644
--- a/lib/exe/js.php
+++ b/lib/exe/js.php
@@ -16,7 +16,6 @@ require_once(DOKU_INC.'inc/io.php');
if(!defined('SIMPLE_TEST')){
header('Content-Type: text/javascript; charset=utf-8');
js_out();
- js_dynamicout();
}
@@ -131,21 +130,6 @@ function js_out(){
}
/**
- * Adds some dynamic JavaScript using the readonly Session
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- */
-function js_dynamicout(){
- $edit = (bool) $_REQUEST['edit']; // edit or preview mode?
- $write = (bool) $_REQUEST['write']; // writable?
- $sig = (bool) $_REQUEST['sig']; // show sig button?
- if($edit && $write && $sig){
- require_once(DOKU_INC.'inc/toolbar.php');
- toolbar_addsigbutton('toolbar');
- }
-}
-
-/**
* Checks if a JavaScript Cache file still is valid
*
* @author Andreas Gohr <andi@splitbrain.org>
@@ -155,8 +139,8 @@ function js_cacheok($cache,$files){
if(!$ctime) return false; //There is no cache
// some additional files to check
- $files[] = DOKU_CONF.'dokuwiki.conf';
- $files[] = DOKU_CONF.'local.conf';
+ $files[] = DOKU_CONF.'dokuwiki.php';
+ $files[] = DOKU_CONF.'local.php';
$files[] = DOKU_CONF.'userscript.js';
$files[] = __FILE__;
diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js
index 34bd8113d..cdfed0a84 100644
--- a/lib/scripts/edit.js
+++ b/lib/scripts/edit.js
@@ -128,7 +128,7 @@ function initToolbar(tbid,edid,tb){
if(!document.getElementById){ return; }
var toolbar = document.getElementById(tbid);
var cnt = tb.length;
- for(i=0; i<cnt; i++){
+ for(var i=0; i<cnt; i++){
// create new button and add to the toolbar
btn = createToolButton(tb[i]['icon'],
tb[i]['title'],
@@ -154,6 +154,14 @@ function initToolbar(tbid,edid,tb){
jsEscape(tb[i]['insert'])+
"');return false;}");
break;
+ case 'signature':
+ if(SIG!=''){
+ eval("btn.onclick = function(){insertAtCarret('"+
+ jsEscape(edid)+"','"+
+ jsEscape(SIG)+
+ "');return false;}");
+ }
+ break;
case 'picker':
createPicker('picker'+i,
tb[i]['list'],
@@ -162,9 +170,9 @@ function initToolbar(tbid,edid,tb){
eval("btn.onclick = function(){showPicker('picker"+i+
"',this);return false;}");
break;
- case 'popup':
+ case 'mediapopup':
eval("btn.onclick = function(){window.open('"+
- jsEscape(tb[i]['url'])+"','"+
+ jsEscape(tb[i]['url']+NS)+"','"+
jsEscape(tb[i]['name'])+"','"+
jsEscape(tb[i]['options'])+
"');return false;}");