From 17582ec6bab09e9d9faf53a93d22ecb4fbf2bb47 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 5 Jun 2011 10:21:08 +0200 Subject: Add a newline when loading JavaScript files This avoids problems when the files are concatenated later. --- lib/exe/js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/exe/js.php') diff --git a/lib/exe/js.php b/lib/exe/js.php index a3efff700..5ef3b5801 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -185,7 +185,7 @@ function js_load($file){ } $data = str_replace($match[0],$idata,$data); } - echo $data; + echo "$data\n"; } /** -- cgit v1.2.3 From 43576758311bd64506284b15a3a12f153a1c1bc2 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 5 Jun 2011 11:28:43 +0200 Subject: Updated jQuery-UI, added jQuery updater, load theme in CSS dispatcher This patch adds a simple shell script to easily update the jQuery/jQuery-UI+theme bundle to the latest available version. The jQuery-UI CSS theme is now loaded in lib/exe/css.php (before plugin and template styles - 3rd party authors can override the styles). --- lib/exe/js.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'lib/exe/js.php') diff --git a/lib/exe/js.php b/lib/exe/js.php index 5ef3b5801..69bc730ac 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -34,19 +34,14 @@ function js_out(){ // The generated script depends on some dynamic options $cache = getCacheName('scripts'.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.js'); - // load jQuery, minified if compression is eanbled. - $jquery_file_path = DOKU_INC.'lib/scripts/jquery/jquery'; - if($conf['compress']) { - $jquery_file_path .= '.min'; - } - $jquery_file_path .= '.js'; + // load minified version for some files + $min = $conf['compress'] ? '.min' : ''; // array of core files $files = array( - $jquery_file_path, + DOKU_INC."lib/scripts/jquery/jquery$min.js"; DOKU_INC.'lib/scripts/jquery/jquery.cookie.js', - DOKU_INC.'lib/scripts/jquery-ui/jquery-ui.core.min.js', - DOKU_INC.'lib/scripts/jquery-ui/jquery-ui.interactions.min.js', + DOKU_INC."lib/scripts/jquery/jquery-ui$min.js", DOKU_INC.'lib/scripts/helpers.js', DOKU_INC.'lib/scripts/events.js', DOKU_INC.'lib/scripts/delay.js', -- cgit v1.2.3 From 303d4f1470333e1ba613083310ab52b886f3d68c Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 5 Jun 2011 12:15:18 +0200 Subject: fixed typo --- lib/exe/js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/exe/js.php') diff --git a/lib/exe/js.php b/lib/exe/js.php index 69bc730ac..b0618dc4c 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -39,7 +39,7 @@ function js_out(){ // array of core files $files = array( - DOKU_INC."lib/scripts/jquery/jquery$min.js"; + DOKU_INC."lib/scripts/jquery/jquery$min.js", DOKU_INC.'lib/scripts/jquery/jquery.cookie.js', DOKU_INC."lib/scripts/jquery/jquery-ui$min.js", DOKU_INC.'lib/scripts/helpers.js', -- cgit v1.2.3 From 6992ea08420671362032b795cd2972cfc0ef5f01 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 5 Jun 2011 13:15:56 +0200 Subject: fixed JavaScript compressor for certain regexes This fixes a problem with running the minified jQuery through the compressor. --- lib/exe/js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/exe/js.php') diff --git a/lib/exe/js.php b/lib/exe/js.php index b0618dc4c..e4c5c2ab8 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -294,7 +294,7 @@ function js_compress($s){ // items that don't need spaces next to them $chars = "^&|!+\-*\/%=\?:;,{}()<>% \t\n\r'\"[]"; - $regex_starters = array("(", "=", "[", "," , ":"); + $regex_starters = array("(", "=", "[", "," , ":", "!"); $whitespaces_chars = array(" ", "\t", "\n", "\r", "\0", "\x0B"); -- cgit v1.2.3 From 17e2e2545f2fd3607a14238ecee25eb7a605ce84 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 10 Jun 2011 20:26:04 +0200 Subject: Moved behavioural functions into it's own object and file JavaScript functions adding behaviours based on IDs or class names where moved to their own object into behaviour.js and where jQueryized. --- lib/exe/js.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/exe/js.php') diff --git a/lib/exe/js.php b/lib/exe/js.php index e4c5c2ab8..0d4a08ebd 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -60,6 +60,7 @@ function js_out(){ DOKU_INC.'lib/scripts/subscriptions.js', # disabled for FS#1958 DOKU_INC.'lib/scripts/hotkeys.js', DOKU_TPLINC.'script.js', + DOKU_INC.'lib/scripts/behaviour.js', ); // add possible plugin scripts and userscript @@ -121,8 +122,6 @@ function js_out(){ if($conf['locktime'] != 0){ js_runonstart("locktimer.init(".($conf['locktime'] - 60).",'".js_escape($lang['willexpire'])."',".$conf['usedraft'].", 'wiki__text')"); } - js_runonstart('scrollToMarker()'); - js_runonstart('focusMarker()'); // init hotkeys - must have been done after init of toolbar # disabled for FS#1958 js_runonstart('initializeHotkeys()'); -- cgit v1.2.3 From cd06d16faa924afeb14f864b058e01ce8867057c Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Tue, 21 Jun 2011 13:30:18 +0200 Subject: Fix index Javascript, introduce compatibility.js * Removed "use strict" statement, since it does not work with our script file joining (the statement has to be the first in a file or function) * Make index a global object again to allow overriding and enhancing * Use prefix dw_ for index object * Reintroduce index.treeattach * Support deprecated index.toggle calling convention * Add $ prefix for jQuery variables * Use slide animation for freshly loaded sublists as well * Fix various errors --- lib/exe/js.php | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/exe/js.php') diff --git a/lib/exe/js.php b/lib/exe/js.php index 0d4a08ebd..25dc8496a 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -58,6 +58,7 @@ function js_out(){ DOKU_INC.'lib/scripts/linkwiz.js', DOKU_INC.'lib/scripts/media.js', DOKU_INC.'lib/scripts/subscriptions.js', + DOKU_INC.'lib/scripts/compatibility.js', # disabled for FS#1958 DOKU_INC.'lib/scripts/hotkeys.js', DOKU_TPLINC.'script.js', DOKU_INC.'lib/scripts/behaviour.js', -- cgit v1.2.3 From c949174a2e8c324e3e463a9d10e9e6dc07b0ba9e Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Wed, 22 Jun 2011 21:05:17 +0200 Subject: Fix and refactor ajax.js * Move file to qsearch.js * Rename object to dw_qsearch * Remove unnecessary usage of Delay * Use $ prefix for jQuery objects * Fix result list hiding on click * Fix namespace shorting --- lib/exe/js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/exe/js.php') diff --git a/lib/exe/js.php b/lib/exe/js.php index 25dc8496a..28894ffc6 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -48,7 +48,7 @@ function js_out(){ DOKU_INC.'lib/scripts/cookie.js', DOKU_INC.'lib/scripts/script.js', DOKU_INC.'lib/scripts/tw-sack.js', - DOKU_INC.'lib/scripts/ajax.js', + DOKU_INC.'lib/scripts/qsearch.js', DOKU_INC.'lib/scripts/index.js', DOKU_INC.'lib/scripts/drag.js', DOKU_INC.'lib/scripts/textselection.js', -- cgit v1.2.3