smartified functions_plugins_admin.inc.php
This commit is contained in:
55
templates/default/admin/admin_scripts.js
Normal file
55
templates/default/admin/admin_scripts.js
Normal file
@ -0,0 +1,55 @@
|
||||
// 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
|
||||
function showConfig(id) {
|
||||
if (document.getElementById) {
|
||||
dlm = document.getElementById(id);
|
||||
if (dlm.style.display == 'none') {
|
||||
document.getElementById('option' + id).src = img_minus;
|
||||
dlm.style.display = '';
|
||||
} else {
|
||||
document.getElementById('option' + id).src = img_plus;
|
||||
dlm.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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) {}
|
||||
}
|
||||
}
|
||||
|
12
templates/default/admin/image_selector.js
Normal file
12
templates/default/admin/image_selector.js
Normal file
@ -0,0 +1,12 @@
|
||||
function change_preview(id)
|
||||
{
|
||||
var text_box = document.getElementById('serendipity[template][' + id + ']');
|
||||
var image_box = document.getElementById(id + '_preview');
|
||||
var filename = text_box.value;
|
||||
image_box.style.backgroundImage = 'url(' + filename + ')';
|
||||
image_box.style.backgroundRepeat = 'no-repeat';
|
||||
}
|
||||
function choose_media(id)
|
||||
{
|
||||
window.open('serendipity_admin_image_selector.php?serendipity[htmltarget]=' + id + '&serendipity[filename_only]=true', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');
|
||||
}
|
Reference in New Issue
Block a user