new olive theme
This commit is contained in:
parent
aca4f8a3c6
commit
abfba98334
58 changed files with 4380 additions and 42 deletions
0
themes/olive/javascripts/.gitkeep
Normal file
0
themes/olive/javascripts/.gitkeep
Normal file
52
themes/olive/javascripts/contact_choose.js
Executable file
52
themes/olive/javascripts/contact_choose.js
Executable file
|
@ -0,0 +1,52 @@
|
|||
|
||||
var fieldTo = ""
|
||||
var fieldToc = ""
|
||||
var fieldCC = ""
|
||||
var fieldBCC = ""
|
||||
|
||||
function respondTo(str) {
|
||||
if (fieldTo == "") fieldTo += str
|
||||
else fieldTo += "," + str
|
||||
}
|
||||
|
||||
function respondTo(str, contactId) {
|
||||
if (fieldTo == "") fieldTo += str
|
||||
else fieldTo += "," + str
|
||||
|
||||
if (fieldToc == "") fieldToc += contactId
|
||||
else fieldToc += "," + contactId
|
||||
}
|
||||
|
||||
function respondCC(str) {
|
||||
if (fieldCC == "") fieldCC += str
|
||||
else fieldCC += "," + str
|
||||
}
|
||||
|
||||
function respondBCC(str) {
|
||||
if (fieldBCC == "") fieldBCC += str
|
||||
else fieldBCC += "," + str
|
||||
}
|
||||
|
||||
function respondToCaller() {
|
||||
if (window.opener) {
|
||||
doc = window.opener.document;
|
||||
setAddrField(getFormFieldPoint(doc, 'mail_to'), fieldTo);
|
||||
setAddrField(getFormFieldPoint(doc, 'mail_toc'), fieldToc);
|
||||
setAddrField(getFormFieldPoint(doc, 'mail_cc'), fieldCC);
|
||||
setAddrField(getFormFieldPoint(doc, 'mail_bcc'), fieldBCC);
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
|
||||
function getFormFieldPoint(doc, id) {
|
||||
if ( doc.getElementById ) elem = doc.getElementById( id );
|
||||
else if ( doc.all ) elem = doc.eval( "document.all." + id );
|
||||
return elem
|
||||
}
|
||||
|
||||
function setAddrField(fld, value) {
|
||||
if (value != "") {
|
||||
if (fld.value == "") fld.value = value;
|
||||
else fld.value += "," + value;
|
||||
}
|
||||
}
|
349
themes/olive/javascripts/effects2.js
Executable file
349
themes/olive/javascripts/effects2.js
Executable file
|
@ -0,0 +1,349 @@
|
|||
// Copyright (c) 2005 Thomas Fuchs (http://mir.aculo.us)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
Effect2 = {}
|
||||
|
||||
/* ------------- transitions ------------- */
|
||||
|
||||
Effect2.Transitions = {}
|
||||
Effect2.Transitions.linear = function(pos) {
|
||||
return pos;
|
||||
}
|
||||
Effect2.Transitions.sinoidal = function(pos) {
|
||||
return (-Math.cos(pos*Math.PI)/2) + 0.5;
|
||||
}
|
||||
Effect2.Transitions.reverse = function(pos) {
|
||||
return 1-pos;
|
||||
}
|
||||
Effect2.Transitions.flicker = function(pos) {
|
||||
return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random(0.25);
|
||||
}
|
||||
Effect2.Transitions.wobble = function(pos) {
|
||||
return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
|
||||
}
|
||||
|
||||
/* ------------- core effects ------------- */
|
||||
|
||||
Effect2.Base = function() {};
|
||||
Effect2.Base.prototype = {
|
||||
setOptions: function(options) {
|
||||
this.options = {
|
||||
transition: Effect2.Transitions.sinoidal,
|
||||
duration: 1.0, // seconds
|
||||
fps: 25.0, // max. 100fps
|
||||
sync: false, // true for combining
|
||||
from: 0.0,
|
||||
to: 1.0
|
||||
}.extend(options || {});
|
||||
},
|
||||
start: function(options) {
|
||||
this.setOptions(options || {});
|
||||
this.currentFrame = 0;
|
||||
this.startOn = new Date().getTime();
|
||||
this.finishOn = this.startOn + (this.options.duration*1000);
|
||||
if(this.options.beforeStart) this.options.beforeStart(this);
|
||||
if(!this.options.sync) this.loop();
|
||||
},
|
||||
loop: function() {
|
||||
timePos = new Date().getTime();
|
||||
if(timePos >= this.finishOn) {
|
||||
this.render(this.options.to);
|
||||
if(this.finish) this.finish();
|
||||
if(this.options.afterFinish) this.options.afterFinish(this);
|
||||
return;
|
||||
}
|
||||
pos = (timePos - this.startOn) / (this.finishOn - this.startOn);
|
||||
frame = Math.round(pos * this.options.fps * this.options.duration);
|
||||
if(frame > this.currentFrame) {
|
||||
this.render(pos);
|
||||
this.currentFrame = frame;
|
||||
}
|
||||
this.timeout = setTimeout(this.loop.bind(this), 10);
|
||||
},
|
||||
render: function(pos) {
|
||||
if(this.options.transition) pos = this.options.transition(pos);
|
||||
pos = pos * (this.options.to-this.options.from);
|
||||
pos += this.options.from;
|
||||
if(this.options.beforeUpdate) this.options.beforeUpdate(this);
|
||||
if(this.update) this.update(pos);
|
||||
if(this.options.afterUpdate) this.options.afterUpdate(this);
|
||||
},
|
||||
cancel: function() {
|
||||
if(this.timeout) clearTimeout(this.timeout);
|
||||
}
|
||||
}
|
||||
|
||||
Effect2.Parallel = Class.create();
|
||||
Effect2.Parallel.prototype = (new Effect2.Base()).extend({
|
||||
initialize: function(effects) {
|
||||
this.effects = effects || [];
|
||||
this.start(arguments[1]);
|
||||
},
|
||||
update: function(position) {
|
||||
for (var i = 0; i < this.effects.length; i++)
|
||||
this.effects[i].render(position);
|
||||
},
|
||||
finish: function(position) {
|
||||
for (var i = 0; i < this.effects.length; i++)
|
||||
if(this.effects[i].finish) this.effects[i].finish(position);
|
||||
}
|
||||
});
|
||||
|
||||
Effect2.Opacity = Class.create();
|
||||
Effect2.Opacity.prototype = (new Effect2.Base()).extend({
|
||||
initialize: function() {
|
||||
this.element = $(arguments[0] || document.rootElement);
|
||||
options = {
|
||||
from: 0.0,
|
||||
to: 1.0
|
||||
}.extend(arguments[1] || {});
|
||||
this.start(options);
|
||||
},
|
||||
update: function(position) {
|
||||
this.setOpacity(position);
|
||||
},
|
||||
setOpacity: function(opacity) {
|
||||
opacity = (opacity == 1) ? 0.99999 : opacity;
|
||||
this.element.style.opacity = opacity;
|
||||
this.element.style.filter = "alpha(opacity:"+opacity*100+")";
|
||||
}
|
||||
});
|
||||
|
||||
Effect2.MoveBy = Class.create();
|
||||
Effect2.MoveBy.prototype = (new Effect2.Base()).extend({
|
||||
initialize: function(element, toTop, toLeft) {
|
||||
this.element = $(element);
|
||||
this.originalTop =
|
||||
this.element.style.top ? parseFloat(this.element.style.top) : 0;
|
||||
this.originalLeft =
|
||||
this.element.style.left ? parseFloat(this.element.style.left) : 0;
|
||||
this.toTop = toTop;
|
||||
this.toLeft = toLeft;
|
||||
if(this.element.style.position == "")
|
||||
this.element.style.position = "relative";
|
||||
this.start(arguments[3]);
|
||||
},
|
||||
update: function(position) {
|
||||
topd = this.toTop * position + this.originalTop;
|
||||
leftd = this.toLeft * position + this.originalLeft;
|
||||
this.setPosition(topd, leftd);
|
||||
},
|
||||
setPosition: function(topd, leftd) {
|
||||
this.element.style.top = topd + "px";
|
||||
this.element.style.left = leftd + "px";
|
||||
}
|
||||
});
|
||||
|
||||
Effect2.Scale = Class.create();
|
||||
Effect2.Scale.prototype = (new Effect2.Base()).extend({
|
||||
initialize: function(element, percent) {
|
||||
this.element = $(element)
|
||||
options = {
|
||||
scaleX: true,
|
||||
scaleY: true,
|
||||
scaleContent: true,
|
||||
scaleFromCenter: false,
|
||||
scaleMode: 'box', // 'box' or 'contents'
|
||||
scaleFrom: 100.0
|
||||
}.extend(arguments[2] || {});
|
||||
this.originalTop = this.element.offsetTop;
|
||||
this.originalLeft = this.element.offsetLeft;
|
||||
if (this.element.style.fontSize=="") this.sizeEm = 1.0;
|
||||
if (this.element.style.fontSize && this.element.style.fontSize.indexOf("em")>0)
|
||||
this.sizeEm = parseFloat(this.element.style.fontSize);
|
||||
this.factor = (percent/100.0) - (options.scaleFrom/100.0);
|
||||
if(options.scaleMode=='box') {
|
||||
this.originalHeight = this.element.clientHeight;
|
||||
this.originalWidth = this.element.clientWidth;
|
||||
} else
|
||||
if(options.scaleMode=='contents') {
|
||||
this.originalHeight = this.element.scrollHeight;
|
||||
this.originalWidth = this.element.scrollWidth;
|
||||
}
|
||||
this.start(options);
|
||||
},
|
||||
|
||||
update: function(position) {
|
||||
currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
|
||||
if(this.options.scaleContent && this.sizeEm)
|
||||
this.element.style.fontSize = this.sizeEm*currentScale + "em";
|
||||
this.setDimensions(
|
||||
this.originalWidth * currentScale,
|
||||
this.originalHeight * currentScale);
|
||||
},
|
||||
|
||||
setDimensions: function(width, height) {
|
||||
if(this.options.scaleX) this.element.style.width = width + 'px';
|
||||
if(this.options.scaleY) this.element.style.height = height + 'px';
|
||||
if(this.options.scaleFromCenter) {
|
||||
topd = (height - this.originalHeight)/2;
|
||||
leftd = (width - this.originalWidth)/2;
|
||||
if(this.element.style.position=='absolute') {
|
||||
if(this.options.scaleY) this.element.style.top = this.originalTop-topd + "px";
|
||||
if(this.options.scaleX) this.element.style.left = this.originalLeft-leftd + "px";
|
||||
} else {
|
||||
if(this.options.scaleY) this.element.style.top = -topd + "px";
|
||||
if(this.options.scaleX) this.element.style.left = -leftd + "px";
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/* ------------- prepackaged effects ------------- */
|
||||
|
||||
Effect2.Fade = function(element) {
|
||||
options = {
|
||||
from: 1.0,
|
||||
to: 0.0,
|
||||
afterFinish: function(effect)
|
||||
{ Element.hide(effect.element);
|
||||
effect.setOpacity(1); }
|
||||
}.extend(arguments[1] || {});
|
||||
new Effect2.Opacity(element,options);
|
||||
}
|
||||
|
||||
Effect2.Appear = function(element) {
|
||||
options = {
|
||||
from: 0.0,
|
||||
to: 1.0,
|
||||
beforeStart: function(effect)
|
||||
{ effect.setOpacity(0);
|
||||
Element.show(effect.element); },
|
||||
afterUpdate: function(effect)
|
||||
{ Element.show(effect.element); }
|
||||
}.extend(arguments[1] || {});
|
||||
new Effect2.Opacity(element,options);
|
||||
}
|
||||
|
||||
Effect2.Puff = function(element) {
|
||||
new Effect2.Parallel(
|
||||
[ new Effect2.Scale(element, 200, { sync: true, scaleFromCenter: true }),
|
||||
new Effect2.Opacity(element, { sync: true, to: 0.0, from: 1.0 } ) ],
|
||||
{ duration: 1.0,
|
||||
afterUpdate: function(effect)
|
||||
{ effect.effects[0].element.style.position = 'absolute'; },
|
||||
afterFinish: function(effect)
|
||||
{ Element.hide(effect.effects[0].element); }
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Effect2.BlindUp = function(element) {
|
||||
$(element).style.overflow = 'hidden';
|
||||
new Effect2.Scale(element, 0,
|
||||
{ scaleContent: false,
|
||||
scaleX: false,
|
||||
afterFinish: function(effect)
|
||||
{ Element.hide(effect.element) }
|
||||
}.extend(arguments[1] || {})
|
||||
);
|
||||
}
|
||||
|
||||
Effect2.BlindDown = function(element) {
|
||||
$(element).style.height = '0px';
|
||||
$(element).style.overflow = 'hidden';
|
||||
Element.show(element);
|
||||
new Effect2.Scale(element, 100,
|
||||
{ scaleContent: false,
|
||||
scaleX: false,
|
||||
scaleMode: 'contents',
|
||||
scaleFrom: 0
|
||||
}.extend(arguments[1] || {})
|
||||
);
|
||||
}
|
||||
|
||||
Effect2.SwitchOff = function(element) {
|
||||
new Effect2.Appear(element,
|
||||
{ duration: 0.4,
|
||||
transition: Effect2.Transitions.flicker,
|
||||
afterFinish: function(effect)
|
||||
{ effect.element.style.overflow = 'hidden';
|
||||
new Effect2.Scale(effect.element, 1,
|
||||
{ duration: 0.3, scaleFromCenter: true,
|
||||
scaleX: false, scaleContent: false,
|
||||
afterUpdate: function(effect) {
|
||||
if(effect.element.style.position=="")
|
||||
effect.element.style.position = 'relative'; },
|
||||
afterFinish: function(effect) { Element.hide(effect.element); }
|
||||
} )
|
||||
}
|
||||
} )
|
||||
}
|
||||
|
||||
Effect2.DropOut = function(element) {
|
||||
new Effect2.Parallel(
|
||||
[ new Effect2.MoveBy(element, 100, 0, { sync: true }),
|
||||
new Effect2.Opacity(element, { sync: true, to: 0.0, from: 1.0 } ) ],
|
||||
{ duration: 0.5,
|
||||
afterFinish: function(effect)
|
||||
{ Element.hide(effect.effects[0].element); }
|
||||
});
|
||||
}
|
||||
|
||||
Effect2.Shake = function(element) {
|
||||
new Effect2.MoveBy(element, 0, 20,
|
||||
{ duration: 0.05, afterFinish: function(effect) {
|
||||
new Effect2.MoveBy(effect.element, 0, -40,
|
||||
{ duration: 0.1, afterFinish: function(effect) {
|
||||
new Effect2.MoveBy(effect.element, 0, 40,
|
||||
{ duration: 0.1, afterFinish: function(effect) {
|
||||
new Effect2.MoveBy(effect.element, 0, -40,
|
||||
{ duration: 0.1, afterFinish: function(effect) {
|
||||
new Effect2.MoveBy(effect.element, 0, 40,
|
||||
{ duration: 0.1, afterFinish: function(effect) {
|
||||
new Effect2.MoveBy(effect.element, 0, -20,
|
||||
{ duration: 0.05, afterFinish: function(effect) {
|
||||
}}) }}) }}) }}) }}) }});
|
||||
}
|
||||
|
||||
Effect2.SlideDown = function(element) {
|
||||
$(element).style.height = '0px';
|
||||
$(element).style.overflow = 'hidden';
|
||||
$(element).firstChild.style.position = 'relative';
|
||||
Element.show(element);
|
||||
new Effect2.Scale(element, 100,
|
||||
{ scaleContent: false,
|
||||
scaleX: false,
|
||||
scaleMode: 'contents',
|
||||
scaleFrom: 0,
|
||||
afterUpdate: function(effect)
|
||||
{ effect.element.firstChild.style.bottom =
|
||||
(effect.originalHeight - effect.element.clientHeight) + 'px'; }
|
||||
}.extend(arguments[1] || {})
|
||||
);
|
||||
}
|
||||
|
||||
Effect2.SlideUp = function(element) {
|
||||
$(element).style.overflow = 'hidden';
|
||||
$(element).firstChild.style.position = 'relative';
|
||||
Element.show(element);
|
||||
new Effect2.Scale(element, 0,
|
||||
{ scaleContent: false,
|
||||
scaleX: false,
|
||||
afterUpdate: function(effect)
|
||||
{ effect.element.firstChild.style.bottom =
|
||||
(effect.originalHeight - effect.element.clientHeight) + 'px'; },
|
||||
afterFinish: function(effect)
|
||||
{ Element.hide(effect.element); }
|
||||
}.extend(arguments[1] || {})
|
||||
);
|
||||
}
|
216
themes/olive/javascripts/global.js
Executable file
216
themes/olive/javascripts/global.js
Executable file
|
@ -0,0 +1,216 @@
|
|||
function changeLoc(loc) {
|
||||
window.location = loc
|
||||
}
|
||||
function getCookie(name) {
|
||||
var prefix = name + "=";
|
||||
var cStr = document.cookie;
|
||||
var start = cStr.indexOf(prefix);
|
||||
if (start == -1) {
|
||||
return null;
|
||||
}
|
||||
var end = cStr.indexOf(";", start + prefix.length);
|
||||
if (end == -1) {
|
||||
end = cStr.length;
|
||||
}
|
||||
var value = cStr.substring(start + prefix.length, end);
|
||||
return unescape(value);
|
||||
}
|
||||
function setCookie(name, value, expiration) {
|
||||
document.cookie = name + "=" + value + "; expires=" + expiration;
|
||||
}
|
||||
function toggleCheckbox(checkBox) {
|
||||
var element = document.getElementById(checkBox.id);
|
||||
if (element.value == "1" || element.checked) {
|
||||
element.checked = false;
|
||||
element.value = "0";
|
||||
} else {
|
||||
element.checked = true;
|
||||
element.value = "1";
|
||||
}
|
||||
}
|
||||
function toggleChkbox(checkBox) {
|
||||
if (checkBox.checked) {
|
||||
checkBox.checked = true;
|
||||
} else {
|
||||
checkBox.checked = false;
|
||||
}
|
||||
}
|
||||
function toggle_list(id) {
|
||||
ul = "ul_" + id;
|
||||
img = "img_" + id;
|
||||
hid = "h_" + id;
|
||||
ulElement = document.getElementById(ul);
|
||||
imgElement = document.getElementById(img);
|
||||
hiddenElement = document.getElementById(hid);
|
||||
if (ulElement) {
|
||||
if (ulElement.className == 'closed') {
|
||||
ulElement.className = "open";
|
||||
imgElement.src = "/themes/original/images/list_opened.gif";
|
||||
hiddenElement.value = "1"
|
||||
} else {
|
||||
ulElement.className = "closed";
|
||||
imgElement.src = "/themes/original/images/list_closed.gif";
|
||||
hiddenElement.value = "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
function toggle_layer(id) {
|
||||
lElement = document.getElementById(id);
|
||||
imgElement = document.getElementById("img_" + id);
|
||||
if (lElement) {
|
||||
if (lElement.className == 'closed') {
|
||||
lElement.className = "open";
|
||||
imgElement.src = "/themes/original/images/list_opened.gif";
|
||||
return true;
|
||||
} else {
|
||||
lElement.className = "closed";
|
||||
imgElement.src = "/themes/original/images/list_closed.gif";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function toggle_layer_status(id) {
|
||||
lElement = document.getElementById(id);
|
||||
if (lElement) {
|
||||
if (lElement.className == 'closed') {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function toggle_text(id) {
|
||||
if (document.getElementById) elem = document.getElementById(id);
|
||||
else if (document.all) elem = eval("document.all." + id);
|
||||
else return false;
|
||||
if (!elem) return true;
|
||||
elemStyle = elem.style;
|
||||
if (elemStyle.display != "block") {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function getFF(id) {
|
||||
if (document.getElementById) elem = document.getElementById(id);
|
||||
else if (document.all) elem = document.eval("document.all." + id);
|
||||
return elem
|
||||
}
|
||||
function setFF(id, value) {
|
||||
if (getFF(id)) getFF(id).value = value;
|
||||
}
|
||||
function setCFF(id) {
|
||||
if (getFF(id)) getFF(id).checked = true;
|
||||
}
|
||||
function updateSUFromC(btnName) {
|
||||
var suem = getCookie('_cdf_em');
|
||||
var sueg = getCookie('_cdf_gr');
|
||||
if (suem != "" && suem != null && suem != "undefined") {
|
||||
setFF('sup_email', suem);
|
||||
setFF('signup_submit_button', btnName);
|
||||
}
|
||||
if (sueg && sueg != "") {
|
||||
if (sueg.indexOf(",") < 0 && sueg != "") {
|
||||
gr_id = sueg;
|
||||
setCFF('supgr_' + gr_id);
|
||||
} else while ((i = sueg.indexOf(",")) >= 0) {
|
||||
gr_id = sueg.substring(0, i);
|
||||
sueg = sueg.substring(i + 1);
|
||||
setCFF('supgr_' + gr_id);
|
||||
}
|
||||
if (sueg.indexOf(",") < 0 && sueg != "") {
|
||||
gr_id = sueg;
|
||||
setCFF('supgr_' + gr_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
function updateLUEfC() {
|
||||
var suem = getCookie('_cdf_em');
|
||||
if (suem != "" && suem != null && suem != "undefined") {
|
||||
setFF('login_user_email', suem);
|
||||
}
|
||||
}
|
||||
function replaceHRFST(ifrm) {
|
||||
var o = ifrm;
|
||||
var w = null;
|
||||
if (o.contentWindow) {
|
||||
w = o.contentWindow;
|
||||
} else if (window.frames && window.frames[o.id].window) {
|
||||
w = window.frames[o.id];
|
||||
} else return;
|
||||
var doc = w.document;
|
||||
if (!doc.getElementsByTagName) return;
|
||||
var anchors = doc.getElementsByTagName("a");
|
||||
for (var i = 0; i < anchors.length; i++) {
|
||||
var anchor = anchors[i];
|
||||
if (anchor.getAttribute("href")) anchor.target = "_top";
|
||||
}
|
||||
iHeight = doc.body.scrollHeight;
|
||||
ifrm.style.height = iHeight + "px"
|
||||
}
|
||||
function rs(n, u, w, h, x) {
|
||||
args = "width=" + w + ",height=" + h + ",resizable=yes,scrollbars=yes,status=0";
|
||||
remote = window.open(u, n, args);
|
||||
if (remote != null && remote.opener == null) remote.opener = self;
|
||||
if (x == 1) return remote;
|
||||
}
|
||||
function wizard_step_onclick(direction, alt_url) {
|
||||
if (document.forms[0]) {
|
||||
direction_elem = '';
|
||||
if (document.getElementById) {
|
||||
direction_elem = document.getElementById('wiz_dir');
|
||||
} else if (document.all) {
|
||||
direction_elem = document.eval("document.all.wiz_dir");
|
||||
}
|
||||
if (direction_elem) {
|
||||
direction_elem.value = direction;
|
||||
}
|
||||
if (document.forms[0].onsubmit) {
|
||||
document.forms[0].onsubmit();
|
||||
}
|
||||
document.forms[0].submit();
|
||||
} else {
|
||||
window.location = alt_url;
|
||||
}
|
||||
}
|
||||
function toggle_adtype(ad_type) {
|
||||
toggle_text('upload_banner_label');
|
||||
toggle_text('upload_banner');
|
||||
toggle_text('radio1_label');
|
||||
toggle_text('radio1');
|
||||
toggle_text('radio2_label');
|
||||
toggle_text('radio2');
|
||||
toggle_text('adtitle_label');
|
||||
toggle_text('adtitle');
|
||||
toggle_text('adtext_label');
|
||||
toggle_text('adtext');
|
||||
toggle_text('banner_size_label');
|
||||
toggle_text('banner_size');
|
||||
}
|
||||
function show_date_as_local_time() {
|
||||
var spans = document.getElementsByTagName('span');
|
||||
for (var i = 0; i < spans.length; i++) if (spans[i].className.match(/\bLOCAL_TIME\b/i)) {
|
||||
system_date = new Date(Date.parse(spans[i].innerHTML));
|
||||
if (system_date.getHours() >= 12) {
|
||||
adds = ' PM';
|
||||
h = system_date.getHours() - 12;
|
||||
} else {
|
||||
adds = ' AM';
|
||||
h = system_date.getHours();
|
||||
}
|
||||
spans[i].innerHTML = h + ":" + (system_date.getMinutes() + "").replace(/\b(\d)\b/g, '0$1') + adds;
|
||||
}
|
||||
}
|
||||
function PopupPic(sPicURL, sWidth, sHeight) {
|
||||
window.open("/popup.htm?" + sPicURL, "", "resizable=1,HEIGHT=" + sHeight + ",WIDTH=" + sWidth + ",scrollbars=yes");
|
||||
}
|
||||
function open_link(target, location) {
|
||||
if (target == 'blank') {
|
||||
window.open(location);
|
||||
} else {
|
||||
window.top.location = location;
|
||||
}
|
||||
}
|
201
themes/olive/javascripts/global_src.js
Executable file
201
themes/olive/javascripts/global_src.js
Executable file
|
@ -0,0 +1,201 @@
|
|||
function changeLoc(loc) { window.location = loc }
|
||||
function getCookie(name) {
|
||||
var prefix = name + "=";
|
||||
var cStr = document.cookie;
|
||||
var start = cStr.indexOf(prefix);
|
||||
if (start==-1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var end = cStr.indexOf(";", start+prefix.length);
|
||||
if (end==-1) { end=cStr.length; }
|
||||
|
||||
var value=cStr.substring(start+prefix.length, end);
|
||||
return unescape(value);
|
||||
}
|
||||
function setCookie(name, value, expiration) {
|
||||
document.cookie = name+"="+value+"; expires="+expiration;
|
||||
}
|
||||
function toggleCheckbox(checkBox) {
|
||||
var element = document.getElementById(checkBox.id);
|
||||
if (element.value == "1" || element.checked) {
|
||||
element.checked = false;
|
||||
element.value = "0";
|
||||
} else {
|
||||
element.checked = true;
|
||||
element.value = "1";
|
||||
}
|
||||
}
|
||||
function toggleChkbox(checkBox) {
|
||||
if (checkBox.checked) {
|
||||
checkBox.checked = true;
|
||||
} else {
|
||||
checkBox.checked = false;
|
||||
}
|
||||
}
|
||||
function toggle_list(id){
|
||||
ul = "ul_" + id;
|
||||
img = "img_" + id;
|
||||
hid = "h_" + id;
|
||||
ulElement = document.getElementById(ul);
|
||||
imgElement = document.getElementById(img);
|
||||
hiddenElement = document.getElementById(hid);
|
||||
if (ulElement){
|
||||
if (ulElement.className == 'closed'){
|
||||
ulElement.className = "open";
|
||||
imgElement.src = "/themes/original/images/list_opened.gif";
|
||||
hiddenElement.value = "1"
|
||||
}else{
|
||||
ulElement.className = "closed";
|
||||
imgElement.src = "/themes/original/images/list_closed.gif";
|
||||
hiddenElement.value = "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
function toggle_layer(id) {
|
||||
lElement = document.getElementById(id);
|
||||
imgElement = document.getElementById("img_" + id);
|
||||
if (lElement){
|
||||
if (lElement.className == 'closed'){
|
||||
lElement.className = "open";
|
||||
imgElement.src = "/themes/original/images/list_opened.gif";
|
||||
return true;
|
||||
}else{
|
||||
lElement.className = "closed";
|
||||
imgElement.src = "/themes/original/images/list_closed.gif";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function toggle_layer_status(id) {
|
||||
lElement = document.getElementById(id);
|
||||
if (lElement){
|
||||
if (lElement.className == 'closed'){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function toggle_text(id){
|
||||
if ( document.getElementById )
|
||||
elem = document.getElementById( id );
|
||||
else if ( document.all )
|
||||
elem = eval( "document.all." + id );
|
||||
else
|
||||
return false;
|
||||
|
||||
if(!elem) return true;
|
||||
|
||||
elemStyle = elem.style;
|
||||
if ( elemStyle.display != "block" ) {
|
||||
elemStyle.display = "block"
|
||||
} else {
|
||||
elemStyle.display = "none"
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function getFF(id) {
|
||||
if ( document.getElementById ) elem = document.getElementById( id );
|
||||
else if ( document.all ) elem = document.eval( "document.all." + id );
|
||||
return elem
|
||||
}
|
||||
function setFF(id, value) {if(getFF(id))getFF(id).value=value;}
|
||||
function setCFF(id) {if(getFF(id))getFF(id).checked=true;}
|
||||
function updateSUFromC(btnName) {
|
||||
var suem = getCookie('_cdf_em');var sueg = getCookie('_cdf_gr');
|
||||
if (suem != "" && suem != null && suem != "undefined") { setFF('sup_email', suem); setFF('signup_submit_button',btnName); }
|
||||
|
||||
if (sueg && sueg != "") {
|
||||
if (sueg.indexOf(",") < 0 && sueg != "") { gr_id = sueg; setCFF('supgr_'+gr_id);
|
||||
} else while ((i = sueg.indexOf(",")) >= 0) { gr_id = sueg.substring(0,i); sueg = sueg.substring(i+1); setCFF('supgr_'+gr_id); }
|
||||
if (sueg.indexOf(",") < 0 && sueg != "") { gr_id = sueg; setCFF('supgr_'+gr_id);}
|
||||
}
|
||||
}
|
||||
function updateLUEfC() {
|
||||
var suem = getCookie('_cdf_em');
|
||||
if (suem != "" && suem != null && suem != "undefined") { setFF('login_user_email', suem); }
|
||||
}
|
||||
function replaceHRFST(ifrm) {
|
||||
var o = ifrm;
|
||||
var w = null;
|
||||
if (o.contentWindow) {
|
||||
// For IE5.5 and IE6
|
||||
w = o.contentWindow;
|
||||
} else if (window.frames && window.frames[o.id].window) {
|
||||
w = window.frames[o.id];
|
||||
} else return;
|
||||
var doc = w.document;
|
||||
if (!doc.getElementsByTagName) return;
|
||||
var anchors = doc.getElementsByTagName("a");
|
||||
for (var i=0; i<anchors.length; i++) {
|
||||
var anchor = anchors[i];
|
||||
if (anchor.getAttribute("href")) anchor.target = "_top";
|
||||
}
|
||||
iHeight = doc.body.scrollHeight;
|
||||
ifrm.style.height = iHeight + "px"
|
||||
}
|
||||
function rs(n,u,w,h,x){
|
||||
args="width="+w+",height="+h+",resizable=yes,scrollbars=yes,status=0";
|
||||
remote=window.open(u,n,args);
|
||||
if(remote != null && remote.opener == null) remote.opener = self;
|
||||
if(x == 1) return remote;
|
||||
}
|
||||
function wizard_step_onclick(direction, alt_url) {
|
||||
if(document.forms[0]) {
|
||||
direction_elem='';
|
||||
|
||||
if ( document.getElementById ) {
|
||||
direction_elem = document.getElementById( 'wiz_dir' );
|
||||
} else if ( document.all ) {
|
||||
direction_elem = document.eval( "document.all.wiz_dir");
|
||||
}
|
||||
if(direction_elem) {
|
||||
direction_elem.value = direction;
|
||||
}
|
||||
if (document.forms[0].onsubmit) {
|
||||
document.forms[0].onsubmit();
|
||||
}
|
||||
document.forms[0].submit();
|
||||
} else {
|
||||
window.location=alt_url;
|
||||
}
|
||||
}
|
||||
function toggle_adtype(ad_type){
|
||||
toggle_text('upload_banner_label');
|
||||
toggle_text('upload_banner');
|
||||
toggle_text('radio1_label');
|
||||
toggle_text('radio1');
|
||||
toggle_text('radio2_label');
|
||||
toggle_text('radio2');
|
||||
toggle_text('adtitle_label');
|
||||
toggle_text('adtitle');
|
||||
toggle_text('adtext_label');
|
||||
toggle_text('adtext');
|
||||
toggle_text('banner_size_label');
|
||||
toggle_text('banner_size');
|
||||
|
||||
}
|
||||
function show_date_as_local_time() {
|
||||
var spans = document.getElementsByTagName('span');
|
||||
for (var i=0; i<spans.length; i++)
|
||||
if (spans[i].className.match(/\bLOCAL_TIME\b/i)) {
|
||||
system_date = new Date(Date.parse(spans[i].innerHTML));
|
||||
if (system_date.getHours() >= 12) { adds = ' PM'; h = system_date.getHours() - 12; }
|
||||
else { adds = ' AM'; h = system_date.getHours(); }
|
||||
spans[i].innerHTML = h + ":" + (system_date.getMinutes()+"").replace(/\b(\d)\b/g, '0$1') + adds;
|
||||
}
|
||||
}
|
||||
function PopupPic(sPicURL,sWidth,sHeight) {
|
||||
window.open( "/popup.htm?"+sPicURL, "", "resizable=1,HEIGHT="+sHeight+",WIDTH="+sWidth+",scrollbars=yes");
|
||||
}
|
||||
|
||||
function open_link(target, location){
|
||||
if (target == 'blank'){
|
||||
window.open(location);
|
||||
} else {
|
||||
window.top.location = location;
|
||||
}
|
||||
}
|
21
themes/olive/javascripts/htmlstyle.js
Executable file
21
themes/olive/javascripts/htmlstyle.js
Executable file
|
@ -0,0 +1,21 @@
|
|||
var config = new HTMLArea.Config(); // create a new configuration object
|
||||
// having all the default values
|
||||
config.width = '520px';
|
||||
config.pageStyle =
|
||||
'body { font-family: verdana,sans-serif; font-size: 12px } ';
|
||||
|
||||
config.toolbar = [
|
||||
[ "fontname", "fontsize","formatblock","bold", "italic", "underline", "separator", "insertimage", "createlink"],
|
||||
["justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "forecolor", "hilitecolor", "separator", "popupeditor", "htmlmode"]
|
||||
];
|
||||
config.statusBar = false;
|
||||
|
||||
var configView = new HTMLArea.Config(); // create a new configuration object
|
||||
// having all the default values
|
||||
configView.width = '670px';
|
||||
configView.pageStyle =
|
||||
'body { font-family: verdana,sans-serif; font-size: 12px } ';
|
||||
|
||||
configView.toolbar = [];
|
||||
configView.statusBar = false;
|
||||
configView.readonly = true;
|
76
themes/olive/javascripts/jstrim.pl
Executable file
76
themes/olive/javascripts/jstrim.pl
Executable file
|
@ -0,0 +1,76 @@
|
|||
#! /usr/bin/perl -w
|
||||
|
||||
jsTrim("prototype_src.js", "prototype.js");
|
||||
jsTrim("global_src.js", "global.js");
|
||||
#jsTrim("jscripts/tiny_mce/themes/simple/editor_template_src.js", "jscripts/tiny_mce/themes/simple/editor_template.js");
|
||||
#jsTrim("jscripts/tiny_mce/themes/default/editor_template_src.js", "jscripts/tiny_mce/themes/default/editor_template.js");
|
||||
#jsTrim("jscripts/tiny_mce/themes/advanced/editor_template_src.js", "jscripts/tiny_mce/themes/advanced/editor_template.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js", "jscripts/tiny_mce/plugins/advhr/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/advimage/editor_plugin_src.js", "jscripts/tiny_mce/plugins/advimage/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js", "jscripts/tiny_mce/plugins/advlink/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js", "jscripts/tiny_mce/plugins/emotions/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/flash/editor_plugin_src.js", "jscripts/tiny_mce/plugins/flash/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js", "jscripts/tiny_mce/plugins/iespell/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js", "jscripts/tiny_mce/plugins/insertdatetime/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/preview/editor_plugin_src.js", "jscripts/tiny_mce/plugins/preview/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/print/editor_plugin_src.js", "jscripts/tiny_mce/plugins/print/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/save/editor_plugin_src.js", "jscripts/tiny_mce/plugins/save/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js", "jscripts/tiny_mce/plugins/searchreplace/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/zoom/editor_plugin_src.js", "jscripts/tiny_mce/plugins/zoom/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/table/editor_plugin_src.js", "jscripts/tiny_mce/plugins/table/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js", "jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/paste/editor_plugin_src.js", "jscripts/tiny_mce/plugins/paste/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js", "jscripts/tiny_mce/plugins/fullscreen/editor_plugin.js");
|
||||
#jsTrim("jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js", "jscripts/tiny_mce/plugins/directionality/editor_plugin.js");
|
||||
|
||||
sub jsTrim {
|
||||
my $inFile = $_[0];
|
||||
my $outFile = $_[1];
|
||||
my $comment = '';
|
||||
my $content = '';
|
||||
|
||||
# Load input file
|
||||
open(FILE, "<$inFile");
|
||||
undef $/;
|
||||
$content = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
if ($content =~ s#^\s*(/\*.*?\*/)##s or $content =~ s#^\s*(//.*?)\n\s*[^/]##s) {
|
||||
$comment = "$1\n";
|
||||
}
|
||||
|
||||
local $^W;
|
||||
|
||||
# removing C/C++ - style comments:
|
||||
$content =~ s#/\*[^*]*\*+([^/*][^*]*\*+)*/|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#$2#gs;
|
||||
|
||||
# save string literals
|
||||
my @strings = ();
|
||||
$content =~ s/("(\\.|[^"\\])*"|'(\\.|[^'\\])*')/push(@strings, "$1");'__CMPRSTR_'.$#strings.'__';/egs;
|
||||
|
||||
# remove C-style comments
|
||||
$content =~ s#/\*.*?\*/##gs;
|
||||
# remove C++-style comments
|
||||
$content =~ s#//.*?\n##gs;
|
||||
# removing leading/trailing whitespace:
|
||||
#$content =~ s#(?:(?:^|\n)\s+|\s+(?:$|\n))##gs;
|
||||
# removing newlines:
|
||||
#$content =~ s#\r?\n##gs;
|
||||
|
||||
# removing other whitespace (between operators, etc.) (regexp-s stolen from Mike Hall's JS Crunchinator)
|
||||
$content =~ s/\s+/ /gs; # condensing whitespace
|
||||
#$content =~ s/^\s(.*)/$1/gs; # condensing whitespace
|
||||
#$content =~ s/(.*)\s$/$1/gs; # condensing whitespace
|
||||
$content =~ s/\s([\x21\x25\x26\x28\x29\x2a\x2b\x2c\x2d\x2f\x3a\x3b\x3c\x3d\x3e\x3f\x5b\x5d\x5c\x7b\x7c\x7d\x7e])/$1/gs;
|
||||
$content =~ s/([\x21\x25\x26\x28\x29\x2a\x2b\x2c\x2d\x2f\x3a\x3b\x3c\x3d\x3e\x3f\x5b\x5d\x5c\x7b\x7c\x7d\x7e])\s/$1/gs;
|
||||
|
||||
# restore string literals
|
||||
$content =~ s/__CMPRSTR_([0-9]+)__/$strings[$1]/egs;
|
||||
|
||||
# Write to ouput file
|
||||
open(FILE, ">$outFile");
|
||||
flock(FILE, 2);
|
||||
seek(FILE, 0, 2);
|
||||
print FILE $comment, $content;
|
||||
close(FILE);
|
||||
}
|
521
themes/olive/javascripts/prototype_src.js
vendored
Executable file
521
themes/olive/javascripts/prototype_src.js
vendored
Executable file
|
@ -0,0 +1,521 @@
|
|||
var Prototype = {
|
||||
Version: '1.2.1'
|
||||
};
|
||||
|
||||
var Class = {
|
||||
create: function() {
|
||||
return function() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var Abstract = new Object();
|
||||
Object.prototype.extend = function(object) {
|
||||
for (property in object) {
|
||||
this[property] = object[property];
|
||||
}
|
||||
return this;
|
||||
};
|
||||
Function.prototype.bind = function(object) {
|
||||
var method = this;
|
||||
return function() {
|
||||
method.apply(object, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
Function.prototype.bindAsEventListener = function(object) {
|
||||
var method = this;
|
||||
return function(event) {
|
||||
method.call(object, event || window.event);
|
||||
}
|
||||
};
|
||||
|
||||
Number.prototype.toColorPart = function() {
|
||||
var digits = this.toString(16);
|
||||
if (this < 16) return '0' + digits;
|
||||
return digits;
|
||||
};
|
||||
|
||||
var Try = {
|
||||
these: function() {
|
||||
var returnValue;
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var lambda = arguments[i];
|
||||
try {
|
||||
returnValue = lambda();
|
||||
break;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
};
|
||||
|
||||
var PeriodicalExecuter = Class.create();
|
||||
PeriodicalExecuter.prototype = {
|
||||
initialize: function(callback, frequency) {
|
||||
this.callback = callback;
|
||||
this.frequency = frequency;
|
||||
this.currentlyExecuting = false;
|
||||
|
||||
this.registerCallback();
|
||||
},
|
||||
|
||||
registerCallback: function() {
|
||||
setTimeout(this.onTimerEvent.bind(this), this.frequency * 1000);
|
||||
},
|
||||
|
||||
onTimerEvent: function() {
|
||||
if (!this.currentlyExecuting) {
|
||||
try {
|
||||
this.currentlyExecuting = true;
|
||||
this.callback();
|
||||
} finally {
|
||||
this.currentlyExecuting = false;
|
||||
}
|
||||
}
|
||||
|
||||
this.registerCallback();
|
||||
}
|
||||
};
|
||||
function $() {
|
||||
var elements = new Array();
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var element = arguments[i];
|
||||
if (typeof element == 'string')
|
||||
element = document.getElementById(element);
|
||||
|
||||
if (arguments.length == 1)
|
||||
return element;
|
||||
|
||||
elements.push(element);
|
||||
}
|
||||
|
||||
return elements;
|
||||
};
|
||||
if (!Array.prototype.push) {
|
||||
Array.prototype.push = function() {
|
||||
var startLength = this.length;
|
||||
for (var i = 0; i < arguments.length; i++)
|
||||
this[startLength + i] = arguments[i];
|
||||
return this.length;
|
||||
};
|
||||
};
|
||||
|
||||
if (!Function.prototype.apply) {
|
||||
// Based on code from http://www.youngpup.net/
|
||||
Function.prototype.apply = function(object, parameters) {
|
||||
var parameterStrings = new Array();
|
||||
if (!object) object = window;
|
||||
if (!parameters) parameters = new Array();
|
||||
|
||||
for (var i = 0; i < parameters.length; i++)
|
||||
parameterStrings[i] = 'x[' + i + ']';
|
||||
|
||||
object.__apply__ = this;
|
||||
var result = eval('obj.__apply__(' +
|
||||
parameterStrings[i].join(', ') + ')');
|
||||
object.__apply__ = null;
|
||||
|
||||
return result;
|
||||
};
|
||||
};
|
||||
|
||||
var Ajax = {
|
||||
getTransport: function() {
|
||||
return Try.these(
|
||||
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
|
||||
function() {return new ActiveXObject('Microsoft.XMLHTTP')},
|
||||
function() {return new XMLHttpRequest()}
|
||||
) || false;
|
||||
},
|
||||
|
||||
emptyFunction: function() {}
|
||||
};
|
||||
|
||||
Ajax.Base = function() {};
|
||||
Ajax.Base.prototype = {
|
||||
setOptions: function(options) {
|
||||
this.options = {
|
||||
method: 'post',
|
||||
asynchronous: true,
|
||||
parameters: ''
|
||||
}.extend(options || {});
|
||||
}
|
||||
};
|
||||
|
||||
Ajax.Request = Class.create();
|
||||
Ajax.Request.Events =
|
||||
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
|
||||
|
||||
Ajax.Request.prototype = (new Ajax.Base()).extend({
|
||||
initialize: function(url, options) {
|
||||
this.transport = Ajax.getTransport();
|
||||
this.setOptions(options);
|
||||
|
||||
try {
|
||||
if (this.options.method == 'get')
|
||||
url += '?' + this.options.parameters + '&_=';
|
||||
|
||||
this.transport.open(this.options.method, url,
|
||||
this.options.asynchronous);
|
||||
|
||||
if (this.options.asynchronous) {
|
||||
this.transport.onreadystatechange = this.onStateChange.bind(this);
|
||||
setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
|
||||
}
|
||||
|
||||
this.transport.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
this.transport.setRequestHeader('X-Prototype-Version', Prototype.Version);
|
||||
|
||||
if (this.options.method == 'post') {
|
||||
this.transport.setRequestHeader('Connection', 'close');
|
||||
this.transport.setRequestHeader('Content-type',
|
||||
'application/x-www-form-urlencoded');
|
||||
}
|
||||
|
||||
this.transport.send(this.options.method == 'post' ?
|
||||
this.options.parameters + '&_=' : null);
|
||||
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
|
||||
onStateChange: function() {
|
||||
var readyState = this.transport.readyState;
|
||||
if (readyState != 1)
|
||||
this.respondToReadyState(this.transport.readyState);
|
||||
},
|
||||
|
||||
respondToReadyState: function(readyState) {
|
||||
var event = Ajax.Request.Events[readyState];
|
||||
(this.options['on' + event] || Ajax.emptyFunction)(this.transport);
|
||||
}
|
||||
});
|
||||
|
||||
Ajax.Updater = Class.create();
|
||||
Ajax.Updater.prototype = (new Ajax.Base()).extend({
|
||||
initialize: function(container, url, options) {
|
||||
this.container = $(container);
|
||||
this.setOptions(options);
|
||||
|
||||
if (this.options.asynchronous) {
|
||||
this.onComplete = this.options.onComplete;
|
||||
this.options.onComplete = this.updateContent.bind(this);
|
||||
}
|
||||
|
||||
this.request = new Ajax.Request(url, this.options);
|
||||
|
||||
if (!this.options.asynchronous)
|
||||
this.updateContent();
|
||||
},
|
||||
|
||||
updateContent: function() {
|
||||
if (this.options.insertion) {
|
||||
new this.options.insertion(this.container,
|
||||
this.request.transport.responseText);
|
||||
} else {
|
||||
this.container.innerHTML = this.request.transport.responseText;
|
||||
}
|
||||
|
||||
if (this.onComplete) {
|
||||
setTimeout((function() {this.onComplete(this.request)}).bind(this), 10);
|
||||
}
|
||||
}
|
||||
});
|
||||
var Field = {
|
||||
clear: function() {
|
||||
for (var i = 0; i < arguments.length; i++)
|
||||
$(arguments[i]).value = '';
|
||||
},
|
||||
|
||||
focus: function(element) {
|
||||
$(element).focus();
|
||||
},
|
||||
|
||||
present: function() {
|
||||
for (var i = 0; i < arguments.length; i++)
|
||||
if ($(arguments[i]).value == '') return false;
|
||||
return true;
|
||||
},
|
||||
|
||||
select: function(element) {
|
||||
$(element).select();
|
||||
},
|
||||
|
||||
activate: function(element) {
|
||||
$(element).focus();
|
||||
$(element).select();
|
||||
}
|
||||
};
|
||||
var Form = {
|
||||
serialize: function(form) {
|
||||
var elements = Form.getElements($(form));
|
||||
var queryComponents = new Array();
|
||||
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var queryComponent = Form.Element.serialize(elements[i]);
|
||||
if (queryComponent)
|
||||
queryComponents.push(queryComponent);
|
||||
}
|
||||
|
||||
return queryComponents.join('&');
|
||||
},
|
||||
|
||||
getElements: function(form) {
|
||||
form = $(form);
|
||||
var elements = new Array();
|
||||
|
||||
for (tagName in Form.Element.Serializers) {
|
||||
var tagElements = form.getElementsByTagName(tagName);
|
||||
for (var j = 0; j < tagElements.length; j++)
|
||||
elements.push(tagElements[j]);
|
||||
}
|
||||
return elements;
|
||||
},
|
||||
|
||||
disable: function(form) {
|
||||
var elements = Form.getElements(form);
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var element = elements[i];
|
||||
element.blur();
|
||||
element.disable = 'true';
|
||||
}
|
||||
},
|
||||
|
||||
focusFirstElement: function(form) {
|
||||
form = $(form);
|
||||
var elements = Form.getElements(form);
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
var element = elements[i];
|
||||
if (element.type != 'hidden' && !element.disabled) {
|
||||
Field.activate(element);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
reset: function(form) {
|
||||
$(form).reset();
|
||||
}
|
||||
};
|
||||
|
||||
Form.Element = {
|
||||
serialize: function(element) {
|
||||
element = $(element);
|
||||
var method = element.tagName.toLowerCase();
|
||||
var parameter = Form.Element.Serializers[method](element);
|
||||
|
||||
if (parameter)
|
||||
return encodeURIComponent(parameter[0]) + '=' +
|
||||
encodeURIComponent(parameter[1]);
|
||||
},
|
||||
|
||||
getValue: function(element) {
|
||||
element = $(element);
|
||||
var method = element.tagName.toLowerCase();
|
||||
var parameter = Form.Element.Serializers[method](element);
|
||||
|
||||
if (parameter)
|
||||
return parameter[1];
|
||||
}
|
||||
};
|
||||
|
||||
Form.Element.Serializers = {
|
||||
input: function(element) {
|
||||
switch (element.type.toLowerCase()) {
|
||||
case 'hidden':
|
||||
case 'password':
|
||||
case 'text':
|
||||
return Form.Element.Serializers.textarea(element);
|
||||
case 'checkbox':
|
||||
case 'radio':
|
||||
return Form.Element.Serializers.inputSelector(element);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
inputSelector: function(element) {
|
||||
if (element.checked)
|
||||
return [element.name, element.value];
|
||||
},
|
||||
|
||||
textarea: function(element) {
|
||||
return [element.name, element.value];
|
||||
},
|
||||
|
||||
select: function(element) {
|
||||
var index = element.selectedIndex;
|
||||
var value = element.options[index].value || element.options[index].text;
|
||||
return [element.name, (index >= 0) ? value : ''];
|
||||
}
|
||||
};
|
||||
|
||||
var $F = Form.Element.getValue;
|
||||
|
||||
Abstract.TimedObserver = function() {};
|
||||
Abstract.TimedObserver.prototype = {
|
||||
initialize: function(element, frequency, callback) {
|
||||
this.frequency = frequency;
|
||||
this.element = $(element);
|
||||
this.callback = callback;
|
||||
|
||||
this.lastValue = this.getValue();
|
||||
this.registerCallback();
|
||||
},
|
||||
|
||||
registerCallback: function() {
|
||||
setTimeout(this.onTimerEvent.bind(this), this.frequency * 1000);
|
||||
},
|
||||
|
||||
onTimerEvent: function() {
|
||||
var value = this.getValue();
|
||||
if (this.lastValue != value) {
|
||||
this.callback(this.element, value);
|
||||
this.lastValue = value;
|
||||
}
|
||||
|
||||
this.registerCallback();
|
||||
}
|
||||
};
|
||||
|
||||
Form.Element.Observer = Class.create();
|
||||
Form.Element.Observer.prototype = (new Abstract.TimedObserver()).extend({
|
||||
getValue: function() {
|
||||
return Form.Element.getValue(this.element);
|
||||
}
|
||||
});
|
||||
|
||||
Form.Observer = Class.create();
|
||||
Form.Observer.prototype = (new Abstract.TimedObserver()).extend({
|
||||
getValue: function() {
|
||||
return Form.serialize(this.element);
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementsByClassName = function(className) {
|
||||
var children = document.getElementsByTagName('*') || document.all;
|
||||
var elements = new Array();
|
||||
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
var classNames = child.className.split(' ');
|
||||
for (var j = 0; j < classNames.length; j++) {
|
||||
if (classNames[j] == className) {
|
||||
elements.push(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return elements;
|
||||
};
|
||||
|
||||
var Element = {
|
||||
toggle: function() {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var element = $(arguments[i]);
|
||||
element.style.display =
|
||||
(element.style.display == 'none' ? '' : 'none');
|
||||
}
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var element = $(arguments[i]);
|
||||
element.style.display = 'none';
|
||||
}
|
||||
},
|
||||
|
||||
show: function() {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var element = $(arguments[i]);
|
||||
element.style.display = '';
|
||||
}
|
||||
},
|
||||
|
||||
remove: function(element) {
|
||||
element = $(element);
|
||||
element.parentNode.removeChild(element);
|
||||
},
|
||||
|
||||
getHeight: function(element) {
|
||||
element = $(element);
|
||||
return element.offsetHeight;
|
||||
}
|
||||
};
|
||||
|
||||
var Toggle = new Object();
|
||||
Toggle.display = Element.toggle;
|
||||
|
||||
Abstract.Insertion = function(adjacency) {
|
||||
this.adjacency = adjacency;
|
||||
};
|
||||
|
||||
Abstract.Insertion.prototype = {
|
||||
initialize: function(element, content) {
|
||||
this.element = $(element);
|
||||
this.content = content;
|
||||
|
||||
if (this.adjacency && this.element.insertAdjacentHTML) {
|
||||
this.element.insertAdjacentHTML(this.adjacency, this.content);
|
||||
} else {
|
||||
this.range = this.element.ownerDocument.createRange();
|
||||
if (this.initializeRange) this.initializeRange();
|
||||
this.fragment = this.range.createContextualFragment(this.content);
|
||||
this.insertContent();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var Insertion = new Object();
|
||||
|
||||
Insertion.Before = Class.create();
|
||||
Insertion.Before.prototype = (new Abstract.Insertion('beforeBegin')).extend({
|
||||
initializeRange: function() {
|
||||
this.range.setStartBefore(this.element);
|
||||
},
|
||||
|
||||
insertContent: function() {
|
||||
this.element.parentNode.insertBefore(this.fragment, this.element);
|
||||
}
|
||||
});
|
||||
|
||||
Insertion.Top = Class.create();
|
||||
Insertion.Top.prototype = (new Abstract.Insertion('afterBegin')).extend({
|
||||
initializeRange: function() {
|
||||
this.range.selectNodeContents(this.element);
|
||||
this.range.collapse(true);
|
||||
},
|
||||
|
||||
insertContent: function() {
|
||||
this.element.insertBefore(this.fragment, this.element.firstChild);
|
||||
}
|
||||
});
|
||||
|
||||
Insertion.Bottom = Class.create();
|
||||
Insertion.Bottom.prototype = (new Abstract.Insertion('beforeEnd')).extend({
|
||||
initializeRange: function() {
|
||||
this.range.selectNodeContents(this.element);
|
||||
this.range.collapse(this.element);
|
||||
},
|
||||
|
||||
insertContent: function() {
|
||||
this.element.appendChild(this.fragment);
|
||||
}
|
||||
});
|
||||
|
||||
Insertion.After = Class.create();
|
||||
Insertion.After.prototype = (new Abstract.Insertion('afterEnd')).extend({
|
||||
initializeRange: function() {
|
||||
this.range.setStartAfter(this.element);
|
||||
},
|
||||
|
||||
insertContent: function() {
|
||||
this.element.parentNode.insertBefore(this.fragment,
|
||||
this.element.nextSibling);
|
||||
}
|
||||
});
|
47
themes/olive/javascripts/scriptaculous.js
Executable file
47
themes/olive/javascripts/scriptaculous.js
Executable file
|
@ -0,0 +1,47 @@
|
|||
// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
var Scriptaculous = {
|
||||
Version: '1.5_rc3',
|
||||
require: function(libraryName) {
|
||||
// inserting via DOM fails in Safari 2.0, so brute force approach
|
||||
document.write('<script type="text/javascript" src="'+libraryName+'"></script>');
|
||||
},
|
||||
load: function() {
|
||||
if((typeof Prototype=='undefined') ||
|
||||
parseFloat(Prototype.Version.split(".")[0] + "." +
|
||||
Prototype.Version.split(".")[1]) < 1.4)
|
||||
throw("script.aculo.us requires the Prototype JavaScript framework >= 1.4.0");
|
||||
var scriptTags = document.getElementsByTagName("script");
|
||||
for(var i=0;i<scriptTags.length;i++) {
|
||||
if(scriptTags[i].src && scriptTags[i].src.match(/scriptaculous\.js(\?.*)?$/)) {
|
||||
var path = scriptTags[i].src.replace(/scriptaculous\.js(\?.*)?$/,'');
|
||||
this.require(path + 'effects.js');
|
||||
this.require(path + 'dragdrop.js');
|
||||
this.require(path + 'controls.js');
|
||||
this.require(path + 'slider.js');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Scriptaculous.load();
|
258
themes/olive/javascripts/slider.js
Executable file
258
themes/olive/javascripts/slider.js
Executable file
|
@ -0,0 +1,258 @@
|
|||
// Copyright (c) 2005 Marty Haught
|
||||
//
|
||||
// See scriptaculous.js for full license.
|
||||
|
||||
if(!Control) var Control = {};
|
||||
Control.Slider = Class.create();
|
||||
|
||||
// options:
|
||||
// axis: 'vertical', or 'horizontal' (default)
|
||||
// increment: (default: 1)
|
||||
// step: (default: 1)
|
||||
//
|
||||
// callbacks:
|
||||
// onChange(value)
|
||||
// onSlide(value)
|
||||
Control.Slider.prototype = {
|
||||
initialize: function(handle, track, options) {
|
||||
this.handle = $(handle);
|
||||
this.track = $(track);
|
||||
|
||||
this.options = options || {};
|
||||
|
||||
this.axis = this.options.axis || 'horizontal';
|
||||
this.increment = this.options.increment || 1;
|
||||
this.step = parseInt(this.options.step) || 1;
|
||||
this.value = 0;
|
||||
|
||||
var defaultMaximum = Math.round(this.track.offsetWidth / this.increment);
|
||||
if(this.isVertical()) defaultMaximum = Math.round(this.track.offsetHeight / this.increment);
|
||||
|
||||
this.maximum = this.options.maximum || defaultMaximum;
|
||||
this.minimum = this.options.minimum || 0;
|
||||
|
||||
// Will be used to align the handle onto the track, if necessary
|
||||
this.alignX = parseInt (this.options.alignX) || 0;
|
||||
this.alignY = parseInt (this.options.alignY) || 0;
|
||||
|
||||
// Zero out the slider position
|
||||
this.setCurrentLeft(Position.cumulativeOffset(this.track)[0] - Position.cumulativeOffset(this.handle)[0] + this.alignX);
|
||||
this.setCurrentTop(this.trackTop() - Position.cumulativeOffset(this.handle)[1] + this.alignY);
|
||||
|
||||
this.offsetX = 0;
|
||||
this.offsetY = 0;
|
||||
|
||||
this.originalLeft = this.currentLeft();
|
||||
this.originalTop = this.currentTop();
|
||||
this.originalZ = parseInt(this.handle.style.zIndex || "0");
|
||||
|
||||
// Prepopulate Slider value
|
||||
this.setSliderValue(parseInt(this.options.sliderValue) || 0);
|
||||
|
||||
this.active = false;
|
||||
this.dragging = false;
|
||||
this.disabled = false;
|
||||
|
||||
// FIXME: use css
|
||||
this.handleImage = $(this.options.handleImage) || false;
|
||||
this.handleDisabled = this.options.handleDisabled || false;
|
||||
this.handleEnabled = false;
|
||||
if(this.handleImage)
|
||||
this.handleEnabled = this.handleImage.src || false;
|
||||
|
||||
if(this.options.disabled)
|
||||
this.setDisabled();
|
||||
|
||||
// Value Array
|
||||
this.values = this.options.values || false; // Add method to validate and sort??
|
||||
|
||||
Element.makePositioned(this.handle); // fix IE
|
||||
|
||||
this.eventMouseDown = this.startDrag.bindAsEventListener(this);
|
||||
this.eventMouseUp = this.endDrag.bindAsEventListener(this);
|
||||
this.eventMouseMove = this.update.bindAsEventListener(this);
|
||||
this.eventKeypress = this.keyPress.bindAsEventListener(this);
|
||||
|
||||
Event.observe(this.handle, "mousedown", this.eventMouseDown);
|
||||
Event.observe(document, "mouseup", this.eventMouseUp);
|
||||
Event.observe(document, "mousemove", this.eventMouseMove);
|
||||
Event.observe(document, "keypress", this.eventKeypress);
|
||||
},
|
||||
dispose: function() {
|
||||
Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
|
||||
Event.stopObserving(document, "mouseup", this.eventMouseUp);
|
||||
Event.stopObserving(document, "mousemove", this.eventMouseMove);
|
||||
Event.stopObserving(document, "keypress", this.eventKeypress);
|
||||
},
|
||||
setDisabled: function(){
|
||||
this.disabled = true;
|
||||
if(this.handleDisabled)
|
||||
this.handleImage.src = this.handleDisabled;
|
||||
},
|
||||
setEnabled: function(){
|
||||
this.disabled = false;
|
||||
if(this.handleEnabled)
|
||||
this.handleImage.src = this.handleEnabled;
|
||||
},
|
||||
currentLeft: function() {
|
||||
return parseInt(this.handle.style.left || '0');
|
||||
},
|
||||
currentTop: function() {
|
||||
return parseInt(this.handle.style.top || '0');
|
||||
},
|
||||
setCurrentLeft: function(left) {
|
||||
this.handle.style.left = left +"px";
|
||||
},
|
||||
setCurrentTop: function(top) {
|
||||
this.handle.style.top = top +"px";
|
||||
},
|
||||
trackLeft: function(){
|
||||
return Position.cumulativeOffset(this.track)[0];
|
||||
},
|
||||
trackTop: function(){
|
||||
return Position.cumulativeOffset(this.track)[1];
|
||||
},
|
||||
getNearestValue: function(value){
|
||||
if(this.values){
|
||||
var i = 0;
|
||||
var offset = Math.abs(this.values[0] - value);
|
||||
var newValue = this.values[0];
|
||||
|
||||
for(i=0; i < this.values.length; i++){
|
||||
var currentOffset = Math.abs(this.values[i] - value);
|
||||
if(currentOffset < offset){
|
||||
newValue = this.values[i];
|
||||
offset = currentOffset;
|
||||
}
|
||||
}
|
||||
return newValue;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
setSliderValue: function(sliderValue){
|
||||
// First check our max and minimum and nearest values
|
||||
sliderValue = this.getNearestValue(sliderValue);
|
||||
if(sliderValue > this.maximum) sliderValue = this.maximum;
|
||||
if(sliderValue < this.minimum) sliderValue = this.minimum;
|
||||
var offsetDiff = (sliderValue - (this.value||this.minimum)) * this.increment;
|
||||
|
||||
if(this.isVertical()){
|
||||
this.setCurrentTop(offsetDiff + this.currentTop());
|
||||
} else {
|
||||
this.setCurrentLeft(offsetDiff + this.currentLeft());
|
||||
}
|
||||
this.value = sliderValue;
|
||||
this.updateFinished();
|
||||
},
|
||||
minimumOffset: function(){
|
||||
return(this.isVertical() ?
|
||||
this.trackTop() + this.alignY :
|
||||
this.trackLeft() + this.alignX);
|
||||
},
|
||||
maximumOffset: function(){
|
||||
return(this.isVertical() ?
|
||||
this.trackTop() + this.alignY + (this.maximum - this.minimum) * this.increment :
|
||||
this.trackLeft() + this.alignX + (this.maximum - this.minimum) * this.increment);
|
||||
},
|
||||
isVertical: function(){
|
||||
return (this.axis == 'vertical');
|
||||
},
|
||||
startDrag: function(event) {
|
||||
if(Event.isLeftClick(event)) {
|
||||
if(!this.disabled){
|
||||
this.active = true;
|
||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||
var offsets = Position.cumulativeOffset(this.handle);
|
||||
this.offsetX = (pointer[0] - offsets[0]);
|
||||
this.offsetY = (pointer[1] - offsets[1]);
|
||||
this.originalLeft = this.currentLeft();
|
||||
this.originalTop = this.currentTop();
|
||||
}
|
||||
Event.stop(event);
|
||||
}
|
||||
},
|
||||
update: function(event) {
|
||||
if(this.active) {
|
||||
if(!this.dragging) {
|
||||
var style = this.handle.style;
|
||||
this.dragging = true;
|
||||
if(style.position=="") style.position = "relative";
|
||||
style.zIndex = this.options.zindex;
|
||||
}
|
||||
this.draw(event);
|
||||
// fix AppleWebKit rendering
|
||||
if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);
|
||||
Event.stop(event);
|
||||
}
|
||||
},
|
||||
draw: function(event) {
|
||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||
var offsets = Position.cumulativeOffset(this.handle);
|
||||
|
||||
offsets[0] -= this.currentLeft();
|
||||
offsets[1] -= this.currentTop();
|
||||
|
||||
// Adjust for the pointer's position on the handle
|
||||
pointer[0] -= this.offsetX;
|
||||
pointer[1] -= this.offsetY;
|
||||
var style = this.handle.style;
|
||||
|
||||
if(this.isVertical()){
|
||||
if(pointer[1] > this.maximumOffset())
|
||||
pointer[1] = this.maximumOffset();
|
||||
if(pointer[1] < this.minimumOffset())
|
||||
pointer[1] = this.minimumOffset();
|
||||
|
||||
// Increment by values
|
||||
if(this.values){
|
||||
this.value = this.getNearestValue(Math.round((pointer[1] - this.minimumOffset()) / this.increment) + this.minimum);
|
||||
pointer[1] = this.trackTop() + this.alignY + (this.value - this.minimum) * this.increment;
|
||||
} else {
|
||||
this.value = Math.round((pointer[1] - this.minimumOffset()) / this.increment) + this.minimum;
|
||||
}
|
||||
style.top = pointer[1] - offsets[1] + "px";
|
||||
} else {
|
||||
if(pointer[0] > this.maximumOffset()) pointer[0] = this.maximumOffset();
|
||||
if(pointer[0] < this.minimumOffset()) pointer[0] = this.minimumOffset();
|
||||
// Increment by values
|
||||
if(this.values){
|
||||
this.value = this.getNearestValue(Math.round((pointer[0] - this.minimumOffset()) / this.increment) + this.minimum);
|
||||
pointer[0] = this.trackLeft() + this.alignX + (this.value - this.minimum) * this.increment;
|
||||
} else {
|
||||
this.value = Math.round((pointer[0] - this.minimumOffset()) / this.increment) + this.minimum;
|
||||
}
|
||||
style.left = (pointer[0] - offsets[0]) + "px";
|
||||
}
|
||||
if(this.options.onSlide) this.options.onSlide(this.value);
|
||||
},
|
||||
endDrag: function(event) {
|
||||
if(this.active && this.dragging) {
|
||||
this.finishDrag(event, true);
|
||||
Event.stop(event);
|
||||
}
|
||||
this.active = false;
|
||||
this.dragging = false;
|
||||
},
|
||||
finishDrag: function(event, success) {
|
||||
this.active = false;
|
||||
this.dragging = false;
|
||||
this.handle.style.zIndex = this.originalZ;
|
||||
this.originalLeft = this.currentLeft();
|
||||
this.originalTop = this.currentTop();
|
||||
this.updateFinished();
|
||||
},
|
||||
updateFinished: function() {
|
||||
if(this.options.onChange) this.options.onChange(this.value);
|
||||
},
|
||||
keyPress: function(event) {
|
||||
if(this.active && !this.disabled) {
|
||||
switch(event.keyCode) {
|
||||
case Event.KEY_ESC:
|
||||
this.finishDrag(event, false);
|
||||
Event.stop(event);
|
||||
break;
|
||||
}
|
||||
if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
|
||||
}
|
||||
}
|
||||
}
|
35
themes/olive/javascripts/webmail.js
Executable file
35
themes/olive/javascripts/webmail.js
Executable file
|
@ -0,0 +1,35 @@
|
|||
function chooseContacts(url) {
|
||||
rs('', url + '?mode=choose',550,480,0);
|
||||
}
|
||||
|
||||
function setBulk() {
|
||||
if (getFormField("mail_bulk").checked) getFormField("set_bulk").value = "set_bulk"
|
||||
document.forms['composeMail'].submit();
|
||||
}
|
||||
|
||||
function getFormField(id) {
|
||||
if ( document.getElementById ) elem = document.getElementById( id );
|
||||
else if ( document.all ) elem = document.eval( "document.all." + id );
|
||||
return elem;
|
||||
}
|
||||
|
||||
function toggle_msg_operations(setc) {
|
||||
var isOpened = toggle_layer('msgops');
|
||||
if (setc) setCookie("_wmlmo", ( isOpened ? "opened" : "closed"), 1000000);
|
||||
}
|
||||
|
||||
function toggle_msg_search(setc) {
|
||||
var isOpened = toggle_layer('msg_search');
|
||||
if (setc) setCookie("_wmlms", (isOpened ? "opened" : "closed"), 1000000);
|
||||
}
|
||||
|
||||
function checkAll(theForm) { // check all the checkboxes in the list
|
||||
for (var i=0;i<theForm.elements.length;i++) {
|
||||
var e = theForm.elements[i];
|
||||
var eName = e.name;
|
||||
if (eName != 'allbox' &&
|
||||
(e.type.indexOf("checkbox") == 0)) {
|
||||
e.checked = theForm.allbox.checked;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue