diff --git a/include/admin/tpl/entries.inc.tpl b/include/admin/tpl/entries.inc.tpl index 11fbfbeb..0469510f 100644 --- a/include/admin/tpl/entries.inc.tpl +++ b/include/admin/tpl/entries.inc.tpl @@ -102,8 +102,6 @@ {/if} - -
{$formtoken} diff --git a/include/admin/tpl/serendipity_plugin_config.fnc.tpl b/include/admin/tpl/serendipity_plugin_config.fnc.tpl index 333a7616..6eaf4006 100644 --- a/include/admin/tpl/serendipity_plugin_config.fnc.tpl +++ b/include/admin/tpl/serendipity_plugin_config.fnc.tpl @@ -8,9 +8,6 @@ var img_plus = '{serendipity_getFile file="img/plus.png"}'; var img_minus = '{serendipity_getFile file="img/minus.png"}'; -{if $allow_admin_scripts} - -{/if} {if $showSubmit_head}
diff --git a/templates/2k11/admin/admin_scripts.js b/templates/2k11/admin/admin_scripts.js deleted file mode 100644 index ecd63907..00000000 --- a/templates/2k11/admin/admin_scripts.js +++ /dev/null @@ -1,99 +0,0 @@ -// File referenced in: -// – include/admin/tpl/entries.inc.tpl -// – include/admin/tpl/serendipity_plugin_config.fnc.tpl -// – include/functions_plugins_admin.inc.php -// – templates/*/admin/media_pane.tpl - -// usage: log('inside coolFunc', this, arguments); -// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ -window.log = function f(){ log.history = log.history || []; log.history.push(arguments); if(this.console) { var args = arguments, newarr; try { args.callee = f.caller } catch(e) {}; newarr = [].slice.call(args); if (typeof console.log === 'object') log.apply.call(console.log, console, newarr); else console.log.apply(console, newarr);}}; - -// make it safe to use console.log always -(function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());){a[d]=a[d]||b;}}) -(function(){try{console.log();return window.console;}catch(a){return (window.console={});}}()); - - -// place any jQuery/helper plugins in here, instead of separate, slower script files. - -// Serendipity backend functions - used in -// - serendipity_plugins_admin.inc.php::serendipity_plugin_config() function -// - templates/default/admin/default_staticpage_backend.tpl - - -// Collapse/expand one config group -function showConfig(id) { - if (document.getElementById) { - plugbox = document.getElementById(id); - if (plugbox.style.display == 'none') { - document.getElementById('option' + id).src = img_minus; - plugbox.style.display = ''; - } else { - document.getElementById('option' + id).src = img_plus; - plugbox.style.display = 'none'; - } - } -} - -// Collapse/expand all config groups -var state=''; - -function showConfigAll(count) { - if (document.getElementById) { - for (i = 1; i <= count; i++) { - document.getElementById('el' + i).style.display = state; - document.getElementById('optionel' + i).src = (state == '' ? img_minus : img_plus); - } - - if (state == '') { - document.getElementById('optionall').src = img_minus; - state = 'none'; - } else { - document.getElementById('optionall').src = img_plus; - state = ''; - } - } -} - -// Seems to check all (checkbox) elements of a given form -// NOTE: doesn't seem to be used anywhere? -function chkAll(frm, arr, mark) { - for (i = 0; i <= frm.elements.length; i++) { - try { - if(frm.elements[i].name == arr) { - frm.elements[i].checked = mark; - } - } catch (err) {} - } -} - -// Inverts a selection of checkboxes -// NOTE: – also used in serendipity_event_karma -// – similar function (but not duplicate!) exists in serendipity_editor.js -function invertSelection() { - var f = document.formMultiDelete; - - for (var i = 0; i < f.elements.length; i++) { - if (f.elements[i].type == 'checkbox') { - f.elements[i].checked = !(f.elements[i].checked); - } - } -} - -// Show (extended) filters in media db -// NOTE: since we (will) use this in various sections of the backend, we -// probably want a more generic function for this -function showFilters() { - s = document.getElementById('moreFilter').style; - - if (s.display == 'none') { - s.display = 'block'; - } else { - s.display = 'none'; - } -} - -// Add another (image) keyword -function AddKeyword(keyword) { - s = document.getElementById('keyword_input').value; - document.getElementById('keyword_input').value = (s != '' ? s + ';' : '') + keyword; -} diff --git a/templates/2k11/admin/media_pane.tpl b/templates/2k11/admin/media_pane.tpl index cc482b7f..a4d4a931 100644 --- a/templates/2k11/admin/media_pane.tpl +++ b/templates/2k11/admin/media_pane.tpl @@ -1,7 +1,6 @@ {* HTML5: Yes *} {* jQuery: No *} -

