This panel allows you to edit what the '+target_type_t+' "'+target_name_t+'" can do on ' + scope_type + '. Unless you set a permission to "Deny", these permissions may be overridden by other rules.
';
+ parser = new templateParser(data.template.acl_field_begin);
+ html += parser.run();
+
+ cls = 'row2';
+ for(var i in data.acl_types)
+ {
+ if(typeof(data.acl_types[i]) == 'number')
+ {
+ cls = ( cls == 'row1' ) ? 'row2' : 'row1';
+ p = new templateParser(data.template.acl_field_item);
+ vars = new Object();
+ vars['FIELD_DESC'] = data.acl_descs[i];
+ vars['FIELD_DENY_CHECKED'] = '';
+ vars['FIELD_DISALLOW_CHECKED'] = '';
+ vars['FIELD_WIKIMODE_CHECKED'] = '';
+ vars['FIELD_ALLOW_CHECKED'] = '';
+ vars['FIELD_NAME'] = i;
+ switch(data.current_perms[i])
+ {
+ case 1:
+ vars['FIELD_DENY_CHECKED'] = 'checked="checked"';
+ break;
+ case 2:
+ default:
+ vars['FIELD_DISALLOW_CHECKED'] = 'checked="checked"';
+ break;
+ case 3:
+ vars['FIELD_WIKIMODE_CHECKED'] = 'checked="checked"';
+ break;
+ case 4:
+ vars['FIELD_ALLOW_CHECKED'] = 'checked="checked"';
+ break;
+ }
+ vars['ROW_CLASS'] = cls;
+ p.assign_vars(vars);
+ html += p.run();
+ }
+ }
+
+ var parser = new templateParser(data.template.acl_field_end);
+ html += parser.run();
+
+ if(data.type == 'edit')
+ html += '
Comment system Javascript runtime: invalid JSON response from server, response text:
' + ajax.responseText + '
';
+ return false;
+ }
+ var response = parseJSON(ajax.responseText);
+ switch(response.mode)
+ {
+ case 'fetch':
+ document.getElementById('ajaxEditContainer').innerHTML = 'Rendering response...';
+ if(response.template)
+ comment_template = response.template;
+ setAjaxLoading();
+ renderComments(response);
+ unsetAjaxLoading();
+ break;
+ case 'redraw':
+ redrawComment(response);
+ break;
+ case 'annihilate':
+ annihiliateComment(response.id);
+ break;
+ case 'materialize':
+ alert('Your comment has been posted. If it does not appear right away, it is probably awaiting approval.');
+ hideCommentForm();
+ materializeComment(response);
+ break;
+ case 'error':
+ alert(response.error);
+ break;
+ default:
+ alert(ajax.responseText);
+ break;
+ }
+ }
+ });
+}
+
+function renderComments(data)
+{
+
+ var html = '';
+
+ // Header
+
+ html += '
Article Comments
';
+
+ var ns = ( strToPageID(title)[1]=='Article' ) ? 'article' : ( strToPageID(title)[1].toLowerCase() ) + ' page';
+
+ // Counters
+ if ( data.auth_mod_comments )
+ {
+ var cnt = ( data.auth_mod_comments ) ? data.count_total : data.count_appr;
+ if ( cnt == 0 ) cnt = 'no';
+ var s = ( cnt == 1 ) ? '' : 's';
+ var is = ( cnt == 1 ) ? 'is' : 'are';
+ html += "
There "+is+" " + cnt + " comment"+s+" on this "+ns+".";
+ if ( data.count_unappr > 0 )
+ {
+ html += ' ' + data.count_unappr + ' of those are unapproved.';
+ }
+ html += '
';
+ }
+ else
+ {
+ var cnt = data.count_appr;
+ if ( cnt == 0 ) cnt = 'no';
+ var s = ( cnt == 1 ) ? '' : 's';
+ var is = ( cnt == 1 ) ? 'is' : 'are';
+ html += "
There "+is+" " + cnt + " comment"+s+" on this "+ns+".";
+ if ( data.count_unappr > 0 )
+ {
+ var s = ( data.count_unappr == 1 ) ? '' : 's';
+ var is = ( data.count_unappr == 1 ) ? 'is' : 'are';
+ html += ' However, there '+is+' '+data.count_unappr+' additional comment'+s+' awaiting approval.';
+ }
+ html += '
';
+ }
+
+ // Comment display
+
+ if ( data.count_total > 0 )
+ {
+ var parser = new templateParser(comment_template);
+ for ( var i = 0; i < data.comments.length; i++ )
+ {
+ var tplvars = new Object();
+
+ if ( data.comments[i].approved != '1' && !data.auth_mod_comments )
+ continue;
+
+ tplvars.ID = i;
+ tplvars.DATETIME = data.comments[i].time;
+ tplvars.SUBJECT = data.comments[i].subject;
+ tplvars.DATA = data.comments[i].comment_data;
+ tplvars.SIGNATURE = data.comments[i].signature;
+
+ if ( data.comments[i].approved != '1' )
+ tplvars.SUBJECT += ' (Unapproved)';
+
+ // Name
+ tplvars.NAME = data.comments[i].name;
+ if ( data.comments[i].user_id > 1 )
+ tplvars.NAME = '' + data.comments[i].name + '';
+
+ // User level
+ tplvars.USER_LEVEL = 'Guest';
+ if ( data.comments[i].user_level >= data.user_level.member ) tplvars.USER_LEVEL = 'Member';
+ if ( data.comments[i].user_level >= data.user_level.mod ) tplvars.USER_LEVEL = 'Moderator';
+ if ( data.comments[i].user_level >= data.user_level.admin ) tplvars.USER_LEVEL = 'Administrator';
+
+ // Send PM link
+ tplvars.SEND_PM_LINK=(data.comments[i].user_id>1)?'Send private message ':'';
+
+ // Add buddy link
+ tplvars.ADD_BUDDY_LINK=(data.comments[i].user_id>1)?'Add to buddy list ':'';
+
+ // Edit link
+ tplvars.EDIT_LINK='edit';
+
+ // Delete link
+ tplvars.DELETE_LINK='delete';
+
+ // Moderation: (Un)approve link
+ var appr = ( data.comments[i].approved == 1 ) ? 'Unapprove' : 'Approve';
+ tplvars.MOD_APPROVE_LINK=''+appr+'';
+
+ // Moderation: Delete post link
+ tplvars.MOD_DELETE_LINK='Delete';
+
+ var tplbool = new Object();
+
+ tplbool.signature = ( data.comments[i].signature == '' ) ? false : true;
+ tplbool.can_edit = ( data.auth_edit_comments && ( ( data.comments[i].user_id == data.user_id && data.logged_in ) || data.auth_mod_comments ) );
+ tplbool.auth_mod = data.auth_mod_comments;
+
+ parser.assign_vars(tplvars);
+ parser.assign_bool(tplbool);
+
+ html += '
' + parser.run() + '
';
+ }
+ }
+
+ // Posting form
+
+ html += '
Got something to say?
';
+ html += '
If you have comments or suggestions on this article, you can shout it out here.';
+ if ( data.approval_needed )
+ html+=' Before your post will be visible to the public, a moderator will have to approve it.';
+ html += ' Leave a comment...
';
+ html += '
';
+ html += '
';
+ html += '
Your name/screen name:
';
+ if ( data.user_id > 1 ) html += data.username + '';
+ else html += '';
+ html += '
';
+ html += '
Comment subject:
';
+ html += '
Comment:
';
+ if ( !data.logged_in && data.guest_posting == '1' )
+ {
+ html += '
Visual confirmation: Please enter the confirmation code seen in the image on the right into the box. If you cannot read the code, please click on the image to generate a new one. This helps to prevent automated bot posting.
';
+ html += ' ';
+ html += ' Confirmation code: ';
+ html += ' ';
+ html += '
';
+ }
+ html += '
';
+ html += '
';
+ html += '
';
+
+ document.getElementById('ajaxEditContainer').innerHTML = html;
+
+ for ( i = 0; i < data.comments.length; i++ )
+ {
+ document.getElementById('comment_source_'+i).value = data.comments[i].comment_source;
+ }
+
+}
+
+function displayCommentForm()
+{
+ document.getElementById('leave_comment_button').style.display = 'none';
+ document.getElementById('comment_form').style.display = 'block';
+}
+
+function hideCommentForm()
+{
+ document.getElementById('leave_comment_button').style.display = 'inline';
+ document.getElementById('comment_form').style.display = 'none';
+}
+
+function editComment(id, link)
+{
+ var ctr = document.getElementById('subject_'+id);
+ var subj = trim(ctr.firstChild.nodeValue); // If there's a span in there that says 'unapproved', this eliminates it
+ ctr.innerHTML = '';
+ var ipt = document.createElement('input');
+ ipt.id = 'subject_edit_'+id;
+ ipt.value = subj;
+ ctr.appendChild(ipt);
+
+ var src = document.getElementById('comment_source_'+id).value;
+ var cmt = document.getElementById('comment_'+id);
+ cmt.innerHTML = '';
+ var ta = document.createElement('textarea');
+ ta.rows = '10';
+ ta.cols = '40';
+ ta.value = src;
+ ta.id = 'comment_edit_'+id;
+ cmt.appendChild(ta);
+
+ link.style.fontWeight = 'bold';
+ link.innerHTML = 'save';
+ link.onclick = function() { var id = this.id.substr(this.id.indexOf('_')+1); saveComment(id, this); return false; };
+}
+
+function saveComment(id, link)
+{
+ var data = document.getElementById('comment_edit_'+id).value;
+ var subj = document.getElementById('subject_edit_'+id).value;
+ var div = document.getElementById('comment_holder_'+id);
+ var real_id = div.getElementsByTagName('input')[0]['value'];
+ var req = {
+ 'mode' : 'edit',
+ 'id' : real_id,
+ 'local_id' : id,
+ 'data' : data,
+ 'subj' : subj
+ };
+ link.style.fontWeight = 'normal';
+ link.innerHTML = 'edit';
+ link.onclick = function() { var id = this.id.substr(this.id.indexOf('_')+1); editComment(id, this); return false; };
+ ajaxComments(req);
+}
+
+function deleteComment(id)
+{
+ //var c = confirm('Do you really want to delete this comment?');
+ //if(!c);
+ // return false;
+ var div = document.getElementById('comment_holder_'+id);
+ var real_id = div.getElementsByTagName('input')[0]['value'];
+ var req = {
+ 'mode' : 'delete',
+ 'id' : real_id,
+ 'local_id' : id
+ };
+ ajaxComments(req);
+}
+
+function submitComment()
+{
+ var name = document.getElementById('commentform_name').value;
+ var subj = document.getElementById('commentform_subject').value;
+ var text = document.getElementById('commentform_message').value;
+ if ( document.getElementById('commentform_captcha') )
+ {
+ var captcha_code = document.getElementById('commentform_captcha').value;
+ var captcha_id = document.getElementById('commentform_captcha_id').value;
+ }
+ else
+ {
+ var captcha_code = '';
+ var captcha_id = '';
+ }
+ var req = {
+ 'mode' : 'submit',
+ 'name' : name,
+ 'subj' : subj,
+ 'text' : text,
+ 'captcha_code' : captcha_code,
+ 'captcha_id' : captcha_id
+ };
+ ajaxComments(req);
+}
+
+function redrawComment(data)
+{
+ if ( data.subj )
+ {
+ document.getElementById('subject_' + data.id).innerHTML = data.subj;
+ }
+ if ( data.approved && data.approved != '1' )
+ {
+ document.getElementById('subject_' + data.id).innerHTML += ' (Unapproved)';
+ }
+ if ( data.approved )
+ {
+ var appr = ( data.approved == '1' ) ? 'Unapprove' : 'Approve';
+ document.getElementById('comment_approve_'+data.id).innerHTML = appr;
+ var p = document.getElementById('comment_status');
+ var count = p.firstChild.nodeValue.split(' ')[2];
+ if ( p.firstChild.nextSibling )
+ {
+ var span = p.firstChild.nextSibling;
+ var is = ( data.approved == '1' ) ? -1 : 1;
+ var n_unapp = parseInt(span.firstChild.nodeValue.split(' ')[0]) + is;
+ n_unapp = n_unapp + '';
+ }
+ else
+ {
+ var span = document.createElement('span');
+ p.innerHTML += ' ';
+ span.innerHTML = ' ';
+ span.style.color = '#D84308';
+ var n_unapp = '1';
+ p.appendChild(span);
+ }
+ span.innerHTML = n_unapp + ' of those are unapproved.';
+ if ( n_unapp == '0' )
+ p.removeChild(span);
+ }
+ if ( data.text )
+ {
+ document.getElementById('comment_' + data.id).innerHTML = data.text;
+ }
+ if ( data.src )
+ {
+ document.getElementById('comment_source_' + data.id).value = data.src;
+ }
+}
+
+function approveComment(id)
+{
+ var div = document.getElementById('comment_holder_'+id);
+ var real_id = div.getElementsByTagName('input')[0]['value'];
+ var req = {
+ 'mode' : 'approve',
+ 'id' : real_id,
+ 'local_id' : id
+ };
+ ajaxComments(req);
+}
+
+// Does the actual DOM object removal
+function annihiliateComment(id) // Did I spell that right?
+{
+ // Approved?
+ var p = document.getElementById('comment_status');
+
+ if(document.getElementById('comment_approve_'+id))
+ {
+ var appr = document.getElementById('comment_approve_'+id).firstChild.nodeValue;
+ if ( p.firstChild.nextSibling && appr == 'Approve' )
+ {
+ var span = p.firstChild.nextSibling;
+ var t = span.firstChild.nodeValue;
+ var n_unapp = ( parseInt(t.split(' ')[0]) ) - 1;
+ if ( n_unapp == 0 )
+ p.removeChild(span);
+ else
+ span.firstChild.nodeValue = n_unapp + t.substr(t.indexOf(' '));
+ }
+ }
+
+ var div = document.getElementById('comment_holder_'+id);
+ div.parentNode.removeChild(div);
+ var t = p.firstChild.nodeValue.split(' ');
+ t[2] = ( parseInt(t[2]) - 1 ) + '';
+ delete(t.toJSONString);
+ if ( t[2] == '1' )
+ {
+ t[1] = 'is';
+ t[3] = 'comment';
+ }
+ else
+ {
+ t[1] = 'are';
+ t[3] = 'comments';
+ }
+ t = implode(' ', t);
+ p.firstChild.nodeValue = t;
+}
+
+function materializeComment(data)
+{
+ // Intelligently get an ID
+
+ var i = 0;
+ var brother;
+ while ( true )
+ {
+ var x = document.getElementById('comment_holder_'+i);
+ if(!x)
+ break;
+ brother = x;
+ i++;
+ }
+
+ var parser = new templateParser(comment_template);
+ var tplvars = new Object();
+
+ if ( data.approved != '1' && !data.auth_mod_comments )
+ return false;
+
+ tplvars.ID = i;
+ tplvars.DATETIME = data.time;
+ tplvars.SUBJECT = data.subject;
+ tplvars.DATA = data.comment_data;
+ tplvars.SIGNATURE = data.signature;
+
+ tplvars.NAME = data.name;
+ if ( data.user_id > 1 )
+ tplvars.NAME = '' + data.name + '';
+
+ if ( data.approved != '1' )
+ tplvars.SUBJECT += ' (Unapproved)';
+
+ // User level
+ tplvars.USER_LEVEL = 'Guest';
+ if ( data.user_level >= data.user_level_list.member ) tplvars.USER_LEVEL = 'Member';
+ if ( data.user_level >= data.user_level_list.mod ) tplvars.USER_LEVEL = 'Moderator';
+ if ( data.user_level >= data.user_level_list.admin ) tplvars.USER_LEVEL = 'Administrator';
+
+ // Send PM link
+ tplvars.SEND_PM_LINK=(data.user_id>1)?'Send private message ':'';
+
+ // Add buddy link
+ tplvars.ADD_BUDDY_LINK=(data.user_id>1)?'Add to buddy list ':'';
+
+ // Edit link
+ tplvars.EDIT_LINK='edit';
+
+ // Delete link
+ tplvars.DELETE_LINK='delete';
+
+ // Moderation: (Un)approve link
+ var appr = ( data.approved == 1 ) ? 'Unapprove' : 'Approve';
+ tplvars.MOD_APPROVE_LINK=''+appr+'';
+
+ // Moderation: Delete post link
+ tplvars.MOD_DELETE_LINK='Delete';
+
+ var tplbool = new Object();
+
+ tplbool.signature = ( data.signature == '' ) ? false : true;
+ tplbool.can_edit = ( data.auth_edit_comments && ( ( data.user_id == data.user_id && data.logged_in ) || data.auth_mod_comments ) );
+ tplbool.auth_mod = data.auth_mod_comments;
+
+ parser.assign_vars(tplvars);
+ parser.assign_bool(tplbool);
+
+ var div = document.createElement('div');
+ div.id = 'comment_holder_'+i;
+
+ div.innerHTML = '' + parser.run();
+
+ if ( brother )
+ {
+ brother.parentNode.insertBefore(div, brother.nextSibling);
+ }
+ else
+ {
+ // No comments in ajaxEditContainer, insert it after the header
+ var aec = document.getElementById("ajaxEditContainer");
+ aec.insertBefore(div, aec.firstChild.nextSibling.nextSibling);
+ }
+
+ document.getElementById('comment_source_'+i).value = data.comment_source;
+
+ var p = document.getElementById('comment_status');
+ var t = p.firstChild.nodeValue.split(' ');
+ var n = ( isNaN(parseInt(t[2])) ) ? 0 : parseInt(t[2]);
+ t[2] = ( n + 1 ) + '';
+ delete(t.toJSONString);
+ if ( t[2] == '1' )
+ {
+ t[1] = 'is';
+ t[3] = 'comment';
+ }
+ else
+ {
+ t[1] = 'are';
+ t[3] = 'comments';
+ }
+ t = implode(' ', t);
+ p.firstChild.nodeValue = t;
+
+ if(document.getElementById('comment_approve_'+i))
+ {
+ var appr = document.getElementById('comment_approve_'+i).firstChild.nodeValue;
+ if ( p.firstChild.nextSibling && appr == 'Approve' )
+ {
+ var span = p.firstChild.nextSibling;
+ var t = span.firstChild.nodeValue;
+ var n_unapp = ( parseInt(t.split(' ')[0]) ) - 1;
+ if ( n_unapp == 0 )
+ p.removeChild(span);
+ else
+ span.firstChild.nodeValue = n_unapp + t.substr(t.indexOf(' '));
+ }
+ else if ( appr == 'Approve' && !p.firstChild.nextSibling )
+ {
+ var span = document.createElement('span');
+ p.innerHTML += ' ';
+ span.innerHTML = '1 of those are unapproved.';
+ span.style.color = '#D84308';
+ var n_unapp = '1';
+ p.appendChild(span);
+ }
+ }
+
+}
+
+function htmlspecialchars(text)
+{
+ text = text.replace(//g, '>');
+ return text;
+}
+
+// Equivalent to PHP trim() function
+function trim(text)
+{
+ text = text.replace(/^([\s]+)/, '');
+ text = text.replace(/([\s]+)$/, '');
+ return text;
+}
+
+// Equivalent to PHP implode() function
+function implode(chr, arr)
+{
+ if ( typeof ( arr.toJSONString ) == 'function' )
+ delete(arr.toJSONString);
+
+ var ret = '';
+ var c = 0;
+ for ( var i in arr )
+ {
+ if(i=='toJSONString')continue;
+ if ( c > 0 )
+ ret += chr;
+ ret += arr[i];
+ c++;
+ }
+ return ret;
+}
+
+function nl2br(text)
+{
+ var regex = new RegExp(unescape('%0A'), 'g');
+ return text.replace(regex, ' ' + unescape('%0A'));
+}
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/dropdown.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/dropdown.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,508 @@
+/*
+ * The jBox menu system. Written by Dan Fuhry and licensed under the GPL.
+ */
+
+// Cache of DOM and event objects, used in setTimeout() calls due to scope rules
+var jBoxObjCache = new Object();
+
+// Cache of "correct" heights for unordered list objects used in submenus. Helps the animation routine know what height it's aiming for.
+var jBoxMenuHeights = new Object();
+
+// Blocks animations from running if there's already an animation going on the same object
+var jBoxSlideBlocker = new Object();
+
+// Speed at which the menus should slide open. 1 to 100 or -1 to disable.
+// Setting this higher than 100 will cause an infinite loop in the browser.
+// Default is 80 - anything higher than 90 means exponential speed increase
+var slide_speed = 80;
+
+// Inertia value to start with
+// Default is 0
+var inertia_base = 0;
+
+// Value added to inertia_base on each frame - generally 1 to 3 is good, with 1 being slowest animation
+// Default is 1
+var inertia_inc = 1;
+
+// Opacity that menus should fade to. 1 to 100 or -1 to disable fades. This only works if the slide effect is also enabled.
+// Default is 100
+var jBox_opacity = 100;
+
+// Adds the jBox CSS to the HTML header. Called on window onload.
+function jBoxInit()
+{
+ setTimeout('jBoxBatchSetup();', 200);
+}
+
+// Initializes each menu.
+function jBoxBatchSetup()
+{
+ var menus = document.getElementsByClassName('div', 'menu_nojs');
+ if ( menus.length > 0 )
+ {
+ for ( var i in menus )
+ {
+ if ( typeof(menus[i]) != 'object')
+ continue; // toJSONString() compatibility
+ jBoxSetup(menus[i]);
+ }
+ }
+}
+
+// Initializes a div with a jBox menu in it.
+function jBoxSetup(obj)
+{
+ $(obj).addClass('menu');
+ removeTextNodes(obj);
+ for ( var i in obj.childNodes )
+ {
+ /* normally this would be done in about 2 lines of code, but javascript is so picky..... */
+ if ( obj.childNodes[i] )
+ {
+ if ( obj.childNodes[i].tagName )
+ {
+ if ( obj.childNodes[i].tagName.toLowerCase() == 'a' )
+ {
+ if ( obj.childNodes[i].nextSibling.tagName )
+ {
+ if ( obj.childNodes[i].nextSibling.tagName.toLowerCase() == 'ul' || ( obj.childNodes[i].nextSibling.tagName.toLowerCase() == 'div' && obj.childNodes[i].nextSibling.className == 'submenu' ) )
+ {
+ // Calculate height
+ var ul = obj.childNodes[i].nextSibling;
+ domObjChangeOpac(0, ul);
+ ul.style.display = 'block';
+ var dim = fetch_dimensions(ul);
+ if ( !ul.id )
+ ul.id = 'jBoxmenuobj_' + Math.floor(Math.random() * 10000000);
+ jBoxMenuHeights[ul.id] = parseInt(dim['h']) - 2; // subtract 2px for border width
+ ul.style.display = 'none';
+ domObjChangeOpac(100, ul);
+
+ // Setup events
+ obj.childNodes[i].onmouseover = function() { jBoxOverHandler(this); };
+ obj.childNodes[i].onmouseout = function(e) { jBoxOutHandler(this, e); };
+ obj.childNodes[i].nextSibling.onmouseout = function(e) { jBoxOutHandler(this, e); };
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+// Called when user hovers mouse over a submenu
+function jBoxOverHandler(obj)
+{
+ // Random ID used to track the object to perform on
+ var seed = Math.floor(Math.random() * 1000000);
+ jBoxObjCache[seed] = obj;
+
+ // Sleep for a (little more than a tenth of a) second to see if the user really wants the menu to expand
+ setTimeout('if(isOverObj(jBoxObjCache['+seed+'], false, false)) jBoxOverHandlerBin(jBoxObjCache['+seed+']);', 150);
+}
+
+// Displays a menu.
+function jBoxOverHandlerBin(obj)
+{
+ var others = obj.parentNode.getElementsByTagName('ul');
+ for ( var i in others )
+ {
+ if(typeof(others[i]) == 'object')
+ {
+ others[i].style.display = 'none';
+ others[i].previousSibling.className = '';
+ }
+ }
+ var others = obj.parentNode.getElementsByTagName('div');
+ for ( var i in others )
+ {
+ if(typeof(others[i]) == 'object')
+ {
+ if ( others[i].className == 'submenu' )
+ {
+ others[i].style.display = 'none';
+ others[i].previousSibling.className = '';
+ }
+ }
+ }
+ if(obj.nextSibling.tagName.toLowerCase() == 'ul' || ( obj.nextSibling.tagName.toLowerCase() == 'div' && obj.nextSibling.className == 'submenu' ))
+ {
+ obj.className = 'liteselected';
+ var ul = obj.nextSibling;
+ var dim = fetch_dimensions(obj);
+ var off = fetch_offset(obj);
+ var dimh = parseInt(dim['h']);
+ var offtop = parseInt(off['top']);
+ var top = dimh + offtop;
+ left = off['left'];
+ ul.style.left = left + 'px';
+ ul.style.top = top + 'px';
+ domObjChangeOpac(0, ul);
+ ul.style.clip = 'rect(auto,auto,auto,auto)';
+ ul.style.overflow = 'visible';
+ ul.style.display = 'block';
+ slideOut(ul);
+ }
+}
+
+function jBoxOutHandler(obj, event)
+{
+ var seed = Math.floor(Math.random() * 1000000);
+ var seed2 = Math.floor(Math.random() * 1000000);
+ jBoxObjCache[seed] = obj;
+ jBoxObjCache[seed2] = event;
+ setTimeout('jBoxOutHandlerBin(jBoxObjCache['+seed+'], jBoxObjCache['+seed2+']);', 750);
+}
+
+function jBoxOutHandlerBin(obj, event)
+{
+ var caller = obj.tagName.toLowerCase();
+ if(caller == 'a')
+ {
+ a = obj;
+ ul = obj.nextSibling;
+ }
+ else if(caller == 'ul' || caller == 'div')
+ {
+ a = obj.previousSibling;
+ ul = obj;
+ }
+ else
+ {
+ return false;
+ }
+
+ if (!isOverObj(a, false, event) && !isOverObj(ul, true, event))
+ {
+ a.className = '';
+
+ slideIn(ul);
+
+ }
+
+ return true;
+}
+
+// Slide an element downwards until it is at full height.
+// First parameter should be a DOM object with style.display = block and opacity = 0.
+
+var sliderobj = new Object();
+
+function slideOut(obj)
+{
+ if ( jBoxSlideBlocker[obj.id] )
+ return false;
+
+ jBoxSlideBlocker[obj.id] = true;
+
+ if ( slide_speed == -1 )
+ {
+ obj.style.display = 'block';
+ return false;
+ }
+
+ var currentheight = 0;
+ var targetheight = jBoxMenuHeights[obj.id];
+ var inertiabase = inertia_base;
+ var inertiainc = inertia_inc;
+ slideStep(obj, 0);
+ domObjChangeOpac(100, obj);
+ obj.style.overflow = 'hidden';
+
+ // Don't edit past here
+ var timercnt = 0;
+
+ var seed = Math.floor(Math.random() * 1000000);
+ sliderobj[seed] = obj;
+
+ var framecnt = 0;
+
+ while(true)
+ {
+ framecnt++;
+ timercnt += ( 100 - slide_speed );
+ inertiabase += inertiainc;
+ currentheight += inertiabase;
+ if ( currentheight > targetheight )
+ currentheight = targetheight;
+ setTimeout('slideStep(sliderobj['+seed+'], '+currentheight+', '+targetheight+');', timercnt);
+ if ( currentheight >= targetheight )
+ break;
+ }
+ timercnt = timercnt + ( 100 - slide_speed );
+ setTimeout('jBoxSlideBlocker[sliderobj['+seed+'].id] = false;', timercnt);
+ var opacstep = jBox_opacity / framecnt;
+ var opac = 0;
+ var timerstep = 0;
+ domObjChangeOpac(0, obj);
+ while(true)
+ {
+ timerstep += ( 100 - slide_speed );
+ opac += opacstep;
+ setTimeout('domObjChangeOpac('+opac+', sliderobj['+seed+']);', timerstep);
+ if ( opac >= jBox_opacity )
+ break;
+ }
+}
+
+function slideIn(obj)
+{
+ if ( obj.style.display != 'block' )
+ return false;
+
+ if ( jBoxSlideBlocker[obj.id] )
+ return false;
+
+ jBoxSlideBlocker[obj.id] = true;
+
+ var targetheight = 0;
+ var dim = fetch_dimensions(obj);
+ var currentheight = jBoxMenuHeights[obj.id];
+ var origheight = currentheight;
+ var inertiabase = inertia_base;
+ var inertiainc = inertia_inc;
+ domObjChangeOpac(100, obj);
+ obj.style.overflow = 'hidden';
+
+ // Don't edit past here
+ var timercnt = 0;
+
+ var seed = Math.floor(Math.random() * 1000000);
+ sliderobj[seed] = obj;
+
+ var framecnt = 0;
+
+ for(var j = 0;j<100;j++) // while(true)
+ {
+ framecnt++;
+ timercnt = timercnt + ( 100 - slide_speed );
+ inertiabase = inertiabase + inertiainc;
+ currentheight = currentheight - inertiabase;
+ if ( currentheight < targetheight )
+ currentheight = targetheight;
+ setTimeout('slideStep(sliderobj['+seed+'], '+currentheight+');', timercnt);
+ if ( currentheight <= targetheight )
+ break;
+ }
+ timercnt += ( 100 - slide_speed );
+ setTimeout('sliderobj['+seed+'].style.display="none";sliderobj['+seed+'].style.height="'+origheight+'px";jBoxSlideBlocker[sliderobj['+seed+'].id] = false;', timercnt);
+
+ var opacstep = jBox_opacity / framecnt;
+ var opac = jBox_opacity;
+ var timerstep = 0;
+ domObjChangeOpac(100, obj);
+ while(true)
+ {
+ timerstep += ( 100 - slide_speed );
+ opac -= opacstep;
+ setTimeout('domObjChangeOpac('+opac+', sliderobj['+seed+']);', timerstep);
+ if ( opac <= 0 )
+ break;
+ }
+
+}
+
+function slideStep(obj, height, maxheight)
+{
+ obj.style.height = height + 'px';
+ //obj.style.clip = 'rect(3px,auto,'+maxheight+'px,auto)';
+ obj.style.overflow = 'hidden';
+ //obj.style.clip = 'rect('+height+'px,0px,'+maxheight+'px,auto);';
+}
+
+function isOverObj(obj, bias, event)
+{
+ var fieldUL = new Object();
+ var dim = fetch_dimensions(obj);
+ var off = fetch_offset(obj);
+ fieldUL['top'] = off['top'];
+ fieldUL['left'] = off['left'];
+ fieldUL['right'] = off['left'] + dim['w'];
+ fieldUL['bottom'] = off['top'] + dim['h'];
+
+ //document.getElementById('debug').innerHTML = '
Mouse: x: '+mouseX+', y:' + mouseY + ' '; // + document.getElementById('debug').innerHTML;
+
+ if(bias)
+ {
+ if ( ( mouseX < fieldUL['left'] + 2 || mouseX > fieldUL['right'] - 5 ) ||
+ ( mouseY < fieldUL['top'] - 2 || mouseY > fieldUL['bottom'] - 2 ) )
+ {
+ return false;
+ }
+ }
+ else
+ {
+ if ( ( mouseX < fieldUL['left'] || mouseX > fieldUL['right'] ) ||
+ ( mouseY < fieldUL['top'] || mouseY > fieldUL['bottom'] ) )
+ return false;
+ }
+
+ return true;
+
+ /*
+ var tgt = event.target;
+ if ( !tgt )
+ return false;
+ do {
+ if ( tgt == obj )
+ return true;
+ tgt = tgt.parentNode;
+ } while (tgt.tagName.toLowerCase() != 'body' );
+ return false;
+ */
+}
+
+function jBoxGarbageCollection(e)
+{
+ setMousePos(e);
+ var menus = document.getElementsByClassName('div', 'menu');
+ if ( menus.length > 0 )
+ {
+ for ( var i in menus )
+ {
+ if ( typeof(menus[i]) != 'object')
+ continue; // toJSONString() compatibility
+ var uls = menus[i].getElementsByTagName('ul');
+ if ( uls.length > 0 )
+ {
+ for ( var j = 0; j < uls.length; j++ )
+ {
+ if ( !isOverObj(uls[j], false, e) )
+ {
+ uls[j].previousSibling.className = '';
+ //uls[j].style.display = 'none';
+ slideIn(uls[j]);
+ }
+ }
+ }
+ var uls = getElementsByClassName(menus[i], 'divs', 'submenu');
+ if ( uls.length > 0 )
+ {
+ for ( var j = 0; j < uls.length; j++ )
+ {
+ if ( !isOverObj(uls[j], false, e) )
+ {
+ uls[j].previousSibling.className = '';
+ //uls[j].style.display = 'none';
+ slideIn(uls[j]);
+ }
+ }
+ }
+ }
+ }
+}
+
+document.onclick = jBoxGarbageCollection;
+
+function removeTextNodes(obj)
+{
+ if(obj)
+ {
+ if(typeof(obj.tagName) != 'string')
+ {
+ if ( obj.nodeType == 3 && obj.data.match(/^([\s]*)$/ig) )
+ {
+ obj.parentNode.removeChild(obj);
+ return;
+ }
+ }
+ if(obj.firstChild)
+ {
+ for(var i in obj.childNodes)
+ {
+ removeTextNodes(obj.childNodes[i]);
+ }
+ }
+ }
+}
+
+var getElementsByClassName = function(parent, type, cls) {
+ if(!type)
+ type = '*';
+ ret = new Array();
+ el = parent.getElementsByTagName(type);
+ for ( var i in el )
+ {
+ if ( typeof(el[i]) != 'object')
+ continue; // toJSONString() compatibility
+ if(el[i].className)
+ {
+ if(el[i].className.indexOf(' ') > 0)
+ {
+ classes = el[i].className.split(' ');
+ }
+ else
+ {
+ classes = new Array();
+ classes.push(el[i].className);
+ }
+ if ( in_array(cls, classes) )
+ ret.push(el[i]);
+ }
+ }
+ return ret;
+}
+
+document.getElementsByClassName = function(type, cls) {
+ return getElementsByClassName(document, type, cls);
+}
+
+function setMousePos(event)
+{
+ if(IE)
+ {
+ if(!event)
+ {
+ event = window.event;
+ }
+ clX = event.clientX;
+ sL = document.body.scrollLeft;
+ mouseX = clX + sL;
+ mouseY = event.clientY + document.body.scrollTop;
+ return;
+ }
+ if( typeof(event.clientX) == 'number' )
+ {
+ mouseX = event.clientX;
+ mouseY = event.clientY;
+ return;
+ }
+ else if( typeof(event.layerX) == 'number' )
+ {
+ mouseX = event.layerX;
+ mouseY = event.layerY;
+ return;
+ }
+ else if( typeof(event.offsetX) == 'number' )
+ {
+ mouseX = event.offsetX;
+ mouseY = event.offsetY;
+ return;
+ }
+ else if( typeof(event.screenX) == 'number' )
+ {
+ mouseX = event.screenX;
+ mouseY = event.screenY;
+ return;
+ }
+ else if( typeof(event.x) == 'number' )
+ {
+ mouseX = event.x;
+ mouseY = event.y;
+ return;
+ }
+}
+
+document.onmousemove = function(e)
+{
+ setMousePos(e);
+};
+
+function domObjChangeOpac(opacity, id) {
+ var object = id.style;
+ object.opacity = (opacity / 100);
+ object.MozOpacity = (opacity / 100);
+ object.KhtmlOpacity = (opacity / 100);
+ object.filter = "alpha(opacity=" + opacity + ")";
+}
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/dynano.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/dynano.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,129 @@
+// The "Dynano" Javascript framework. Similar in syntax to JQuery but only has what Enano needs.
+
+var $ = function(id)
+{
+ return new DNobj(id);
+}
+var $dynano = $;
+function DNobj(id)
+{
+ this.object = ( typeof(id) == 'object' ) ? id : document.getElementById(id);
+ this.height = __DNObjGetHeight(this.object);
+ this.width = __DNObjGetWidth(this.object);
+
+ if ( this.object.tagName == 'TEXTAREA' && typeof(tinyMCE) == 'object' )
+ {
+ this.object.dnIsMCE = 'no';
+ this.switchToMCE = DN_switchToMCE;
+ this.destroyMCE = DN_destroyMCE;
+ this.getContent = DN_mceFetchContent;
+ }
+}
+function __DNObjGetHeight(o) {
+ return o.offsetHeight;
+}
+
+function __DNObjGetWidth(o) {
+ return o.offsetWidth;
+}
+
+function addClass(obj, clsname)
+{
+ var cnt = obj.className;
+ var space = ( (cnt + '').length > 0 ) ? ' ' : '';
+ var cls = cnt + space + clsname;
+ obj.className = cls;
+}
+
+function rmClass(obj, clsname)
+{
+ var cnt = obj.className;
+ if ( cnt == clsname )
+ {
+ obj.className = '';
+ }
+ else
+ {
+ cnt = cnt.replace(clsname, '');
+ cnt = trim(cnt);
+ obj.className = cnt;
+ }
+}
+
+function hasClass(obj, clsname)
+{
+ var cnt = obj.className;
+ if ( !cnt )
+ return false;
+ if ( cnt == clsname )
+ return true;
+ cnt = cnt.split(' ');
+
+ for ( var i in cnt )
+ if ( cnt[i] == clsname )
+ return true;
+
+ return false;
+}
+function __DNObjGetLeft(obj) {
+ var left_offset = obj.offsetLeft;
+ while ((obj = obj.offsetParent) != null) {
+ left_offset += obj.offsetLeft;
+ }
+ return left_offset;
+}
+
+function __DNObjGetTop(obj) {
+ var left_offset = obj.offsetTop;
+ while ((obj = obj.offsetParent) != null) {
+ left_offset += obj.offsetTop;
+ }
+ return left_offset;
+}
+
+function DN_switchToMCE()
+{
+ //if ( this.object.dn_is_mce )
+ // return this;
+ if ( !this.object.id )
+ this.object.id = 'textarea_' + Math.floor(Math.random() * 1000000);
+ if ( !this.object.name )
+ this.object.name = 'textarea_' + Math.floor(Math.random() * 1000000);
+ tinyMCE.addMCEControl(this.object, this.object.name, document);
+ this.object.dnIsMCE = 'yes';
+ return this;
+}
+
+function DN_destroyMCE()
+{
+ //if ( !this.object.dn_is_mce )
+ // return this;
+ if ( this.object.name )
+ tinyMCE.removeMCEControl(this.object.name);
+ this.object.dnIsMCE = 'no';
+ return this;
+}
+
+function DN_mceFetchContent()
+{
+ if ( this.object.name )
+ {
+ var text = this.object.value;
+ if ( tinyMCE.getInstanceById(this.object.name) )
+ text = tinyMCE.getContent(this.object.name);
+ return text;
+ }
+ else
+ {
+ return this.object.value;
+ }
+}
+
+DNobj.prototype.addClass = function(clsname) { addClass(this.object, clsname); return this; };
+DNobj.prototype.rmClass = function(clsname) { rmClass( this.object, clsname); return this; };
+DNobj.prototype.hasClass = function(clsname) { return hasClass(this.object, clsname); };
+DNobj.prototype.Height = function() { return __DNObjGetHeight(this.object); }
+DNobj.prototype.Width = function() { return __DNObjGetWidth( this.object); }
+DNobj.prototype.Left = function() { /* return this.object.offsetLeft; */ return __DNObjGetLeft(this.object); }
+DNobj.prototype.Top = function() { /* return this.object.offsetTop; */ return __DNObjGetTop( this.object); }
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/editor.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/editor.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,22 @@
+// Javascript routines for the page editor
+
+function initTinyMCE(e)
+{
+ if ( typeof(tinyMCE) == 'object' )
+ {
+ tinyMCE.init({
+ mode : "exact",
+ elements : '',
+ plugins : 'table',
+ theme_advanced_resize_horizontal : false,
+ theme_advanced_resizing : true,
+ theme_advanced_toolbar_location : "top",
+ theme_advanced_toolbar_align : "left",
+ theme_advanced_buttons1_add : "fontselect,fontsizeselect",
+ theme_advanced_buttons3_add_before : "tablecontrols,separator",
+ theme_advanced_statusbar_location : 'bottom'
+ });
+ }
+}
+addOnloadHook(initTinyMCE);
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/enano-lib-basic.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/enano-lib-basic.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,328 @@
+/*
+ * Enano - an open source wiki-like CMS
+ * Copyright (C) 2006-2007 Dan Fuhry
+ * Javascript client library
+ *
+ * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
+ *
+ * For more information about Enano, please visit http://www.enanocms.org/.
+ * All of the code in these script files may be used freely so long as the above license block is displayed and your
+ * modified code is distributed under the GPL. See the page Special:About_Enano on this website for more information.
+ */
+
+if(typeof title != 'string')
+{
+ alert('Uh-oh! The required dynamic (PHP-generated) Javascript variables don\'t seem to be available. Javascript is going to be seriously broken.');
+}
+
+// Run-time variables
+
+var detect = navigator.userAgent.toLowerCase();
+var IE;
+
+// dummy tinyMCE object
+var tinyMCE = new Object();
+
+// Detect whether the user is running the Evil One or not...
+
+function checkIt(string) {
+ place = detect.indexOf(string) + 1;
+ thestring = string;
+ return place;
+}
+if (checkIt('msie')) IE = true;
+else IE = false;
+
+var cmt_open;
+var list;
+var edit_open = false;
+var catlist = new Array();
+var arrDiff1Buttons = new Array();
+var arrDiff2Buttons = new Array();
+var arrTimeIdList = new Array();
+var list;
+var unObj;
+var unSelectMenuOn = false;
+var unObjDivCurrentId = false;
+var unObjCurrentSelection = false;
+var userlist = new Array();
+var submitAuthorized = true;
+var rDnsObj;
+var rDnsBannerObj;
+var ns4 = document.layers;
+var op5 = (navigator.userAgent.indexOf("Opera 5")!=-1) ||(navigator.userAgent.indexOf("Opera/5")!=-1);
+var op6 = (navigator.userAgent.indexOf("Opera 6")!=-1) ||(navigator.userAgent.indexOf("Opera/6")!=-1);
+var agt=navigator.userAgent.toLowerCase();
+var mac = (agt.indexOf("mac")!=-1);
+var ie = (agt.indexOf("msie") != -1);
+var mac_ie = mac && ie;
+var mouseX = 0;
+var mouseY = 0;
+var menuheight;
+var inertiabase = 1;
+var inertiainc = 1;
+var slideintervalinc = 20;
+var inertiabaseoriginal = inertiabase;
+var heightnow;
+var targetheight;
+var block;
+var slideinterval;
+var divheights = new Array();
+var __menutimeout = false;
+var startmouseX = false;
+var startmouseY = false;
+var startScroll = false;
+var is_dragging = false;
+var current_ta = false;
+var startwidth = false;
+var startheight = false;
+var do_width = false;
+
+// You have an NSIS coder in your midst...
+var MB_OK = 1;
+var MB_OKCANCEL = 2;
+var MB_YESNO = 4;
+var MB_YESNOCANCEL = 8;
+var MB_ABORTRETRYIGNORE = 16;
+var MB_ICONINFORMATION = 32;
+var MB_ICONEXCLAMATION = 64;
+var MB_ICONSTOP = 128;
+var MB_ICONQUESTION = 256;
+var MB_ICONLOCK = 512;
+
+// Syntax:
+// messagebox(MB_OK|MB_ICONINFORMATION, 'Title', 'Text');
+// :-D
+
+var main_css = document.getElementById('mdgCss').href;
+if(main_css.indexOf('?') > -1) {
+ sep = '&';
+} else sep = '?';
+var _css = false;
+var print_css = main_css + sep + 'printable';
+
+var shift;
+
+function makeUrl(page, query, html_friendly)
+{
+ url = contentPath+page;
+ if(url.indexOf('?') > 0) sep = '&';
+ else sep = '?';
+ if(query)
+ {
+ url = url + sep + query;
+ }
+ if(html_friendly)
+ {
+ url = url.replace('&', '&');
+ url = url.replace('<', '<');
+ url = url.replace('>', '>');
+ }
+ return url;
+}
+
+function makeUrlNS(namespace, page, query, html_friendly)
+{
+ var url = contentPath+namespace_list[namespace]+(page.replace(/ /g, '_'));
+ if(url.indexOf('?') > 0) sep = '&';
+ else sep = '?';
+ if(query)
+ {
+ url = url + sep + query;
+ }
+ if(html_friendly)
+ {
+ url = url.replace('&', '&');
+ url = url.replace('<', '<');
+ url = url.replace('>', '>');
+ }
+ return append_sid(url);
+}
+
+function strToPageID(string)
+{
+ // Convert Special:UploadFile to ['UploadFile', 'Special'], but convert 'Image:Enano.png' to ['Enano.png', 'File']
+ for(var i in namespace_list)
+ if(namespace_list[i] != '')
+ if(namespace_list[i] == string.substr(0, namespace_list[i].length))
+ return [string.substr(namespace_list[i].length), i];
+ return [string, 'Article'];
+}
+
+function append_sid(url)
+{
+ sep = ( url.indexOf('?') > 0 ) ? '&' : '?';
+ if(ENANO_SID.length > 10)
+ {
+ url = url + sep + 'auth=' + ENANO_SID;
+ sep = '&';
+ }
+ if ( pagepass.length > 0 )
+ {
+ url = url + sep + 'pagepass=' + pagepass;
+ }
+ return url;
+}
+
+var stdAjaxPrefix = append_sid(scriptPath+'/ajax.php?title='+title);
+
+// Code for parsing JSON strings - full source code in json.js
+if(!Object.prototype.toJSONString){Array.prototype.toJSONString=function(){var a=['['],b,i,l=this.length,v;function p(s){if(b){a.push(',');}
+a.push(s);b=true;}
+for(i=0;i= 1000 )
+ break;
+ var _f = onload_hooks[_oLc];
+ if ( typeof(_f) == 'function' )
+ {
+ _f(e);
+ }
+ }
+}
+
+addOnloadHook(function() {
+ if ( $_REQUEST['do'] )
+ {
+ var act = $_REQUEST['do'];
+ switch(act)
+ {
+ case 'comments':
+ ajaxComments();
+ break;
+ case 'edit':
+ ajaxEditor();
+ break;
+ case 'login':
+ ajaxStartLogin();
+ break;
+ case 'history':
+ ajaxHistory();
+ break;
+ case 'catedit':
+ ajaxCatEdit();
+ break;
+ }
+ }
+});
+
+
+//*/
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/faders.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/faders.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,393 @@
+// Message box system
+
+function darken(nofade)
+{
+ if(IE)
+ nofade = true;
+ if(document.getElementById('specialLayer_darkener'))
+ {
+ document.getElementById('specialLayer_darkener').style.display = 'block';
+ if(nofade)
+ {
+ document.getElementById('specialLayer_darkener').style.opacity = '0.7';
+ document.getElementById('specialLayer_darkener').style.filter = 'alpha(opacity=70)';
+ }
+ else
+ {
+ opacity('specialLayer_darkener', 0, 70, 1000);
+ }
+ } else {
+ w = getWidth();
+ h = getHeight();
+ var thediv = document.createElement('div');
+ if(IE)
+ thediv.style.position = 'absolute';
+ else
+ thediv.style.position = 'fixed';
+ thediv.style.top = '0px';
+ thediv.style.left = '0px';
+ thediv.style.opacity = '0';
+ thediv.style.filter = 'alpha(opacity=0)';
+ thediv.style.backgroundColor = '#000000';
+ thediv.style.width = '100%';
+ thediv.style.height = '100%';
+ thediv.zIndex = getHighestZ() + 5;
+ thediv.id = 'specialLayer_darkener';
+ if(nofade)
+ {
+ thediv.style.opacity = '0.7';
+ thediv.style.filter = 'alpha(opacity=70)';
+ body = document.getElementsByTagName('body');
+ body = body[0];
+ body.appendChild(thediv);
+ } else {
+ body = document.getElementsByTagName('body');
+ body = body[0];
+ body.appendChild(thediv);
+ opacity('specialLayer_darkener', 0, 70, 1000);
+ }
+ }
+}
+
+function enlighten(nofade)
+{
+ if(IE)
+ nofade = true;
+ if(document.getElementById('specialLayer_darkener'))
+ {
+ if(nofade)
+ {
+ document.getElementById('specialLayer_darkener').style.display = 'none';
+ }
+ opacity('specialLayer_darkener', 70, 0, 1000);
+ setTimeout("document.getElementById('specialLayer_darkener').style.display = 'none';", 1000);
+ }
+}
+
+/**
+ * The ultimate message box framework for Javascript
+ * Syntax is (almost) identical to the MessageBox command in NSIS
+ * @param int type - a bitfield consisting of the MB_* constants
+ * @param string title - the blue text at the top of the window
+ * @param string text - HTML for the body of the message box
+ * Properties:
+ * onclick - an array of functions to be called on button click events
+ * NOTE: key names are to be strings, and they must be the value of the input, CaSe-SeNsItIvE
+ * onbeforeclick - same as onclick but called before the messagebox div is destroyed
+ * Example:
+ * var my_message = new messagebox(MB_OK|MB_ICONSTOP, 'Error logging in', 'The username and/or password is incorrect. Please check the username and retype your password');
+ * my_message.onclick['OK'] = function() {
+ * document.getElementById('password').value = '';
+ * };
+ * Deps:
+ * Modern browser that supports DOM
+ * darken() and enlighten() (above)
+ * opacity() - required for darken() and enlighten()
+ * MB_* constants are defined in enano-lib-basic.js
+ */
+
+var mb_current_obj;
+
+function messagebox(type, title, message)
+{
+ var y = getScrollOffset();
+ if(document.getElementById('messageBox')) return;
+ darken(true);
+ var master_div = document.createElement('div');
+ var mydiv = document.createElement('div');
+ mydiv.style.width = '400px';
+ mydiv.style.height = '200px';
+ w = getWidth();
+ h = getHeight();
+ //master_div.style.left = (w / 2) - 200+'px';
+ //master_div.style.top = (h / 2) + y - 120+'px';
+ master_div.style.top = '-10000px';
+ master_div.style.position = ( IE ) ? 'absolute' : 'fixed';
+ z = getHighestZ(); // document.getElementById('specialLayer_darkener').style.zIndex;
+ mydiv.style.zIndex = parseInt(z) + 1;
+ mydiv.style.backgroundColor = '#FFFFFF';
+ mydiv.style.padding = '10px';
+ mydiv.style.marginBottom = '1px';
+ mydiv.id = 'messageBox';
+ mydiv.style.overflow = 'auto';
+
+ var buttondiv = document.createElement('div');
+ buttondiv.style.width = '400px';
+ w = getWidth();
+ h = getHeight();
+ // buttondiv.style.left = (w / 2) - 200+'px';
+ // buttondiv.style.top = (h / 2) + y + 101+'px';
+ // buttondiv.style.position = ( IE ) ? 'absolute' : 'fixed';
+ z = getHighestZ(); // document.getElementById('specialLayer_darkener').style.zIndex;
+ buttondiv.style.zIndex = parseInt(z) + 1;
+ buttondiv.style.backgroundColor = '#C0C0C0';
+ buttondiv.style.padding = '10px';
+ buttondiv.style.textAlign = 'right';
+ buttondiv.style.verticalAlign = 'middle';
+ buttondiv.id = 'messageBoxButtons';
+
+ this.clickHandler = function() { messagebox_click(this, mb_current_obj); };
+
+ if(type & MB_ICONINFORMATION || type & MB_ICONSTOP || type & MB_ICONQUESTION || type & MB_ICONEXCLAMATION || type & MB_ICONLOCK)
+ {
+ mydiv.style.paddingLeft = '50px';
+ mydiv.style.width = '360px';
+ mydiv.style.backgroundRepeat = 'no-repeat';
+ }
+
+ if(type & MB_ICONINFORMATION)
+ {
+ mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/info.png\')';
+ }
+
+ if(type & MB_ICONQUESTION)
+ {
+ mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/question.png\')';
+ }
+
+ if(type & MB_ICONSTOP)
+ {
+ mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/error.png\')';
+ }
+
+ if(type & MB_ICONEXCLAMATION)
+ {
+ mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/warning.png\')';
+ }
+
+ if(type & MB_ICONLOCK)
+ {
+ mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/lock.png\')';
+ }
+
+ if(type & MB_OK)
+ {
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'OK';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+ }
+
+ if(type & MB_OKCANCEL)
+ {
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'OK';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'Cancel';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+ }
+
+ if(type & MB_YESNO)
+ {
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'Yes';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'No';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+ }
+
+ if(type & MB_YESNOCANCEL)
+ {
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'Yes';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'No';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'Cancel';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+ }
+
+ heading = document.createElement('h2');
+ heading.innerHTML = title;
+ heading.style.color = '#50A0D0';
+ heading.style.fontFamily = 'trebuchet ms, verdana, arial, helvetica, sans-serif';
+ heading.style.fontSize = '12pt';
+ heading.style.fontWeight = 'lighter';
+ heading.style.textTransform = 'lowercase';
+ heading.style.marginTop = '0';
+ mydiv.appendChild(heading);
+
+ var text = document.createElement('div');
+ text.innerHTML = String(message);
+ this.text_area = text;
+ mydiv.appendChild(text);
+
+ this.updateContent = function(text)
+ {
+ this.text_area.innerHTML = text;
+ };
+
+ //domObjChangeOpac(0, mydiv);
+ //domObjChangeOpac(0, master_div);
+
+ body = document.getElementsByTagName('body');
+ body = body[0];
+ master_div.appendChild(mydiv);
+ master_div.appendChild(buttondiv);
+
+ body.appendChild(master_div);
+
+ setTimeout('mb_runFlyIn();', 100);
+
+ this.onclick = new Array();
+ this.onbeforeclick = new Array();
+ mb_current_obj = this;
+}
+
+function mb_runFlyIn()
+{
+ var mydiv = document.getElementById('messageBox');
+ var maindiv = mydiv.parentNode;
+ fly_in_top(maindiv, true, false);
+}
+
+function messagebox_click(obj, mb)
+{
+ val = obj.value;
+ if(typeof mb.onbeforeclick[val] == 'function')
+ {
+ var o = mb.onbeforeclick[val];
+ var resp = o();
+ if ( resp )
+ return false;
+ o = false;
+ }
+
+ var mydiv = document.getElementById('messageBox');
+ var maindiv = mydiv.parentNode;
+ var to = fly_out_top(maindiv, true, false);
+
+ setTimeout("var mbdiv = document.getElementById('messageBox'); mbdiv.parentNode.removeChild(mbdiv.nextSibling); mbdiv.parentNode.removeChild(mbdiv); enlighten(true);", to);
+ if(typeof mb.onclick[val] == 'function')
+ {
+ o = mb.onclick[val];
+ o();
+ o = false;
+ }
+}
+
+function testMessageBox()
+{
+ mb = new messagebox(MB_OKCANCEL|MB_ICONINFORMATION, 'Javascripted dynamic message boxes', 'This is soooooo coool, now if only document.createElement() worked in IE! this is some more text
this is some more text
this is some more text
this is some more text
this is some more text
this is some more text
this is some more text
this is some more text');
+ mb.onclick['OK'] = function()
+ {
+ alert('You clicked OK!');
+ }
+ mb.onbeforeclick['Cancel'] = function()
+ {
+ alert('You clicked Cancel!');
+ }
+}
+
+// Function to fade classes info-box, warning-box, error-box, etc.
+
+function fadeInfoBoxes()
+{
+ var divs = new Array();
+ d = document.getElementsByTagName('div');
+ j = 0;
+ for(var i in d)
+ {
+ if ( !d[i].tagName )
+ continue;
+ if(d[i].className=='info-box' || d[i].className=='error-box' || d[i].className=='warning-box' || d[i].className=='question-box')
+ {
+ divs[j] = d[i];
+ j++;
+ }
+ }
+ if(divs.length < 1) return;
+ for(i in divs)
+ {
+ if(!divs[i].id) divs[i].id = 'autofade_'+Math.floor(Math.random() * 100000);
+ switch(divs[i].className)
+ {
+ case 'info-box':
+ default:
+ from = '#3333FF';
+ break;
+ case 'error-box':
+ from = '#FF3333';
+ break;
+ case 'warning-box':
+ from = '#FFFF33';
+ break;
+ case 'question-box':
+ from = '#33FF33';
+ break;
+ }
+ Fat.fade_element(divs[i].id,30,2000,from,Fat.get_bgcolor(divs[i].id));
+ }
+}
+
+// Alpha fades
+
+function opacity(id, opacStart, opacEnd, millisec) {
+ //speed for each frame
+ var speed = Math.round(millisec / 100);
+ var timer = 0;
+
+ //determine the direction for the blending, if start and end are the same nothing happens
+ if(opacStart > opacEnd) {
+ for(i = opacStart; i >= opacEnd; i--) {
+ setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
+ timer++;
+ }
+ } else if(opacStart < opacEnd) {
+ for(i = opacStart; i <= opacEnd; i++)
+ {
+ setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
+ timer++;
+ }
+ }
+}
+
+//change the opacity for different browsers
+function changeOpac(opacity, id) {
+ var object = document.getElementById(id).style;
+ object.opacity = (opacity / 100);
+ object.MozOpacity = (opacity / 100);
+ object.KhtmlOpacity = (opacity / 100);
+ object.filter = "alpha(opacity=" + opacity + ")";
+}
+
+function mb_logout()
+{
+ var mb = new messagebox(MB_YESNO|MB_ICONQUESTION, 'Are you sure you want to log out?', 'If you log out, you will no longer be able to access your user preferences, your private messages, or certain areas of this site until you log in again.');
+ mb.onclick['Yes'] = function()
+ {
+ window.location = makeUrlNS('Special', 'Logout/' + title);
+ }
+}
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/faders.js~
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/faders.js~ Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,393 @@
+// Message box system
+
+function darken(nofade)
+{
+ if(IE)
+ nofade = true;
+ if(document.getElementById('specialLayer_darkener'))
+ {
+ document.getElementById('specialLayer_darkener').style.display = 'block';
+ if(nofade)
+ {
+ document.getElementById('specialLayer_darkener').style.opacity = '0.7';
+ document.getElementById('specialLayer_darkener').style.filter = 'alpha(opacity=70)';
+ }
+ else
+ {
+ opacity('specialLayer_darkener', 0, 70, 1000);
+ }
+ } else {
+ w = getWidth();
+ h = getHeight();
+ var thediv = document.createElement('div');
+ if(IE)
+ thediv.style.position = 'absolute';
+ else
+ thediv.style.position = 'fixed';
+ thediv.style.top = '0px';
+ thediv.style.left = '0px';
+ thediv.style.opacity = '0';
+ thediv.style.filter = 'alpha(opacity=0)';
+ thediv.style.backgroundColor = '#000000';
+ thediv.style.width = '100%';
+ thediv.style.height = '100%';
+ thediv.zIndex = getHighestZ() + 5;
+ thediv.id = 'specialLayer_darkener';
+ if(nofade)
+ {
+ thediv.style.opacity = '0.7';
+ thediv.style.filter = 'alpha(opacity=70)';
+ body = document.getElementsByTagName('body');
+ body = body[0];
+ body.appendChild(thediv);
+ } else {
+ body = document.getElementsByTagName('body');
+ body = body[0];
+ body.appendChild(thediv);
+ opacity('specialLayer_darkener', 0, 70, 1000);
+ }
+ }
+}
+
+function enlighten(nofade)
+{
+ if(IE)
+ nofade = true;
+ if(document.getElementById('specialLayer_darkener'))
+ {
+ if(nofade)
+ {
+ document.getElementById('specialLayer_darkener').style.display = 'none';
+ }
+ opacity('specialLayer_darkener', 70, 0, 1000);
+ setTimeout("document.getElementById('specialLayer_darkener').style.display = 'none';", 1000);
+ }
+}
+
+/**
+ * The ultimate message box framework for Javascript
+ * Syntax is (almost) identical to the MessageBox command in NSIS
+ * @param int type - a bitfield consisting of the MB_* constants
+ * @param string title - the blue text at the top of the window
+ * @param string text - HTML for the body of the message box
+ * Properties:
+ * onclick - an array of functions to be called on button click events
+ * NOTE: key names are to be strings, and they must be the value of the input, CaSe-SeNsItIvE
+ * onbeforeclick - same as onclick but called before the messagebox div is destroyed
+ * Example:
+ * var my_message = new messagebox(MB_OK|MB_ICONSTOP, 'Error logging in', 'The username and/or password is incorrect. Please check the username and retype your password');
+ * my_message.onclick['OK'] = function() {
+ * document.getElementById('password').value = '';
+ * };
+ * Deps:
+ * Modern browser that supports DOM
+ * darken() and enlighten() (above)
+ * opacity() - required for darken() and enlighten()
+ * MB_* constants are defined in enano-lib-basic.js
+ */
+
+var mb_current_obj;
+
+function messagebox(type, title, message)
+{
+ var y = getScrollOffset();
+ if(document.getElementById('messageBox')) return;
+ darken(true);
+ var master_div = document.createElement('div');
+ var mydiv = document.createElement('div');
+ mydiv.style.width = '400px';
+ mydiv.style.height = '200px';
+ w = getWidth();
+ h = getHeight();
+ //master_div.style.left = (w / 2) - 200+'px';
+ //master_div.style.top = (h / 2) + y - 120+'px';
+ master_div.style.top = '-10000px';
+ master_div.style.position = ( IE ) ? 'absolute' : 'fixed';
+ z = getHighestZ(); // document.getElementById('specialLayer_darkener').style.zIndex;
+ mydiv.style.zIndex = parseInt(z) + 1;
+ mydiv.style.backgroundColor = '#FFFFFF';
+ mydiv.style.padding = '10px';
+ mydiv.style.marginBottom = '1px';
+ mydiv.id = 'messageBox';
+ mydiv.style.overflow = 'auto';
+
+ var buttondiv = document.createElement('div');
+ buttondiv.style.width = '400px';
+ w = getWidth();
+ h = getHeight();
+ // buttondiv.style.left = (w / 2) - 200+'px';
+ // buttondiv.style.top = (h / 2) + y + 101+'px';
+ // buttondiv.style.position = ( IE ) ? 'absolute' : 'fixed';
+ z = getHighestZ(); // document.getElementById('specialLayer_darkener').style.zIndex;
+ buttondiv.style.zIndex = parseInt(z) + 1;
+ buttondiv.style.backgroundColor = '#C0C0C0';
+ buttondiv.style.padding = '10px';
+ buttondiv.style.textAlign = 'right';
+ buttondiv.style.verticalAlign = 'middle';
+ buttondiv.id = 'messageBoxButtons';
+
+ this.clickHandler = function() { messagebox_click(this, mb_current_obj); };
+
+ if(type & MB_ICONINFORMATION || type & MB_ICONSTOP || type & MB_ICONQUESTION || type & MB_ICONEXCLAMATION || type & MB_ICONLOCK)
+ {
+ mydiv.style.paddingLeft = '50px';
+ mydiv.style.width = '360px';
+ mydiv.style.backgroundRepeat = 'no-repeat';
+ }
+
+ if(type & MB_ICONINFORMATION)
+ {
+ mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/info.png\')';
+ }
+
+ if(type & MB_ICONQUESTION)
+ {
+ mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/question.png\')';
+ }
+
+ if(type & MB_ICONSTOP)
+ {
+ mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/error.png\')';
+ }
+
+ if(type & MB_ICONEXCLAMATION)
+ {
+ mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/warning.png\')';
+ }
+
+ if(type & MB_ICONLOCK)
+ {
+ mydiv.style.backgroundImage = 'url(\''+scriptPath+'/images/lock.png\')';
+ }
+
+ if(type & MB_OK)
+ {
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'OK';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+ }
+
+ if(type & MB_OKCANCEL)
+ {
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'OK';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'Cancel';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+ }
+
+ if(type & MB_YESNO)
+ {
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'Yes';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'No';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+ }
+
+ if(type & MB_YESNOCANCEL)
+ {
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'Yes';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'No';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+
+ btn = document.createElement('input');
+ btn.type = 'button';
+ btn.value = 'Cancel';
+ btn.onclick = this.clickHandler;
+ btn.style.margin = '0 3px';
+ buttondiv.appendChild(btn);
+ }
+
+ heading = document.createElement('h2');
+ heading.innerHTML = title;
+ heading.style.color = '#50A0D0';
+ heading.style.fontFamily = 'trebuchet ms, verdana, arial, helvetica, sans-serif';
+ heading.style.fontSize = '12pt';
+ heading.style.fontWeight = 'lighter';
+ heading.style.textTransform = 'lowercase';
+ heading.style.marginTop = '0';
+ mydiv.appendChild(heading);
+
+ var text = document.createElement('div');
+ text.innerHTML = String(message);
+ this.text_area = text;
+ mydiv.appendChild(text);
+
+ this.updateContent = function(text)
+ {
+ this.text_area.innerHTML = text;
+ };
+
+ //domObjChangeOpac(0, mydiv);
+ //domObjChangeOpac(0, master_div);
+
+ body = document.getElementsByTagName('body');
+ body = body[0];
+ master_div.appendChild(mydiv);
+ master_div.appendChild(buttondiv);
+
+ body.appendChild(master_div);
+
+ setTimeout('mb_runFlyIn();', 100);
+
+ this.onclick = new Array();
+ this.onbeforeclick = new Array();
+ mb_current_obj = this;
+}
+
+function mb_runFlyIn()
+{
+ var mydiv = document.getElementById('messageBox');
+ var maindiv = mydiv.parentNode;
+ fly_in_top(maindiv, true, false);
+}
+
+function messagebox_click(obj, mb)
+{
+ val = obj.value;
+ if(typeof mb.onbeforeclick[val] == 'function')
+ {
+ var o = mb.onbeforeclick[val];
+ var resp = o();
+ if ( resp )
+ return false;
+ o = false;
+ }
+
+ var mydiv = document.getElementById('messageBox');
+ var maindiv = mydiv.parentNode;
+ var to = fly_out_top(maindiv, true, false);
+
+ setTimeout("var mbdiv = document.getElementById('messageBox'); mbdiv.parentNode.removeChild(mbdiv.nextSibling); mbdiv.parentNode.removeChild(mbdiv); enlighten(true);", to);
+ if(typeof mb.onclick[val] == 'function')
+ {
+ o = mb.onclick[val];
+ o();
+ o = false;
+ }
+}
+
+function testMessageBox()
+{
+ mb = new messagebox(MB_OKCANCEL|MB_ICONINFORMATION, 'Javascripted dynamic message boxes', 'This is soooooo coool, now if only document.createElement() worked in IE! this is some more text
this is some more text
this is some more text
this is some more text
this is some more text
this is some more text
this is some more text
this is some more text');
+ mb.onclick['OK'] = function()
+ {
+ alert('You clicked OK!');
+ }
+ mb.onbeforeclick['Cancel'] = function()
+ {
+ alert('You clicked Cancel!');
+ }
+}
+
+// Function to fade classes info-box, warning-box, error-box, etc.
+
+function fadeInfoBoxes()
+{
+ var divs = new Array();
+ d = document.getElementsByTagName('div');
+ j = 0;
+ for(var i in d)
+ {
+ if ( !d[i].tagName )
+ continue;
+ if(d[i].className=='info-box' || d[i].className=='error-box' || d[i].className=='warning-box' || d[i].className=='question-box')
+ {
+ divs[j] = d[i];
+ j++;
+ }
+ }
+ if(divs.length < 1) return;
+ for(i in divs)
+ {
+ if(!divs[i].id) divs[i].id = 'autofade_'+Math.floor(Math.random() * 100000);
+ switch(divs[i].className)
+ {
+ case 'info-box':
+ default:
+ from = '#3333FF';
+ break;
+ case 'error-box':
+ from = '#FF3333';
+ break;
+ case 'warning-box':
+ from = '#FFFF33';
+ break;
+ case 'question-box':
+ from = '#33FF33';
+ break;
+ }
+ Fat.fade_element(divs[i].id,30,2000,from,Fat.get_bgcolor(divs[i].id));
+ }
+}
+
+// Alpha fades
+
+function opacity(id, opacStart, opacEnd, millisec) {
+ //speed for each frame
+ var speed = Math.round(millisec / 100);
+ var timer = 0;
+
+ //determine the direction for the blending, if start and end are the same nothing happens
+ if(opacStart > opacEnd) {
+ for(i = opacStart; i >= opacEnd; i--) {
+ setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
+ timer++;
+ }
+ } else if(opacStart < opacEnd) {
+ for(i = opacStart; i <= opacEnd; i++)
+ {
+ setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
+ timer++;
+ }
+ }
+}
+
+//change the opacity for different browsers
+function changeOpac(opacity, id) {
+ var object = document.getElementById(id).style;
+ object.opacity = (opacity / 100);
+ object.MozOpacity = (opacity / 100);
+ object.KhtmlOpacity = (opacity / 100);
+ object.filter = "alpha(opacity=" + opacity + ")";
+}
+
+function mb_logout()
+{
+ var mb = new messagebox(MB_YESNO|MB_ICONQUESTION, 'Are you sure you want to log out?', 'If you log out, you will no longer be able to access your user preferences, certain areas of this site, and this awesome logout confirmation screen until you login again.
OK, not funny. I\'ll remove the bad humor in Banshee.');
+ mb.onclick['Yes'] = function()
+ {
+ window.location = makeUrlNS('Special', 'Logout/' + title);
+ }
+}
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/fat.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/fat.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,93 @@
+// @name The Fade Anything Technique
+// @namespace http://www.axentric.com/aside/fat/
+// @version 1.0-RC1
+// @author Adam Michela
+
+var Fat = {
+ make_hex : function (r,g,b)
+ {
+ r = r.toString(16); if (r.length == 1) r = '0' + r;
+ g = g.toString(16); if (g.length == 1) g = '0' + g;
+ b = b.toString(16); if (b.length == 1) b = '0' + b;
+ return "#" + r + g + b;
+ },
+ fade_all : function ()
+ {
+ var a = document.getElementsByTagName("*");
+ for (var i = 0; i < a.length; i++)
+ {
+ var o = a[i];
+ var r = /fade-?(\w{3,6})?/.exec(o.className);
+ if (r)
+ {
+ if (!r[1]) r[1] = "";
+ if (!o.id) o.id = 'autofat_'+Math.floor(Math.random() * 100000);
+ if (o.id) Fat.fade_element(o.id,null,null,"#"+r[1]);
+ }
+ }
+ },
+ fade_element : function (id, fps, duration, from, to)
+ {
+ if (!fps) fps = 30;
+ if (!duration) duration = 3000;
+ if (!from || from=="#") from = "#FFFF33";
+ if (!to) to = this.get_bgcolor(id);
+
+ var frames = Math.round(fps * (duration / 1000));
+ var interval = duration / frames;
+ var delay = interval;
+ var frame = 0;
+
+ if (from.length < 7) from += from.substr(1,3);
+ if (to.length < 7) to += to.substr(1,3);
+
+ var rf = parseInt(from.substr(1,2),16);
+ var gf = parseInt(from.substr(3,2),16);
+ var bf = parseInt(from.substr(5,2),16);
+ var rt = parseInt(to.substr(1,2),16);
+ var gt = parseInt(to.substr(3,2),16);
+ var bt = parseInt(to.substr(5,2),16);
+
+ var r,g,b,h;
+ while (frame < frames)
+ {
+ r = Math.floor(rf * ((frames-frame)/frames) + rt * (frame/frames));
+ g = Math.floor(gf * ((frames-frame)/frames) + gt * (frame/frames));
+ b = Math.floor(bf * ((frames-frame)/frames) + bt * (frame/frames));
+ h = this.make_hex(r,g,b);
+
+ setTimeout("Fat.set_bgcolor('"+id+"','"+h+"')", delay);
+
+ frame++;
+ delay = interval * frame;
+ }
+ setTimeout("Fat.set_bgcolor('"+id+"','"+to+"')", delay);
+ },
+ set_bgcolor : function (id, c)
+ {
+ var o = document.getElementById(id);
+ if(!o) return;
+ o.style.backgroundColor = c;
+ },
+ get_bgcolor : function (id)
+ {
+ var o = document.getElementById(id);
+ while(o)
+ {
+ var c;
+ if (window.getComputedStyle) c = window.getComputedStyle(o,null).getPropertyValue("background-color");
+ if (o.currentStyle) c = o.currentStyle.backgroundColor;
+ if ((c != "" && c != "transparent") || o.tagName == "BODY") { break; }
+ o = o.parentNode;
+ }
+ if (c == undefined || c == "" || c == "transparent") c = "#FFFFFF";
+ var rgb = c.match(/rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/);
+ if (rgb) c = this.make_hex(parseInt(rgb[1]),parseInt(rgb[2]),parseInt(rgb[3]));
+ return c;
+ }
+}
+
+window.onload = function ()
+ {
+ Fat.fade_all();
+ }
\ No newline at end of file
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/flyin.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/flyin.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,195 @@
+// Make an HTML element fly in from the top or bottom.
+// Includes inertia!
+
+// vB, don't even try. It's GPL like the rest of Enano. I know you're jealous. >:)
+
+var fly_in_cache = new Object();
+var FI_TOP = 1;
+var FI_BOTTOM = 2;
+var FI_IN = 1;
+var FI_OUT = 2;
+var FI_UP = 1;
+var FI_DOWN = 2;
+
+// Placeholder functions, to make organization a little easier :-)
+
+function fly_in_top(element, nofade, height_taken_care_of)
+{
+ return fly_core(element, nofade, FI_TOP, FI_IN, height_taken_care_of);
+}
+
+function fly_in_bottom(element, nofade, height_taken_care_of)
+{
+ return fly_core(element, nofade, FI_BOTTOM, FI_IN, height_taken_care_of);
+}
+
+function fly_out_top(element, nofade, height_taken_care_of)
+{
+ return fly_core(element, nofade, FI_TOP, FI_OUT, height_taken_care_of);
+}
+
+function fly_out_bottom(element, nofade, height_taken_care_of)
+{
+ return fly_core(element, nofade, FI_BOTTOM, FI_OUT, height_taken_care_of);
+}
+
+function fly_core(element, nofade, origin, direction, height_taken_care_of)
+{
+ if ( !element || typeof(element) != 'object' )
+ return false;
+ // target dimensions
+ var top, left;
+ // initial dimensions
+ var topi, lefti;
+ // current dimensions
+ var topc, leftc;
+ // screen dimensions
+ var w = getWidth();
+ var h = getHeight();
+ var y = parseInt ( getScrollOffset() );
+ // temp vars
+ var dim, off, diff, dist, ratio, opac_factor;
+ // setup element
+ element.style.position = 'absolute';
+
+ dim = [ $(element).Height(), $(element).Width() ];
+ off = [ $(element).Top(), $(element).Left() ];
+
+ if ( height_taken_care_of )
+ {
+ top = off[0];
+ left = off[1];
+ }
+ else
+ {
+ top = Math.round(( h / 2 ) - ( dim[0] / 2 )) + y; // - ( h / 4 ));
+ left = Math.round(( w / 2 ) - ( dim[1] / 2 ));
+ }
+
+ // you can change this around to get it to fly in from corners or be on the left/right side
+ lefti = left;
+
+ // calculate first frame Y position
+ if ( origin == FI_TOP && direction == FI_IN )
+ {
+ topi = 0 - dim[0] + y;
+ }
+ else if ( origin == FI_TOP && direction == FI_OUT )
+ {
+ topi = top;
+ top = 0 - dim[0] + y;
+ }
+ else if ( origin == FI_BOTTOM && direction == FI_IN )
+ {
+ topi = h + y;
+ }
+ else if ( origin == FI_BOTTOM && direction == FI_OUT )
+ {
+ topi = top;
+ top = h + y;
+ }
+
+ var abs_dir = ( ( origin == FI_TOP && direction == FI_IN ) || ( origin == FI_BOTTOM && direction == FI_OUT ) ) ? FI_DOWN : FI_UP;
+
+ /*
+ * Framestepper parameters
+ */
+
+ // starting value for inertia
+ var inertiabase = 1;
+ // increment for inertia, or 0 to disable inertia effects
+ var inertiainc = 1;
+ // when the progress reaches this %, deceleration is activated
+ var divider = 0.666667;
+ // multiplier for deceleration, setting this above 2 can cause some weird slowdown effects
+ var decelerate = 2; // 1 / divider; // reciprocal of the divider
+
+ /*
+ * Timer parameters
+ */
+
+ // how long animation start is delayed, you want this at 0
+ var timer = 0;
+ // frame ttl
+ var timestep = 12;
+ // sanity check
+ var frames = 0;
+
+ // cache element so it can be changed from within setTimeout()
+ var rand_seed = Math.floor(Math.random() * 1000000);
+ fly_in_cache[rand_seed] = element;
+
+ // set element left pos, you can comment this out to preserve left position
+ element.style.left = left + 'px';
+ element.style.top = topi + 'px';
+
+ if ( nofade )
+ {
+ domObjChangeOpac(100, element);
+ }
+
+ // total distance to be traveled
+ dist = abs(top - topi);
+
+ // animation loop
+
+ while ( true )
+ {
+ // used for a sanity check
+ frames++;
+
+ // time until this frame should be executed
+ timer += timestep;
+
+ // math stuff
+ // how far we are along in animation...
+ diff = abs(top - topi);
+ // ...in %
+ ratio = abs( 1 - ( diff / dist ) );
+ // decelerate if we're more than 2/3 of the way there
+ if ( ratio < divider )
+ inertiabase += inertiainc;
+ else
+ inertiabase -= ( inertiainc * decelerate );
+
+ // if the deceleration factor is anywhere above 1 then technically that can cause an infinite loop
+ // so leave this in there unless decelerate is set to 1
+ if ( inertiabase < 1 )
+ inertiabase = 1;
+
+ // uncomment to disable inertia
+ // inertiabase = 3;
+
+ // figure out frame Y position
+ topi = ( abs_dir == FI_UP ) ? topi - inertiabase : topi + inertiabase;
+ if ( ( abs_dir == FI_DOWN && topi > top ) || ( abs_dir == FI_UP && top > topi ) )
+ topi = top;
+
+ // tell the browser to do it
+ setTimeout('var o = fly_in_cache['+rand_seed+']; o.style.top=\''+topi+'px\';', timer);
+ if ( !nofade )
+ {
+ // handle fade
+ opac_factor = ratio * 100;
+ if ( direction == FI_OUT )
+ opac_factor = 100 - opac_factor;
+ setTimeout('var o = fly_in_cache['+rand_seed+']; domObjChangeOpac('+opac_factor+', o);', timer);
+ }
+
+ // if we're done or if our sanity check failed then break out of the loop
+ if ( ( abs_dir == FI_DOWN && topi >= top ) || ( abs_dir == FI_UP && top >= topi ) || frames > 1000 )
+ break;
+ }
+
+ //timer += timestep;
+ setTimeout('delete(fly_in_cache['+rand_seed+']);', timer);
+ return timer;
+}
+
+function abs(i)
+{
+ if ( isNaN(i) )
+ return i;
+ return ( i < 0 ) ? ( 0 - i ) : i;
+}
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/grippy.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/grippy.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,91 @@
+// Resizable textareas (fun!)
+
+function taStartDrag()
+{
+ obj = this;
+ current_ta = obj.previousSibling;
+ startmouseX = mouseX;
+ startmouseY = mouseY;
+ startScroll = getScrollOffset();
+ is_dragging = true;
+ startwidth = getElementWidth(current_ta.id);
+ startheight = getElementHeight(current_ta.id);
+ var body = document.getElementsByTagName('body');
+ body = body[0];
+ body.style.cursor = 's-resize';
+}
+function taInDrag()
+{
+ if(!is_dragging) return;
+ cw = startwidth;
+ ch = startheight;
+ mx = mouseX;
+ my = mouseY + getScrollOffset() - startScroll;
+ ch = -6 + ch + ( my - startmouseY );
+ current_ta.style.height = ch+'px';
+ if(do_width)
+ {
+ current_ta.style.width = mx+'px';
+ current_ta.nextSibling.style.width = mx+'px';
+ }
+}
+function taCloseDrag()
+{
+ is_dragging = false;
+ current_ta = false;
+ body = document.getElementsByTagName('body');
+ body = body[0];
+ body.style.cursor = 'default';
+}
+
+var grippied_textareas = new Array();
+
+function initTextareas()
+{
+ var textareas = document.getElementsByTagName('textarea');
+ for (i = 0;i < textareas.length;i++)
+ {
+ if(!textareas[i].id)
+ textareas[i].id = 'autoTextArea_'+Math.floor(Math.random()*100000);
+ cta = textareas[i];
+ var divchk = ( in_array(cta.id, grippied_textareas) ) ? false : true;
+ if(divchk)
+ {
+ grippied_textareas.push(cta.id);
+ makeGrippy(cta);
+ }
+ }
+}
+
+function makeGrippy(cta)
+{
+ var thediv = document.createElement('div');
+ thediv.style.backgroundColor = '#ceceed';
+ thediv.style.backgroundImage = 'url('+scriptPath+'/images/grippy.gif)';
+ thediv.style.backgroundPosition = 'bottom right';
+ thediv.style.backgroundRepeat = 'no-repeat';
+ thediv.style.width = getElementWidth(cta.id)+'px';
+ thediv.style.cursor = 's-resize';
+ thediv.style.className = 'ThisIsATextareaGrippy';
+ thediv.id = 'autoGrippy_'+Math.floor(Math.random()*100000);
+ thediv.style.height = '12px';
+ thediv.onmousedown = taStartDrag;
+ thediv.style.border = '1px solid #0000A0';
+ if(cta.style.marginBottom)
+ {
+ thediv.style.marginBottom = cta.style.marginBottom;
+ cta.style.marginBottom = '0';
+ }
+ if(cta.style.marginLeft)
+ {
+ thediv.style.marginLeft = cta.style.marginLeft;
+ }
+ if(cta.style.marginRight)
+ {
+ thediv.style.marginRight = cta.style.marginRight;
+ }
+ document.onmouseup = taCloseDrag;
+ if(cta.nextSibling) cta.parentNode.insertBefore(thediv, cta.nextSibling);
+ else cta.parentNode.appendChild(thediv);
+}
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/json.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/json.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,172 @@
+/*
+ json.js
+ 2007-03-20
+
+ All of the code contained within this file is released into
+ the public domain. Optionally, you may distribute this code
+ under the terms of the GNU General Public License as well
+ (public domain licensing allows this).
+
+*/
+
+function toJSONString(input)
+{
+ var m = {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ };
+ var t = typeof(input);
+ switch(t)
+ {
+ case 'string':
+ if (/["\\\x00-\x1f]/.test(input))
+ {
+ return '"' + input.replace(/([\x00-\x1f\\"])/g, function(a, b)
+ {
+ var c = m[b];
+ if (c) {
+ return c;
+ }
+ c = b.charCodeAt();
+ return '\\u00' +
+ Math.floor(c / 16).toString(16) +
+ (c % 16).toString(16);
+ }) + '"';
+ }
+ return '"' + input + '"';
+ break;
+ case 'array':
+ var a = ['['],
+ b,
+ i,
+ l = input.length,
+ v;
+
+ function p(s) {
+
+ if (b) {
+ a.push(',');
+ }
+ a.push(s);
+ b = true;
+ }
+
+ for (i = 0; i < l; i += 1) {
+ v = input[i];
+ switch (typeof v) {
+ case 'object':
+ if (v) {
+ p(toJSONString(v));
+ } else {
+ p("null");
+ }
+ break;
+ case 'array':
+ case 'string':
+ case 'number':
+ case 'boolean':
+ p(toJSONString(v));
+ }
+ }
+
+ a.push(']');
+ return a.join('');
+ break;
+ case 'date':
+ function f(n)
+ {
+ return n < 10 ? '0' + n : n;
+ }
+ return '"' + input.getFullYear() + '-' +
+ f(input.getMonth() + 1) + '-' +
+ f(input.getDate()) + 'T' +
+ f(input.getHours()) + ':' +
+ f(input.getMinutes()) + ':' +
+ f(input.getSeconds()) + '"';
+
+ case 'boolean':
+ return String(input);
+ break;
+ case 'number':
+ return isFinite(input) ? String(input) : "null";
+ break;
+ case 'object':
+ var a = ['{'],
+ b,
+ k,
+ v;
+
+ function p(s)
+ {
+ if (b)
+ {
+ a.push(',');
+ }
+ a.push(toJSONString(k), ':', s);
+ b = true;
+ }
+
+ for (k in input)
+ {
+ if (input.hasOwnProperty(k))
+ {
+ v = input[k];
+ switch (typeof v) {
+
+ case 'object':
+ if (v) {
+ p(toJSONString(v));
+ } else {
+ p("null");
+ }
+ break;
+ case 'string':
+ case 'number':
+ case 'boolean':
+ p(toJSONString(v));
+ break;
+ }
+ }
+ }
+
+ a.push('}');
+ return a.join('');
+ break;
+ }
+}
+
+function parseJSON(string, filter)
+{
+ try {
+ if (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.
+ test(string))
+ {
+
+ var j = eval('(' + string + ')');
+ if (typeof filter === 'function') {
+
+ function walk(k, v) {
+ if (v && typeof v === 'object') {
+ for (var i in v) {
+ if (v.hasOwnProperty(i)) {
+ v[i] = walk(i, v[i]);
+ }
+ }
+ }
+ return filter(k, v);
+ }
+
+ j = walk('', j);
+ }
+ return j;
+ }
+ } catch (e) {
+
+ }
+ throw new SyntaxError("parseJSON");
+}
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/loader.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/loader.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,46 @@
+// Some final stuff - loader routines, etc.
+
+var __tmpEnanoStartup9843275;
+
+function enanoStartup(e) {
+ if ( !e )
+ {
+ // Delay initting sliders until images are loaded
+ if ( typeof(window.onload) == 'function' )
+ __tmpEnanoStartup9843275 = window.onload;
+ else
+ __tmpEnanoStartup9843275 = function(){};
+ window.onload = function(e){__tmpEnanoStartup9843275(e);initSliders();};
+ }
+ else
+ {
+ initSliders();
+ }
+}
+
+function mdgInnerLoader(e)
+{
+ jws.startup();
+ enanoStartup(e);
+ if(window.location.hash == '#comments') ajaxComments();
+ window.onkeydown=isKeyPressed;
+ window.onkeyup=function(e) { isKeyPressed(e); };
+ Fat.fade_all();
+ fadeInfoBoxes();
+ //initTextareas();
+ buildSearchBoxes();
+ jBoxInit();
+ if(typeof (dbx_set_key) == 'function')
+ {
+ dbx_set_key();
+ }
+ runOnloadHooks(e);
+}
+if(window.onload) var ld = window.onload;
+else var ld = function() {return;};
+function enano_init(e) {
+ ld(e);
+ mdgInnerLoader(e);
+}
+window.onload = enano_init;
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/md5.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/md5.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,51 @@
+// Javascript implementation of the and SHA1 hash algorithms - both written by Paul Johnston, licensed under the BSD license
+
+// MD5
+var hexcase = 0; var b64pad = ""; var chrsz = 8;
+function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
+function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
+function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
+function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
+function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
+function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
+function md5_vm_test() { return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; }
+function core_md5(x, len) { x[len >> 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; }
+
+// SHA1
+function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
+function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
+function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
+function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
+function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
+function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
+function sha1_vm_test() { return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d"; }
+function core_sha1(x, len) { x[len >> 5] |= 0x80 << (24 - len % 32); x[((len + 64 >> 9) << 4) + 15] = len; var w = Array(80); var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; var e = -1009589776; for(var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; var oldc = c; var oldd = d; var olde = e; for(var j = 0; j < 80; j++) { if(j < 16) w[j] = x[i + j]; else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j))); e = d; d = c; c = rol(b, 30); b = a; a = t; } a = safe_add(a, olda); b = safe_add(b, oldb); c = safe_add(c, oldc); d = safe_add(d, oldd); e = safe_add(e, olde); } return Array(a, b, c, d, e);}
+function sha1_ft(t, b, c, d){ if(t < 20) return (b & c) | ((~b) & d); if(t < 40) return b ^ c ^ d; if(t < 60) return (b & c) | (b & d) | (c & d); return b ^ c ^ d;}
+function sha1_kt(t){ return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : (t < 60) ? -1894007588 : -899497514;}
+function core_hmac_sha1(key, data){ var bkey = str2binb(key); if(bkey.length > 16) bkey = core_sha1(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_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz); return core_sha1(opad.concat(hash), 512 + 160);}
+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 rol(num, cnt){ return (num << cnt) | (num >>> (32 - cnt));}
+function str2binb(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) << (32 - chrsz - i%32); return bin;}
+function binb2str(bin){ var str = ""; var mask = (1 << chrsz) - 1; for(var i = 0; i < bin.length * 32; i += chrsz) str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask); return str;}
+function binb2hex(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] >> ((3 - i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF); } return str;}
+function binb2b64(binarray){ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var str = ""; for(var i = 0; i < binarray.length * 4; i += 3) { var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16) | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 ) | ((binarray[i+2 >> 2] >> 8 * (3 - (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 902822492a68 -r fe660c52c48f includes/clientside/static/misc.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/misc.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,575 @@
+// Some additional DHTML functions
+
+function fetch_offset(obj) {
+ var left_offset = obj.offsetLeft;
+ var top_offset = obj.offsetTop;
+ while ((obj = obj.offsetParent) != null) {
+ left_offset += obj.offsetLeft;
+ top_offset += obj.offsetTop;
+ }
+ return { 'left' : left_offset, 'top' : top_offset };
+}
+
+function fetch_dimensions(o) {
+ var w = o.offsetWidth;
+ var h = o.offsetHeight;
+ return { 'w' : w, 'h' : h };
+}
+
+function findParentForm(o)
+{
+ // Not implemented - someone please let me know how to do this, what I need to do is
+ // find the first parent ';
+ ajax_auth_mb_cache.updateContent(form_html);
+ $('messageBox').object.nextSibling.firstChild.tabindex = '3';
+ $('ajaxlogin_user').object.focus();
+ $('ajaxlogin_pass').object.onblur = function() { $('messageBox').object.nextSibling.firstChild.focus(); };
+ }
+ });
+}
+
+function ajaxValidateLogin()
+{
+ var username,password,auth_enabled,crypt_key,crypt_data,challenge_salt,challenge_data;
+ username = document.getElementById('ajaxlogin_user');
+ if ( !username )
+ return false;
+ username = document.getElementById('ajaxlogin_user').value;
+ password = document.getElementById('ajaxlogin_pass').value;
+ auth_enabled = false;
+
+ disableJSONExts();
+
+ //
+ // Encryption test
+ //
+
+ var str = '';
+ for(i=0;i \
+ ';
+
+ ajax_auth_mb_cache.updateContent(loading_win);
+
+ ajaxPost(makeUrlNS('Special', 'Login', 'act=ajaxlogin'), 'params=' + json_data, function() {
+ if ( ajax.readyState == 4 )
+ {
+ var response = ajax.responseText;
+ if ( response.substr(0,1) != '{' )
+ {
+ alert('Invalid JSON response from server: ' + response);
+ ajaxAuthLoginInnerSetup();
+ return false;
+ }
+ response = parseJSON(response);
+ switch(response.result)
+ {
+ case 'success':
+ if ( typeof(ajax_auth_prompt_cache) == 'function' )
+ {
+ ajax_auth_prompt_cache(response.key);
+ }
+ break;
+ case 'success_reset':
+ var conf = confirm('You have logged in using a temporary password. Before you can log in, you must finish resetting your password. Do you want to reset your real password now?');
+ if ( conf )
+ {
+ var url = makeUrlNS('Special', 'PasswordReset/stage2/' + response.user_id + '/' + response.temppass);
+ window.location = url;
+ }
+ else
+ {
+ ajaxAuthLoginInnerSetup();
+ }
+ break;
+ case 'error':
+ alert(response.error);
+ ajaxAuthLoginInnerSetup();
+ break;
+ default:
+ alert(ajax.responseText);
+ break;
+ }
+ }
+ });
+
+ return true;
+
+}
+
+// This code is in the public domain. Feel free to link back to http://jan.moesen.nu/
+function sprintf()
+{
+ if (!arguments || arguments.length < 1 || !RegExp)
+ {
+ return;
+ }
+ var str = arguments[0];
+ var re = /([^%]*)%('.|0|\x20)?(-)?(\d+)?(\.\d+)?(%|b|c|d|u|f|o|s|x|X)(.*)/;
+ var a = b = [], numSubstitutions = 0, numMatches = 0;
+ while (a = re.exec(str))
+ {
+ var leftpart = a[1], pPad = a[2], pJustify = a[3], pMinLength = a[4];
+ var pPrecision = a[5], pType = a[6], rightPart = a[7];
+
+ //alert(a + '\n' + [a[0], leftpart, pPad, pJustify, pMinLength, pPrecision);
+
+ numMatches++;
+ if (pType == '%')
+ {
+ subst = '%';
+ }
+ else
+ {
+ numSubstitutions++;
+ if (numSubstitutions >= arguments.length)
+ {
+ alert('Error! Not enough function arguments (' + (arguments.length - 1) + ', excluding the string)\nfor the number of substitution parameters in string (' + numSubstitutions + ' so far).');
+ }
+ var param = arguments[numSubstitutions];
+ var pad = '';
+ if (pPad && pPad.substr(0,1) == "'") pad = leftpart.substr(1,1);
+ else if (pPad) pad = pPad;
+ var justifyRight = true;
+ if (pJustify && pJustify === "-") justifyRight = false;
+ var minLength = -1;
+ if (pMinLength) minLength = parseInt(pMinLength);
+ var precision = -1;
+ if (pPrecision && pType == 'f') precision = parseInt(pPrecision.substring(1));
+ var subst = param;
+ if (pType == 'b') subst = parseInt(param).toString(2);
+ else if (pType == 'c') subst = String.fromCharCode(parseInt(param));
+ else if (pType == 'd') subst = parseInt(param) ? parseInt(param) : 0;
+ else if (pType == 'u') subst = Math.abs(param);
+ else if (pType == 'f') subst = (precision > -1) ? Math.round(parseFloat(param) * Math.pow(10, precision)) / Math.pow(10, precision): parseFloat(param);
+ else if (pType == 'o') subst = parseInt(param).toString(8);
+ else if (pType == 's') subst = param;
+ else if (pType == 'x') subst = ('' + parseInt(param).toString(16)).toLowerCase();
+ else if (pType == 'X') subst = ('' + parseInt(param).toString(16)).toUpperCase();
+ }
+ str = leftpart + subst + rightPart;
+ }
+ return str;
+}
+
+function paginator_goto(parentobj, this_page, num_pages, perpage, url_string)
+{
+ var height = $(parentobj).Height();
+ var width = $(parentobj).Width();
+ var left = $(parentobj).Left();
+ var top = $(parentobj).Top();
+ var left_pos = left + width ;
+ var top_pos = height + top;
+ var div = document.createElement('div');
+ div.style.position = 'absolute';
+ div.style.top = top_pos + 'px';
+ div.className = 'question-box';
+ div.style.margin = '1px 0 0 2px';
+ var vtmp = 'input_' + Math.floor(Math.random() * 1000000);
+ div.innerHTML = 'Go to page: »×';
+
+ var body = document.getElementsByTagName('body')[0];
+ body.appendChild(div);
+
+ document.getElementById(vtmp).onkeypress = function(e){if(e.keyCode==13)this.nextSibling.nextSibling.onclick();};
+ document.getElementById(vtmp).focus();
+
+ // fade the div
+ /*
+ if(!div.id) div.id = 'autofade_'+Math.floor(Math.random() * 100000);
+ var from = '#33FF33';
+ Fat.fade_element(div.id,30,2000,from,Fat.get_bgcolor(div.id));
+ */
+ fly_in_bottom(div, false, true);
+
+ var divh = $(div).Width();
+ left_pos = left_pos - divh;
+ div.style.left = left_pos + 'px';
+}
+
+function paginator_submit(obj, max, perpage, formatstring)
+{
+ var userinput = obj.previousSibling.previousSibling.value;
+ userinput = parseInt(userinput);
+ var offset = ( userinput - 1 ) * perpage;
+ if ( userinput > max || isNaN(userinput) || userinput < 1 )
+ {
+ new messagebox(MB_OK|MB_ICONSTOP, 'Invalid entry', 'Please enter a page number between 1 and ' + max + '.');
+ return false;
+ }
+ var url = sprintf(formatstring, String(offset));
+ fly_out_top(obj.parentNode, false, true);
+ window.location = url;
+}
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/misc.js~
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/misc.js~ Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,563 @@
+// Some additional DHTML functions
+
+function fetch_offset(obj) {
+ var left_offset = obj.offsetLeft;
+ var top_offset = obj.offsetTop;
+ while ((obj = obj.offsetParent) != null) {
+ left_offset += obj.offsetLeft;
+ top_offset += obj.offsetTop;
+ }
+ return { 'left' : left_offset, 'top' : top_offset };
+}
+
+function fetch_dimensions(o) {
+ var w = o.offsetWidth;
+ var h = o.offsetHeight;
+ return { 'w' : w, 'h' : h };
+}
+
+function findParentForm(o)
+{
+ // Not implemented - someone please let me know how to do this, what I need to do is
+ // find the first parent ';
+ ajax_auth_mb_cache.updateContent(form_html);
+ $('messageBox').object.nextSibling.firstChild.tabindex = '3';
+ $('ajaxlogin_user').object.focus();
+ $('ajaxlogin_pass').object.onblur = function() { $('messageBox').object.nextSibling.firstChild.focus(); };
+ }
+ });
+}
+
+function ajaxValidateLogin()
+{
+ var username,password,auth_enabled,crypt_key,crypt_data,challenge_salt,challenge_data;
+ username = document.getElementById('ajaxlogin_user');
+ if ( !username )
+ return false;
+ username = document.getElementById('ajaxlogin_user').value;
+ password = document.getElementById('ajaxlogin_pass').value;
+ auth_enabled = false;
+
+ disableJSONExts();
+
+ //
+ // Encryption test
+ //
+
+ var str = '';
+ for(i=0;i \
+ ';
+
+ ajax_auth_mb_cache.updateContent(loading_win);
+
+ ajaxPost(makeUrlNS('Special', 'Login', 'act=ajaxlogin'), 'params=' + json_data, function() {
+ if ( ajax.readyState == 4 )
+ {
+ var response = ajax.responseText;
+ if ( response.substr(0,1) != '{' )
+ {
+ alert('Invalid JSON response from server: ' + response);
+ ajaxAuthLoginInnerSetup();
+ return false;
+ }
+ response = parseJSON(response);
+ switch(response.result)
+ {
+ case 'success':
+ if ( typeof(ajax_auth_prompt_cache) == 'function' )
+ {
+ ajax_auth_prompt_cache(response.key);
+ }
+ break;
+ case 'error':
+ alert(response.error);
+ ajaxAuthLoginInnerSetup();
+ break;
+ default:
+ alert(ajax.responseText);
+ break;
+ }
+ }
+ });
+
+ return true;
+
+}
+
+// This code is in the public domain. Feel free to link back to http://jan.moesen.nu/
+function sprintf()
+{
+ if (!arguments || arguments.length < 1 || !RegExp)
+ {
+ return;
+ }
+ var str = arguments[0];
+ var re = /([^%]*)%('.|0|\x20)?(-)?(\d+)?(\.\d+)?(%|b|c|d|u|f|o|s|x|X)(.*)/;
+ var a = b = [], numSubstitutions = 0, numMatches = 0;
+ while (a = re.exec(str))
+ {
+ var leftpart = a[1], pPad = a[2], pJustify = a[3], pMinLength = a[4];
+ var pPrecision = a[5], pType = a[6], rightPart = a[7];
+
+ //alert(a + '\n' + [a[0], leftpart, pPad, pJustify, pMinLength, pPrecision);
+
+ numMatches++;
+ if (pType == '%')
+ {
+ subst = '%';
+ }
+ else
+ {
+ numSubstitutions++;
+ if (numSubstitutions >= arguments.length)
+ {
+ alert('Error! Not enough function arguments (' + (arguments.length - 1) + ', excluding the string)\nfor the number of substitution parameters in string (' + numSubstitutions + ' so far).');
+ }
+ var param = arguments[numSubstitutions];
+ var pad = '';
+ if (pPad && pPad.substr(0,1) == "'") pad = leftpart.substr(1,1);
+ else if (pPad) pad = pPad;
+ var justifyRight = true;
+ if (pJustify && pJustify === "-") justifyRight = false;
+ var minLength = -1;
+ if (pMinLength) minLength = parseInt(pMinLength);
+ var precision = -1;
+ if (pPrecision && pType == 'f') precision = parseInt(pPrecision.substring(1));
+ var subst = param;
+ if (pType == 'b') subst = parseInt(param).toString(2);
+ else if (pType == 'c') subst = String.fromCharCode(parseInt(param));
+ else if (pType == 'd') subst = parseInt(param) ? parseInt(param) : 0;
+ else if (pType == 'u') subst = Math.abs(param);
+ else if (pType == 'f') subst = (precision > -1) ? Math.round(parseFloat(param) * Math.pow(10, precision)) / Math.pow(10, precision): parseFloat(param);
+ else if (pType == 'o') subst = parseInt(param).toString(8);
+ else if (pType == 's') subst = param;
+ else if (pType == 'x') subst = ('' + parseInt(param).toString(16)).toLowerCase();
+ else if (pType == 'X') subst = ('' + parseInt(param).toString(16)).toUpperCase();
+ }
+ str = leftpart + subst + rightPart;
+ }
+ return str;
+}
+
+function paginator_goto(parentobj, this_page, num_pages, perpage, url_string)
+{
+ var height = $(parentobj).Height();
+ var width = $(parentobj).Width();
+ var left = $(parentobj).Left();
+ var top = $(parentobj).Top();
+ var left_pos = left + width ;
+ var top_pos = height + top;
+ var div = document.createElement('div');
+ div.style.position = 'absolute';
+ div.style.top = top_pos + 'px';
+ div.className = 'question-box';
+ div.style.margin = '1px 0 0 2px';
+ var vtmp = 'input_' + Math.floor(Math.random() * 1000000);
+ div.innerHTML = 'Go to page: »×';
+
+ var body = document.getElementsByTagName('body')[0];
+ body.appendChild(div);
+
+ document.getElementById(vtmp).onkeypress = function(e){if(e.keyCode==13)this.nextSibling.nextSibling.onclick();};
+ document.getElementById(vtmp).focus();
+
+ // fade the div
+ /*
+ if(!div.id) div.id = 'autofade_'+Math.floor(Math.random() * 100000);
+ var from = '#33FF33';
+ Fat.fade_element(div.id,30,2000,from,Fat.get_bgcolor(div.id));
+ */
+ fly_in_bottom(div, false, true);
+
+ var divh = $(div).Width();
+ left_pos = left_pos - divh;
+ div.style.left = left_pos + 'px';
+}
+
+function paginator_submit(obj, max, perpage, formatstring)
+{
+ var userinput = obj.previousSibling.previousSibling.value;
+ userinput = parseInt(userinput);
+ var offset = ( userinput - 1 ) * perpage;
+ if ( userinput > max || isNaN(userinput) || userinput < 1 )
+ {
+ new messagebox(MB_OK|MB_ICONSTOP, 'Invalid entry', 'Please enter a page number between 1 and ' + max + '.');
+ return false;
+ }
+ var url = sprintf(formatstring, String(offset));
+ fly_out_top(obj.parentNode, false, true);
+ window.location = url;
+}
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/rijndael.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/rijndael.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,579 @@
+/* rijndael.js Rijndael Reference Implementation
+ Copyright (c) 2001 Fritz Schneider
+
+ This software is provided as-is, without express or implied warranty.
+ Permission to use, copy, modify, distribute or sell this software, with or
+ without fee, for any purpose and by any individual or organization, is hereby
+ granted, provided that the above copyright notice and this paragraph appear
+ in all copies. Distribution as a part of an application or binary must
+ include the above copyright notice in the documentation and/or other materials
+ provided with the application or distribution.
+
+
+ As the above disclaimer notes, you are free to use this code however you
+ want. However, I would request that you send me an email
+ (fritz /at/ cs /dot/ ucsd /dot/ edu) to say hi if you find this code useful
+ or instructional. Seeing that people are using the code acts as
+ encouragement for me to continue development. If you *really* want to thank
+ me you can buy the book I wrote with Thomas Powell, _JavaScript:
+ _The_Complete_Reference_ :)
+
+ This code is an UNOPTIMIZED REFERENCE implementation of Rijndael.
+ If there is sufficient interest I can write an optimized (word-based,
+ table-driven) version, although you might want to consider using a
+ compiled language if speed is critical to your application. As it stands,
+ one run of the monte carlo test (10,000 encryptions) can take up to
+ several minutes, depending upon your processor. You shouldn't expect more
+ than a few kilobytes per second in throughput.
+
+ Also note that there is very little error checking in these functions.
+ Doing proper error checking is always a good idea, but the ideal
+ implementation (using the instanceof operator and exceptions) requires
+ IE5+/NS6+, and I've chosen to implement this code so that it is compatible
+ with IE4/NS4.
+
+ And finally, because JavaScript doesn't have an explicit byte/char data
+ type (although JavaScript 2.0 most likely will), when I refer to "byte"
+ in this code I generally mean "32 bit integer with value in the interval
+ [0,255]" which I treat as a byte.
+
+ See http://www-cse.ucsd.edu/~fritz/rijndael.html for more documentation
+ of the (very simple) API provided by this code.
+
+ Fritz Schneider
+ fritz at cs.ucsd.edu
+
+*/
+
+// Rijndael parameters -- Valid values are 128, 192, or 256
+
+var keySizeInBits = ( typeof AES_BITS == 'number' ) ? AES_BITS : 128;
+var blockSizeInBits = ( typeof AES_BLOCKSIZE == 'number' ) ? AES_BLOCKSIZE : 128;
+
+/////// You shouldn't have to modify anything below this line except for
+/////// the function getRandomBytes().
+//
+// Note: in the following code the two dimensional arrays are indexed as
+// you would probably expect, as array[row][column]. The state arrays
+// are 2d arrays of the form state[4][Nb].
+
+
+// The number of rounds for the cipher, indexed by [Nk][Nb]
+var roundsArray = [ ,,,,[,,,,10,, 12,, 14],,
+ [,,,,12,, 12,, 14],,
+ [,,,,14,, 14,, 14] ];
+
+// The number of bytes to shift by in shiftRow, indexed by [Nb][row]
+var shiftOffsets = [ ,,,,[,1, 2, 3],,[,1, 2, 3],,[,1, 3, 4] ];
+
+// The round constants used in subkey expansion
+var Rcon = [
+0x01, 0x02, 0x04, 0x08, 0x10, 0x20,
+0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8,
+0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc,
+0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4,
+0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91 ];
+
+// Precomputed lookup table for the SBox
+var SBox = [
+ 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171,
+118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164,
+114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113,
+216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226,
+235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214,
+179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203,
+190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69,
+249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245,
+188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68,
+23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42,
+144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73,
+ 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109,
+141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37,
+ 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62,
+181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225,
+248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223,
+140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187,
+ 22 ];
+
+// Precomputed lookup table for the inverse SBox
+var SBoxInverse = [
+ 82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215,
+251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222,
+233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66,
+250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73,
+109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92,
+204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21,
+ 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247,
+228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2,
+193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220,
+234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173,
+ 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29,
+ 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75,
+198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168,
+ 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81,
+127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160,
+224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97,
+ 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12,
+125 ];
+
+function str_split(string, chunklen)
+{
+ if(!chunklen) chunklen = 1;
+ ret = new Array();
+ for ( i = 0; i < string.length; i+=chunklen )
+ {
+ ret[ret.length] = string.slice(i, i+chunklen);
+ }
+ return ret;
+}
+
+// This method circularly shifts the array left by the number of elements
+// given in its parameter. It returns the resulting array and is used for
+// the ShiftRow step. Note that shift() and push() could be used for a more
+// elegant solution, but they require IE5.5+, so I chose to do it manually.
+
+function cyclicShiftLeft(theArray, positions) {
+ var temp = theArray.slice(0, positions);
+ theArray = theArray.slice(positions).concat(temp);
+ return theArray;
+}
+
+// Cipher parameters ... do not change these
+var Nk = keySizeInBits / 32;
+var Nb = blockSizeInBits / 32;
+var Nr = roundsArray[Nk][Nb];
+
+// Multiplies the element "poly" of GF(2^8) by x. See the Rijndael spec.
+
+function xtime(poly) {
+ poly <<= 1;
+ return ((poly & 0x100) ? (poly ^ 0x11B) : (poly));
+}
+
+// Multiplies the two elements of GF(2^8) together and returns the result.
+// See the Rijndael spec, but should be straightforward: for each power of
+// the indeterminant that has a 1 coefficient in x, add y times that power
+// to the result. x and y should be bytes representing elements of GF(2^8)
+
+function mult_GF256(x, y) {
+ var bit, result = 0;
+
+ for (bit = 1; bit < 256; bit *= 2, y = xtime(y)) {
+ if (x & bit)
+ result ^= y;
+ }
+ return result;
+}
+
+// Performs the substitution step of the cipher. State is the 2d array of
+// state information (see spec) and direction is string indicating whether
+// we are performing the forward substitution ("encrypt") or inverse
+// substitution (anything else)
+
+function byteSub(state, direction) {
+ var S;
+ if (direction == "encrypt") // Point S to the SBox we're using
+ S = SBox;
+ else
+ S = SBoxInverse;
+ for (var i = 0; i < 4; i++) // Substitute for every byte in state
+ for (var j = 0; j < Nb; j++)
+ state[i][j] = S[state[i][j]];
+}
+
+// Performs the row shifting step of the cipher.
+
+function shiftRow(state, direction) {
+ for (var i=1; i<4; i++) // Row 0 never shifts
+ if (direction == "encrypt")
+ state[i] = cyclicShiftLeft(state[i], shiftOffsets[Nb][i]);
+ else
+ state[i] = cyclicShiftLeft(state[i], Nb - shiftOffsets[Nb][i]);
+
+}
+
+// Performs the column mixing step of the cipher. Most of these steps can
+// be combined into table lookups on 32bit values (at least for encryption)
+// to greatly increase the speed.
+
+function mixColumn(state, direction) {
+ var b = []; // Result of matrix multiplications
+ for (var j = 0; j < Nb; j++) { // Go through each column...
+ for (var i = 0; i < 4; i++) { // and for each row in the column...
+ if (direction == "encrypt")
+ b[i] = mult_GF256(state[i][j], 2) ^ // perform mixing
+ mult_GF256(state[(i+1)%4][j], 3) ^
+ state[(i+2)%4][j] ^
+ state[(i+3)%4][j];
+ else
+ b[i] = mult_GF256(state[i][j], 0xE) ^
+ mult_GF256(state[(i+1)%4][j], 0xB) ^
+ mult_GF256(state[(i+2)%4][j], 0xD) ^
+ mult_GF256(state[(i+3)%4][j], 9);
+ }
+ for (var i = 0; i < 4; i++) // Place result back into column
+ state[i][j] = b[i];
+ }
+}
+
+// Adds the current round key to the state information. Straightforward.
+
+function addRoundKey(state, roundKey) {
+ for (var j = 0; j < Nb; j++) { // Step through columns...
+ state[0][j] ^= (roundKey[j] & 0xFF); // and XOR
+ state[1][j] ^= ((roundKey[j]>>8) & 0xFF);
+ state[2][j] ^= ((roundKey[j]>>16) & 0xFF);
+ state[3][j] ^= ((roundKey[j]>>24) & 0xFF);
+ }
+}
+
+// This function creates the expanded key from the input (128/192/256-bit)
+// key. The parameter key is an array of bytes holding the value of the key.
+// The returned value is an array whose elements are the 32-bit words that
+// make up the expanded key.
+
+function keyExpansion(key) {
+ var expandedKey = new Array();
+ var temp;
+
+ // in case the key size or parameters were changed...
+ Nk = keySizeInBits / 32;
+ Nb = blockSizeInBits / 32;
+ Nr = roundsArray[Nk][Nb];
+
+ for (var j=0; j < Nk; j++) // Fill in input key first
+ expandedKey[j] =
+ (key[4*j]) | (key[4*j+1]<<8) | (key[4*j+2]<<16) | (key[4*j+3]<<24);
+
+ // Now walk down the rest of the array filling in expanded key bytes as
+ // per Rijndael's spec
+ for (j = Nk; j < Nb * (Nr + 1); j++) { // For each word of expanded key
+ temp = expandedKey[j - 1];
+ if (j % Nk == 0)
+ temp = ( (SBox[(temp>>8) & 0xFF]) |
+ (SBox[(temp>>16) & 0xFF]<<8) |
+ (SBox[(temp>>24) & 0xFF]<<16) |
+ (SBox[temp & 0xFF]<<24) ) ^ Rcon[Math.floor(j / Nk) - 1];
+ else if (Nk > 6 && j % Nk == 4)
+ temp = (SBox[(temp>>24) & 0xFF]<<24) |
+ (SBox[(temp>>16) & 0xFF]<<16) |
+ (SBox[(temp>>8) & 0xFF]<<8) |
+ (SBox[temp & 0xFF]);
+ expandedKey[j] = expandedKey[j-Nk] ^ temp;
+ }
+ return expandedKey;
+}
+
+// Rijndael's round functions...
+
+function Round(state, roundKey) {
+ byteSub(state, "encrypt");
+ shiftRow(state, "encrypt");
+ mixColumn(state, "encrypt");
+ addRoundKey(state, roundKey);
+}
+
+function InverseRound(state, roundKey) {
+ addRoundKey(state, roundKey);
+ mixColumn(state, "decrypt");
+ shiftRow(state, "decrypt");
+ byteSub(state, "decrypt");
+}
+
+function FinalRound(state, roundKey) {
+ byteSub(state, "encrypt");
+ shiftRow(state, "encrypt");
+ addRoundKey(state, roundKey);
+}
+
+function InverseFinalRound(state, roundKey){
+ addRoundKey(state, roundKey);
+ shiftRow(state, "decrypt");
+ byteSub(state, "decrypt");
+}
+
+// encrypt is the basic encryption function. It takes parameters
+// block, an array of bytes representing a plaintext block, and expandedKey,
+// an array of words representing the expanded key previously returned by
+// keyExpansion(). The ciphertext block is returned as an array of bytes.
+
+function encrypt(block, expandedKey) {
+ var i;
+ if (!block || block.length*8 != blockSizeInBits)
+ return;
+ if (!expandedKey)
+ return;
+
+ block = packBytes(block);
+ addRoundKey(block, expandedKey);
+ for (i=1; i0; i--)
+ InverseRound(block, expandedKey.slice(Nb*i, Nb*(i+1)));
+ addRoundKey(block, expandedKey);
+ return unpackBytes(block);
+}
+
+// This method takes a byte array (byteArray) and converts it to a string by
+// applying String.fromCharCode() to each value and concatenating the result.
+// The resulting string is returned. Note that this function SKIPS zero bytes
+// under the assumption that they are padding added in formatPlaintext().
+// Obviously, do not invoke this method on raw data that can contain zero
+// bytes. It is really only appropriate for printable ASCII/Latin-1
+// values. Roll your own function for more robust functionality :)
+
+function byteArrayToString(byteArray) {
+ var result = "";
+ for(var i=0; i "10ff". The function returns a
+// string.
+
+function byteArrayToHex(byteArray) {
+ var result = "";
+ if (!byteArray)
+ return;
+ for (var i=0; i [16, 255]. This
+// function returns an array.
+
+function hexToByteArray(hexString) {
+ /*
+ var byteArray = [];
+ if (hexString.length % 2) // must have even length
+ return;
+ if (hexString.indexOf("0x") == 0 || hexString.indexOf("0X") == 0)
+ hexString = hexString.substring(2);
+ for (var i = 0; i 0 && i < bpb; i--)
+ plaintext[plaintext.length] = 0;
+
+ return plaintext;
+}
+
+// Returns an array containing "howMany" random bytes. YOU SHOULD CHANGE THIS
+// TO RETURN HIGHER QUALITY RANDOM BYTES IF YOU ARE USING THIS FOR A "REAL"
+// APPLICATION.
+
+function getRandomBytes(howMany) {
+ var i;
+ var bytes = new Array();
+ for (i=0; i0; block--) {
+ aBlock =
+ decrypt(ciphertext.slice(block*bpb,(block+1)*bpb), expandedKey);
+ if (mode == "CBC")
+ for (var i=0; i targetheight)
+ {
+ // reduce the height by intertiabase * inertiainc
+ heightnow -= inertiabase;
+
+ // increase the intertiabase by the amount to keep it changing
+ inertiabase += inertiainc;
+
+ // it's possible to exceed the height we want so we use a ternary - (condition) ? when true : when false;
+ block.style.height = (heightnow > 1) ? heightnow + "px" : targetheight + "px";
+ }
+ else
+ {
+ // finished, so hide the div properly and kill the interval
+ clearInterval(slideinterval);
+ block.style.display = "none";
+ }
+}
+
+// this is the function our slideout interval uses, it keeps adding
+// to the height till it's fully displayed
+function slideout()
+{
+ block.style.display = 'block';
+ if(heightnow < targetheight)
+ {
+ // increases the height by the inertia stuff
+ heightnow += inertiabase;
+
+ // increase the inertia stuff
+ inertiabase += inertiainc;
+
+ // it's possible to exceed the height we want so we use a ternary - (condition) ? when true : when false;
+ block.style.height = (heightnow < targetheight) ? heightnow + "px" : targetheight + "px";
+
+ }
+ else
+ {
+ // finished, so make sure the height is what it's meant to be (inertia can make it off a little)
+ // then kill the interval
+ clearInterval(slideinterval);
+ block.style.height = targetheight + "px";
+ }
+}
+
+// returns the height of the div from our array of such things
+function divheight(d)
+{
+ for(var i=0; i([\s\S]*?)\/g);
+ code2 = '';
+ for(var i in code)
+ if(typeof(code[i]) == 'string')
+ code2 = code2 + code[i];
+ code = code2.replace(/\/g, "'$1' : \"$2\",");
+ code = '( { ' + code + ' "________null________" : false } )';
+ vars = eval(code);
+ return vars;
+}
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/toolbar.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/toolbar.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,60 @@
+// Page toolbar - selecting buttons
+
+function unselectAllButtonsMajor()
+{
+ if ( !document.getElementById('pagebar_main') )
+ return false;
+ obj = document.getElementById('pagebar_main').firstChild;
+ while(obj)
+ {
+ if(obj.id == 'mdgToolbar_article' || obj.id == 'mdgToolbar_discussion')
+ {
+ obj.className = '';
+ }
+ obj = obj.nextSibling;
+ }
+}
+
+function unselectAllButtonsMinor()
+{
+ if ( !document.getElementById('pagebar_main') )
+ return false;
+ obj = document.getElementById('pagebar_main').firstChild.nextSibling;
+ while(obj)
+ {
+ if ( obj.className != 'selected' )
+ {
+ obj = obj.nextSibling;
+ continue;
+ }
+ if(obj.id != 'mdgToolbar_article' && obj.id != 'mdgToolbar_discussion')
+ {
+ if ( obj.className )
+ obj.className = '';
+ }
+ obj = obj.nextSibling;
+ }
+}
+
+function selectButtonMajor(which)
+{
+ if ( !document.getElementById('pagebar_main') )
+ return false;
+ if(typeof(document.getElementById('mdgToolbar_'+which)) == 'object')
+ {
+ unselectAllButtonsMajor();
+ document.getElementById('mdgToolbar_'+which).className = 'selected';
+ }
+}
+
+function selectButtonMinor(which)
+{
+ if ( !document.getElementById('pagebar_main') )
+ return false;
+ if(typeof(document.getElementById('mdgToolbar_'+which)) == 'object')
+ {
+ unselectAllButtonsMinor();
+ document.getElementById('mdgToolbar_'+which).className = 'selected';
+ }
+}
+
diff -r 902822492a68 -r fe660c52c48f includes/clientside/static/windows.js
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/includes/clientside/static/windows.js Wed Jun 13 16:07:17 2007 -0400
@@ -0,0 +1,342 @@
+/*
+ * Enano JWS - Javascript Windowing System
+ * Sorry if I stole the name ;)
+ * Copyright (C) 2006-2007 Dan Fuhry
+ * Yes, it's part of Enano, so it's GPL
+ */
+
+ var position;
+ function getScrollOffset()
+ {
+ var position;
+ if (self.pageYOffset)
+ {
+ position = self.pageYOffset;
+ }
+ else if (document.documentElement && document.documentElement.scrollTop)
+ {
+ position = document.documentElement.scrollTop;
+ }
+ else if (document.body)
+ {
+ position = document.body.scrollTop;
+ }
+ return position;
+ }
+ position = getScrollOffset();
+
+ var jws = {
+ position : position,
+ obj : null,
+ startup : function() {
+ jws.debug('jws.startup()');
+ var divs = document.getElementsByTagName('div');
+ if(IE) { position = document.body.scrollTop; }
+ else { position = window.pageYOffset; }
+ for(i=0;i