# HG changeset patch
# User Dan
# Date 1237697706 14400
# Node ID a86a69394a9549d665e5bb1e58ae5fe95a1fad70
# Parent d6c7b310295dbbe52cc674cbcb5869fa9f4d5084
Major revamp to sidebar editor. Some behavioral changes as well as being based on jQuery UI Sortables. Creation interface remains the same, but better strings merged in from stable.
diff -r d6c7b310295d -r a86a69394a95 images/rename.png
Binary file images/rename.png has changed
diff -r d6c7b310295d -r a86a69394a95 includes/clientside/css/enano-shared.css
--- a/includes/clientside/css/enano-shared.css Sun Mar 22 00:46:44 2009 -0400
+++ b/includes/clientside/css/enano-shared.css Sun Mar 22 00:55:06 2009 -0400
@@ -150,6 +150,11 @@
padding-right: 5px;
}
+div.toolbar_vert li > span {
+ display: block;
+ padding: 4px 5px;
+}
+
div.breadcrumbs { margin: 10px 0; padding: 5px; border: 1px solid #AAAAAA; background-color: #E8E8E8; font-size: smaller; font-weight: bold; }
/* Tables */
@@ -325,55 +330,6 @@
display: block;
}
-/*
- * Docking Boxes code (for the sidebar editor)
- */
-
-/* group container(s) */
-#sbedit {
- margin: 0;
- padding: 0;
- /* position:relative; /* additional outer containers must also have position:relative */
-}
-/* keyboard navigation tooltip */
-.dbx-tooltip {
- display:block;
- position:absolute;
- margin:36px 0 0 125px;
- width:185px;
- border:1px solid #000;
- background:#ffd;
- color:#000;
- font:normal normal normal 0.85em tahoma, arial, sans-serif;
- padding:2px 4px 3px 5px;
- text-align:left;
- }
-* html .dbx-tooltip { width:195px; }
-
-/* use CSS2 system colors in CSS2 browsers
- but not safari, which doesn't support them */
-*[class="dbx-tooltip"]:lang(en) {
- border-color:InfoText;
- background:InfoBackground;
- color:InfoText;
- font:small-caption;
- font-weight:normal;
- }
-/* additional clone styles */
-.dbx-clone {
- opacity: 0.8;
-}
-.dbx-content ul {
- margin: 0; padding: 0;
- list-style: none;
-}
-.dbx-content li a, .dbx-content li a:hover {
- text-decoration: none; color: #666;
-}
-.dbx-content2 {
- margin: 0px 1px 0px 1px;
-}
-
/* Progress bars */
div.progressbar {
padding: 2px;
@@ -1002,3 +958,63 @@
background-repeat: no-repeat;
margin: 0 auto;
}
+
+/**
+ * Sidebar editor
+ */
+
+div.sbedit-block {
+ background-color: #f7f7f7;
+ border: 1px solid #c2c2c2;
+ padding: 4px;
+ width: 150px;
+ margin: 0 7px 5px 0;
+}
+
+div.sbedit-block.disabled {
+ background-color: #ffe2e2;
+ border-color: #c7a1a1;
+}
+
+div.sbedit-handle {
+ background-color: #c7c7c7;
+ border: 1px solid #909090;
+ padding: 2px;
+ margin-bottom: 3px;
+ cursor: move;
+}
+
+div.sbedit-block.disabled div.sbedit-handle {
+ background-color: #c77272;
+ border-color: #aa6060;
+}
+
+div.sbedit-handle input {
+ display: none;
+ width: 96%;
+}
+
+div.sbedit-float {
+ position: absolute;
+ top: 20px;
+ left: 20px;
+}
+
+td.sbedit-column {
+ vertical-align: top;
+ /* 150 + 4*2 + 7 + 3 (the 3 being a trial-and-error computation) */
+ width: 168px;
+}
+
+.ui-sortable-placeholder {
+ background-color: #e2e2e2 !important;
+ border: 1px dashed #b7b7b7 !important;
+ visibility: visible !important;
+ height: 50px !important;
+}
+
+.ui-sortable-helper {
+ opacity: 0.6;
+ filter: alpha(opacity=60);
+}
+
diff -r d6c7b310295d -r a86a69394a95 includes/clientside/dbx-key.js
--- a/includes/clientside/dbx-key.js Sun Mar 22 00:46:44 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-function dbx_set_key()
-{
- //initialise the docking boxes manager
- var manager = new dbxManager('main'); //session ID [/-_a-zA-Z0-9/]
-
- //onstatechange fires when any group state changes
- manager.onstatechange = function()
- {
- //copy the state string to a local var
- var state = this.state;
-
- //remove group name and open/close state tokens
- state = state.replace(/sbedit_(left|right)=/ig, '').replace(/[\-\+]/g, '');
-
- //split into an array
- state = state.split('&');
-
- //output field
- var field = document.getElementById('divOrder_Left');
- field.value = state[0];
- var field = document.getElementById('divOrder_Right');
- field.value = state[1];
-
- //return value determines whether cookie is set
- return false;
- };
-
- //create new docking boxes group
- var sbedit_left = new dbxGroup(
- 'sbedit_left', // container ID [/-_a-zA-Z0-9/]
- 'vertical', // orientation ['vertical'|'horizontal']
- '7', // drag threshold ['n' pixels]
- 'no', // restrict drag movement to container axis ['yes'|'no']
- '10', // animate re-ordering [frames per transition, or '0' for no effect]
- 'no', // include open/close toggle buttons ['yes'|'no']
- 'open', // default state ['open'|'closed']
- 'open', // word for "open", as in "open this box"
- 'close', // word for "close", as in "close this box"
- 'click-down and drag to move this box', // sentence for "move this box" by mouse
- 'click to %toggle% this box', // pattern-match sentence for "(open|close) this box" by mouse
- 'use the arrow keys to move this box', // sentence for "move this box" by keyboard
- ', or press the enter key to %toggle% it', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
- '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
- );
-
- //create new docking boxes group
- var sbedit_right = new dbxGroup(
- 'sbedit_right', // container ID [/-_a-zA-Z0-9/]
- 'vertical', // orientation ['vertical'|'horizontal']
- '7', // drag threshold ['n' pixels]
- 'no', // restrict drag movement to container axis ['yes'|'no']
- '10', // animate re-ordering [frames per transition, or '0' for no effect]
- 'no', // include open/close toggle buttons ['yes'|'no']
- 'open', // default state ['open'|'closed']
- 'open', // word for "open", as in "open this box"
- 'close', // word for "close", as in "close this box"
- 'click-down and drag to move this box', // sentence for "move this box" by mouse
- 'click to %toggle% this box', // pattern-match sentence for "(open|close) this box" by mouse
- 'use the arrow keys to move this box', // sentence for "move this box" by keyboard
- ', or press the enter key to %toggle% it', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
- '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
- );
-}
diff -r d6c7b310295d -r a86a69394a95 includes/clientside/dbx.css
--- a/includes/clientside/dbx.css Sun Mar 22 00:46:44 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/****************************************************************
- Docking Boxes core CSS: YOU MUST NOT CHANGE OR OVERRIDE THESE
-*****************************************************************/
-.dbx-clone {
- position:absolute;
- visibility:hidden;
- }
-.dbx-clone, .dbx-clone .dbx-handle-cursor {
- cursor:move !important;
- }
-.dbx-dummy {
- display:block;
- width:0;
- height:0;
- overflow:hidden;
- }
-.dbx-group, .dbx-box, .dbx-handle {
- position:relative;
- display:block;
- }
-
-
-
-/****************************************************************
- avoid padding, margins or borders on dbx-box,
- to reduce visual discrepancies between it and the clone.
- overall, dbx-box is best left as visually unstyled as possible
-*****************************************************************/
-.dbx-box {
- margin:0;
- padding:0;
- border:none;
- }
-
diff -r d6c7b310295d -r a86a69394a95 includes/clientside/dbx.js
--- a/includes/clientside/dbx.js Sun Mar 22 00:46:44 2009 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-// DBX2.05 :: Docking Boxes (dbx)
-// *****************************************************
-// DOM scripting by brothercake -- http://www.brothercake.com/
-// GNU Lesser General Public License -- http://www.gnu.org/licenses/lgpl.html
-//******************************************************
-var dbx;function dbxManager(sid){dbx = this;if(!/^[-_a-z0-9]+$/i.test(sid)) { alert('Error from dbxManager:\n"' + sid + '" is an invalid session ID'); return; }this.supported = !(document.getElementsByTagName('*').length == 0 || (navigator.vendor == 'KDE' && typeof window.sidebar == 'undefined'));if(!this.supported) { return; }this.etype = typeof document.addEventListener != 'undefined' ? 'addEventListener' : typeof document.attachEvent != 'undefined' ? 'attachEvent' : 'none';this.eprefix = (this.etype == 'attachEvent' ? 'on' : '');if(typeof window.opera != 'undefined' && parseFloat(navigator.userAgent.toLowerCase().split(/opera[\/ ]/)[1].split(' ')[0], 10) < 7.5){this.etype = 'none';}if(this.etype == 'none') { this.supported = false; return; }this.running = 0;this.sid = sid;this.savedata = {};this.cookiestate = this.getCookieState();};dbxManager.prototype.setCookieState = function(){var now = new Date();now.setTime(now.getTime() + (365*24*60*60*1000));var str = '';for(j in this.savedata){if(typeof this.savedata[j]!='function'){str += j + '=' + this.savedata[j] + '&'}}this.state = str.replace(/^(.+)&$/, '$1');this.cookiestring = this.state.replace(/,/g, '|');this.cookiestring = this.cookiestring.replace(/=/g, ':');if(typeof this.onstatechange == 'undefined' || this.onstatechange()){document.cookie = 'dbx-' + this.sid + '='+ this.cookiestring+ '; expires=' + now.toGMTString()+ '; path=/';}};dbxManager.prototype.getCookieState = function(){this.cookiestate = null;if(document.cookie){if(document.cookie.indexOf('dbx-' + this.sid)!=-1){this.cookie = document.cookie.split('dbx-' + this.sid + '=')[1].split(';')[0].split('&');for(var i in this.cookie){if(typeof this.cookie[i]!='function'){this.cookie[i] = this.cookie[i].replace(/\|/g, ',');this.cookie[i]= this.cookie[i].replace(/:/g, '=');this.cookie[i] = this.cookie[i].split('=');this.cookie[i][1] = this.cookie[i][1].split(',');}}this.cookiestate = {};for(i in this.cookie){if(typeof this.cookie[i]!='function'){this.cookiestate[this.cookie[i][0]] = this.cookie[i][1];}}}}return this.cookiestate;};dbxManager.prototype.addDataMember = function(gid, order){this.savedata[gid] = order;};dbxManager.prototype.createElement = function(tag){return typeof document.createElementNS != 'undefined' ? document.createElementNS('http://www.w3.org/1999/xhtml', tag) : document.createElement(tag);};dbxManager.prototype.getTarget = function(e, pattern, node){if(typeof node != 'undefined'){var target = node;}else{target = typeof e.target != 'undefined' ? e.target : e.srcElement;}var regex = new RegExp(pattern, '');while(!regex.test(target.className)){target = target.parentNode;}return target;};function dbxGroup(gid, dir, thresh, fix, ani, togs, def, open, close, move, toggle, kmove, ktoggle, syntax){if(!/^[-_a-z0-9]+$/i.test(gid)) { alert('Error from dbxGroup:\n"' + gid + '" is an invalid container ID'); return; }this.container = document.getElementById(gid);if(this.container == null || !dbx.supported) { return; }var self = this;this.gid = gid;this.dragok = false;this.box = null;this.vertical = dir == 'vertical';this.threshold = parseInt(thresh, 10);this.restrict = fix == 'yes';this.resolution = parseInt(ani, 10);this.toggles = togs == 'yes';this.defopen = def != 'closed';this.vocab = {'open' : open,'close' : close,'move' : move,'toggle' : toggle,'kmove' : kmove,'ktoggle' : ktoggle,'syntax' : syntax};this.container.style.position = 'relative';this.container.style.display = 'block';if(typeof window.opera != 'undefined'){this.container.style.display = 'run-in';}this.boxes = [];this.buttons = [];this.order = [];this.eles = this.container.getElementsByTagName('*');for(var i=0; i ' + $lang.get('etc_save_changes') + ' | ' + $lang.get('etc_cancel') + ' ' + $lang.get('sbedit_msg_cant_edit_plugin_body', { close_link: 'a href="#" onclick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); return false;"' }) + '> 5] |= 0x80 << ((len) % 32); x[(((len + 64) >>> 9) << 4) + 14] = len; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for(var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; var oldc = c; var oldd = d; a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
- a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);c = md5_ff(c, d, a, b, x[i+10], 17, -42063);b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
- c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
- a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
- c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
- a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
- c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
- a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); } return Array(a, b, c, d); }
-function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); }
-function md5_ff(a, b, c, d, x, s, t) { return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); }
-function md5_gg(a, b, c, d, x, s, t) { return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); }
-function md5_hh(a, b, c, d, x, s, t) { return md5_cmn(b ^ c ^ d, a, b, x, s, t); }
-function md5_ii(a, b, c, d, x, s, t) { return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); }
-function core_hmac_md5(key, data) { var bkey = str2binl(key); if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); var ipad = Array(16), opad = Array(16); for(var i = 0; i < 16; i++) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5C5C5C5C; } var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); return core_md5(opad.concat(hash), 512 + 128); }
-function safe_add(x, y) {var lsw = (x & 0xFFFF) + (y & 0xFFFF);var msw = (x >> 16) + (y >> 16) + (lsw >> 16);return (msw << 16) | (lsw & 0xFFFF); }
-function bit_rol(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)); }
-function str2binl(str) { var bin = Array(); var mask = (1 << chrsz) - 1; for(var i = 0; i < str.length * chrsz; i += chrsz) bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); return bin; }
-function binl2str(bin) { var str = ""; var mask = (1 << chrsz) - 1; for(var i = 0; i < bin.length * 32; i += chrsz) str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); return str; }
-function binl2hex(binarray) { var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; var str = ""; for(var i = 0; i < binarray.length * 4; i++) { str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); } return str; }
-function binl2b64(binarray) { var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var str = ""; for(var i = 0; i < binarray.length * 4; i += 3) { var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16) | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); for(var j = 0; j < 4; j++) { if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); } } return str; }
-
diff -r d6c7b310295d -r a86a69394a95 includes/clientside/sbedit.js
--- a/includes/clientside/sbedit.js Sun Mar 22 00:46:44 2009 -0400
+++ b/includes/clientside/sbedit.js Sun Mar 22 00:55:06 2009 -0400
@@ -1,193 +1,266 @@
-var disenable_currentBlock;
-function ajaxDisenableBlock(id)
-{
- disenable_currentBlock = document.getElementById('disabled_'+id);
- ajaxGet(makeUrlNS('Special', 'EditSidebar', 'action=disenable&ajax=true&noheaders&id='+id), function()
- {
- if ( ajax.readyState == 4 && ajax.status == 200 )
+addOnloadHook(function()
+ {
+ load_component(['jquery', 'jquery-ui']);
+ $('.sbedit-column').sortable({
+ handle: '.sbedit-handle',
+ connectWith: '.sbedit-column',
+ stop: function()
{
- if(ajax.responseText == 'GOOD')
- {
- if(disenable_currentBlock.style.display == 'none')
- {
- disenable_currentBlock.style.display = 'inline';
- }
- else
- {
- disenable_currentBlock.style.display = 'none';
- }
- }
- else
- {
- document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText;
- }
+ ajaxUpdateSidebarOrder();
}
});
+ });
+
+function serialize_sidebar()
+{
+ var columns = {};
+ var i = 0;
+ $('.sbedit-column').each(function(i, e)
+ {
+ var arr = $(e).sortable('toArray');
+ for ( var j = 0; j < arr.length; j++ )
+ arr[j] = parseInt(arr[j].replace(/^block:/, ''));
+
+ i++;
+ columns[i] = arr;
+ });
+ return toJSONString(columns);
}
-var delete_currentBlock;
-function ajaxDeleteBlock(id, oElm)
+function sbedit_open_editor(a)
{
- delete_currentBlock = { 0 : id, 1 : oElm };
- ajaxGet(makeUrlNS('Special', 'EditSidebar', 'action=delete&ajax=true&noheaders&id='+id), function()
- {
- if ( ajax.readyState == 4 && ajax.status == 200 )
+ if ( auth_level < USER_LEVEL_ADMIN )
+ {
+ load_component('login');
+ ajaxDynamicReauth(function(sid)
{
- if(ajax.responseText == 'GOOD')
- {
- e = delete_currentBlock[1];
- e = e.parentNode.parentNode;
- e.parentNode.removeChild(e);
- }
- else
- {
- document.getElementById('ajaxEditContainer').innerHTML = ajax.responseText;
- }
- }
- });
+ sbedit_open_editor(a);
+ }, USER_LEVEL_ADMIN);
+ return false;
+ }
+ load_component(['fadefilter', 'l10n']);
+ var shade = darken(true, 50, 'sbedit-shade');
+ $(shade).css('z-index', 0);
+ var parent = sbedit_get_parent(a);
+ var offset = $(parent).offset();
+ var top = (( getHeight() ) / 2) - 200 + getScrollOffset();
+ var box = $(parent)
+ .clone()
+ .empty()
+ .attr('id', 'sb_blockedit')
+ .addClass('sbedit-float')
+ .css('height', $(parent).height())
+ .css('top', offset.top)
+ .css('left', offset.left)
+ .appendTo('body')
+ .animate({ width: 500, height: 400, top: top, left: (getWidth() / 2) - 250 }, 400, function()
+ {
+ var whitey = whiteOutElement(this);
+ $(this).append('');
+ $(this).append('
' + $lang.get('sbedit_msg_cant_edit_plugin_title') + '
Return to the Main Page.', }, sbedit: { + header_msg: 'This control panel allows you to organize the sidebars, the collections of links and dynamic blocks that provide navigation for your site. Drag and drop blocks to move them between the left and right sidebars; changes will be saved automatically. Red blocks are disabled. This panel only works if you have Javascript enabled and working in your browser. Create a new block.', + msg_order_update_success: 'The sidebar order information was updated successfully.', err_demo_php_disable: 'Adding PHP code blocks in the Enano administration demo has been disabled for security reasons.', msg_item_added: 'The item was added.', create_intro: 'What type of block should this be?', - block_type_wiki: 'Wiki-formatted block', - block_type_tpl: 'Template-formatted block (old pre-beta 3 behavior)', - block_type_html: 'Raw HTML block', - block_type_php: 'PHP code block (danger, Will Robinson!)', - block_type_plugin: 'Use code from a plugin', + block_type_wiki: 'Textual content (wikitext)', + block_type_tpl: 'List of links', + block_type_html: 'Pure HTML', + block_type_php: 'PHP code', + block_type_plugin: 'Plugin block', field_block_title: 'Block title:', field_block_sidebar: 'Which sidebar:', field_block_sidebar_left: 'Left', field_block_sidebar_right: 'Right', - field_wikitext: 'Wikitext:', - field_tplcode: 'Template code:', - field_html: 'HTML to place inside the sidebar:', + field_wikitext: '
+ This block type is for textual content. This could be information, a random fact, or some other blob of fully formatted text. Links show up inline, + not as a list. +
++ Wikitext: +
', + field_tplcode: '+ This block type is for links. Use wikilinks (both internal and external are supported) to build a list of links. All links will be shown block-style, + or one link per line. You can use logic in these blocks as well: +
+{if user_logged_in} + [[Special:Preferences|User control panel]] +{/if}+
+ Template code: +
', + field_html: '+ This block type is for textual content. HTML you use here will not be filtered or parsed at all - it will be displayed verbatim. This gives you + slightly more control over your content but you can\'t use wikilinks or other wikitext in here. +
++ HTML to place inside the sidebar: +
', field_php_disabled: 'Creating PHP blocks in demo mode is disabled for security reasons.', field_php: 'WARNING: If you don\'t know what you\'re doing, or if you are not fluent in PHP, stop now and choose a different block type. You will brick your Enano installation if you are not careful here. - ALWAYS remember to write secure code! The Enano team is not responsible if someone drops all your tables because of an SQL injection vulnerability in your sidebar code. You are probably better off using the template-formatted block type. + ALWAYS remember to write secure code! The Enano team is not responsible if someone drops all your tables because of an SQL injection vulnerability in your sidebar code. You are probably better off using the links and logic block type.
- It is especially important to note that this code is NOT checked for errors! If there is a syntax error in your code here, it will prevent any pages from loading AT ALL. So you need to use an external PHP editor (like jEdit) to check your syntax before you hit save. + It is especially important to note that the syntax of your code is not validated here. If there is a syntax error in your code here, it might prevent Enano from working properly. It is recommended that you use an external PHP editor (like jEdit) to check your syntax before you hit save. You have been warned.
Also, you should avoid using output buffering functions (ob_[start|end|get_contents|clean]) here, because Enano uses those to track output from this script.
- The standard <?php and ?> tags work here. Don\'t use an initial "<?php" or it will cause a parse error. + The standard <?php and ?> tags work here, but don\'t use an initial "<?php" or it will cause a parse error.
PHP code:
', - field_plugin: 'Plugin:', + field_plugin: 'Plugin:
', btn_create_block: 'Create new block', msg_block_moved: 'Item moved.', @@ -1135,11 +1158,13 @@ note_block_unnamed: 'Unnamed', hint_rename: 'Double-click to rename this block', note_block_disabled: '(disabled)', - tip_disenable: 'Enable or disable this block', - tip_edit: 'Edit the contents of this block', - tip_delete: 'Permanently delete this block', - tip_move: 'Move this block to the other sidebar', - msg_delete_confirm: 'Do you really want to delete this block?', + tip_disenable: 'Toggle', + tip_edit: 'Edit block', + tip_delete: 'Delete', + tip_rename: 'Rename', + msg_delete_confirm_title: 'Delete block', + msg_delete_confirm_body: 'Are you sure you want to delete this sidebar block?', + btn_delete_confirm: 'Delete block', btn_revert: 'Revert', btn_create_new_stage1: 'Create new block', btn_main_page: 'Main Page', diff -r d6c7b310295d -r a86a69394a95 plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Sun Mar 22 00:46:44 2009 -0400 +++ b/plugins/SpecialAdmin.php Sun Mar 22 00:55:06 2009 -0400 @@ -2458,14 +2458,41 @@ } else { + if ( isset($_GET['update_order']) ) + { + header('Content-type: text/javascript'); + $order = @$_POST['order']; + try + { + $order = enano_json_decode($order); + } + catch ( Zend_Json_Exception $e ) + { + return print enano_json_encode(array( + 'mode' => 'error', + 'error' => 'bad order' + )); + } + + foreach ( $order as $sidebar_id => $blocks ) + { + foreach ( $blocks as $order => $block_id ) + { + $sbid = intval($sidebar_id); + $order = intval($order); + $block_id = intval($block_id); + $q = $db->sql_query('UPDATE ' . table_prefix . "sidebar SET sidebar_id = $sbid, item_order = $order WHERE item_id = $block_id;"); + if ( !$q ) + $db->die_json(); + } + } + + return print enano_json_encode(array( + 'mode' => 'success' + )); + } - $template->add_header(''); - $template->add_header(''); $template->add_header(''); - $template->add_header(''); - - $template->load_theme('oxygen', 'bleu'); - $template->init_vars(); $template->header(); @@ -2624,27 +2651,21 @@- get('sbedit_field_wikitext'); ?> -
+ get('sbedit_field_wikitext'); ?>
- get('sbedit_field_tplcode'); ?> -
+ get('sbedit_field_tplcode'); ?>
- get('sbedit_field_html'); ?> -
+ get('sbedit_field_html'); ?>@@ -2663,9 +2684,7 @@
- get('sbedit_field_plugin'); ?> -
+ get('sbedit_field_plugin'); ?>