Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
Rewrote the read-checkboxes javascript to be more robust.
Browse files Browse the repository at this point in the history
Moved several javascripts out of status.c into their own files.
Added in a debug for the URL that can be manually enabled by removing the comment in checkboxesNbutton.js
Fixes #609

Updated scriptalicious to 1.8.3, up from 1.8.2
Fixes #698
  • Loading branch information
TheFlyingCorpse committed Aug 9, 2010
1 parent fd4b28c commit 2ad210d
Show file tree
Hide file tree
Showing 10 changed files with 1,931 additions and 1,325 deletions.
34 changes: 16 additions & 18 deletions html/js/builder.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// script.aculo.us builder.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// script.aculo.us builder.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009

// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/

var Builder = {
NODEMAP: {
AREA: 'map',
Expand All @@ -26,25 +26,25 @@ var Builder = {
// due to a Firefox bug
node: function(elementName) {
elementName = elementName.toUpperCase();

// try innerHTML approach
var parentTag = this.NODEMAP[elementName] || 'div';
var parentElement = document.createElement(parentTag);
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
} catch(e) {}
var element = parentElement.firstChild || null;

// see if browser added wrapping tags
if(element && (element.tagName.toUpperCase() != elementName))
element = element.getElementsByTagName(elementName)[0];

// fallback to createElement approach
if(!element) element = document.createElement(elementName);

// abort if nothing could be created
if(!element) return;

// attributes (or text)
if(arguments[1])
if(this._isStringOrNumber(arguments[1]) ||
Expand All @@ -69,22 +69,22 @@ var Builder = {
element = parentElement.getElementsByTagName(elementName)[0];
}
}

// text, or array of children
if(arguments[2])
this._children(element, arguments[2]);

return $(element);
},
_text: function(text) {
return document.createTextNode(text);
},

ATTR_MAP: {
'className': 'class',
'htmlFor': 'for'
},

_attributes: function(attributes) {
var attrs = [];
for(attribute in attributes)
Expand Down Expand Up @@ -119,20 +119,18 @@ var Builder = {
},
dump: function(scope) {
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope

var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);

tags.each( function(tag){
scope[tag] = function() {
return Builder.node.apply(Builder, [tag].concat($A(arguments)));
};
});
}
};


};
4 changes: 3 additions & 1 deletion html/js/checkboxesNbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ function cmd_submit()
arguments = cmd_typ + command_arguments;
}
bazinga = '?' + arguments;
fullurl = replaceCGIString(location.href);
fullurl = replaceCGIString(location.href,'status.cgi','cmd.cgi');
fullurl = replaceArgString(fullurl);
fullurl = fullurl + bazinga;
self.location.assign(fullurl);
// Remove comment below for debugging of the URL
//alert(fullurl);
return fullurl;
}
function isValidForSubmit()
Expand Down
8 changes: 4 additions & 4 deletions html/js/controls.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// script.aculo.us controls.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
// script.aculo.us controls.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009

// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2008 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
// (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2009 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
// (c) 2005-2009 Jon Tirsen (http://www.tirsen.com)
// Contributors:
// Richard Livsey
// Rahul Bhargava
Expand Down
Loading

0 comments on commit 2ad210d

Please sign in to comment.