{$CONST.FIND_MEDIA}

diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl index 3b14ebd6..6a909c7c 100644 --- a/templates/2k11/admin/serendipity_editor.js.tpl +++ b/templates/2k11/admin/serendipity_editor.js.tpl @@ -14,6 +14,14 @@ # All rights reserved. See LICENSE file for licensing details */ +// usage: log('inside coolFunc', this, arguments); +// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ +window.log = function f(){ log.history = log.history || []; log.history.push(arguments); if(this.console) { var args = arguments, newarr; try { args.callee = f.caller } catch(e) {}; newarr = [].slice.call(args); if (typeof console.log === 'object') log.apply.call(console.log, console, newarr); else console.log.apply(console, newarr);}}; + +// make it safe to use console.log always +(function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());){a[d]=a[d]||b;}}) +(function(){try{console.log();return window.console;}catch(a){return (window.console={});}}()); + // Fires functions which are generated dynamically in backend PHP files // (i.e. include/functions_entries_admin.inc.php) which load the various // WYSIWYG editors in entries editor, HTML nuggets etc. @@ -186,6 +194,25 @@ function serendipity_imageSelector_addToElement (str, id) { $input.change(); } +// Show (extended) filters in media db +// NOTE: since we (will) use this in various sections of the backend, we +// probably want a more generic function for this +function showFilters() { + s = document.getElementById('moreFilter').style; + + if (s.display == 'none') { + s.display = 'block'; + } else { + s.display = 'none'; + } +} + +// Add another (image) keyword +function AddKeyword(keyword) { + s = document.getElementById('keyword_input').value; + document.getElementById('keyword_input').value = (s != '' ? s + ';' : '') + keyword; +} + // "Transfer" value from media db popup to textarea, including wysiwyg // This gets textarea="body"/"extended" and tries to insert into the textarea named serendipity[body]/serendipity[extended] function serendipity_imageSelector_addToBody (str, textarea) { @@ -352,6 +379,52 @@ function toggle_extended(setCookie) { } } +// Collapse/expand one config group +function showConfig(id) { + if (document.getElementById) { + plugbox = document.getElementById(id); + if (plugbox.style.display == 'none') { + document.getElementById('option' + id).src = img_minus; + plugbox.style.display = ''; + } else { + document.getElementById('option' + id).src = img_plus; + plugbox.style.display = 'none'; + } + } +} + +// Collapse/expand all config groups +var state=''; + +function showConfigAll(count) { + if (document.getElementById) { + for (i = 1; i <= count; i++) { + document.getElementById('el' + i).style.display = state; + document.getElementById('optionel' + i).src = (state == '' ? img_minus : img_plus); + } + + if (state == '') { + document.getElementById('optionall').src = img_minus; + state = 'none'; + } else { + document.getElementById('optionall').src = img_plus; + state = ''; + } + } +} + +// Seems to check all (checkbox) elements of a given form +// NOTE: doesn't seem to be used anywhere? +function chkAll(frm, arr, mark) { + for (i = 0; i <= frm.elements.length; i++) { + try { + if(frm.elements[i].name == arr) { + frm.elements[i].checked = mark; + } + } catch (err) {} + } +} + // Collapses/expands the category selector function showItem(id) { if (id == undefined) { @@ -469,7 +542,7 @@ function FT_toggle(id) { } // Inverts a selection of checkboxes -// NOTE: similar function (but not duplicate!) exists in admin_scripts.js +// NOTE: similar function (but not duplicate!) from admin_scripts.js, see below function invertSelection() { jQuery('.input_checkbox').each(function(index, checkbox) { jQuery(checkbox).attr('checked', ! jQuery(checkbox).attr('checked')); @@ -478,6 +551,25 @@ function invertSelection() { }); } +// ------------------------------------------------------------------------------ +// This duplicate of invertSelection() was used in the defunct admin_scripts.js. +// Somebody needs to figure out why there were two functions of the same name +// and which one is supposed to be used or if both should be used in different +// contexts. Commented out since I assume that the first one is the proper one … +// ------------------------------------------------------------------------------ +// Inverts a selection of checkboxes +// NOTE: – also used in serendipity_event_karma +// function invertSelection() { +// var f = document.formMultiDelete; + +// for (var i = 0; i < f.elements.length; i++) { +// if (f.elements[i].type == 'checkbox') { +// f.elements[i].checked = !(f.elements[i].checked); +// } +// } +// } + + // Purely cosmetic function to highlight/dehighlight a comment by toggling the class comment_selected function highlightComment(id, checkvalue) { jQuery('#'+id).toggleClass('comment_selected');