Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -47,7 +47,7 @@ Date.prototype.toFormattedString = function(include_time)
|
||||
return str;
|
||||
}
|
||||
|
||||
Date.parseFormattedString = function(string) { return new Date(string);}
|
||||
Date.parseFormattedString = function(string) { var vstring = string.sub(/([0-9]{2})\.([0-9]{2})\.([0-9]{4})/, function(match) { return match[2] + " " + match[1] + "," + match[3]; }); return new Date(vstring); }
|
||||
Math.floor_to_interval = function(n, i) { return Math.floor(n/i) * i;}
|
||||
window.f_height = function() { return( [window.innerHeight ? window.innerHeight : null, document.documentElement ? document.documentElement.clientHeight : null, document.body ? document.body.clientHeight : null].select(function(x){return x>0}).first()||0); }
|
||||
window.f_scrollTop = function() { return ([window.pageYOffset ? window.pageYOffset : null, document.documentElement ? document.documentElement.scrollTop : null, document.body ? document.body.scrollTop : null].select(function(x){return x>0}).first()||0 ); }
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
Date.prototype.toFormattedString = function(include_time){
|
||||
str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate());
|
||||
|
||||
if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() }
|
||||
return str;
|
||||
}
|
||||
|
||||
Date.parseFormattedString = function (string) {
|
||||
var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
|
||||
"( ([0-9]{1,2}):([0-9]{2})? *(pm|am)" +
|
||||
"?)?)?)?";
|
||||
var d = string.match(new RegExp(regexp, "i"));
|
||||
if (d==null) return Date.parse(string); // at least give javascript a crack at it.
|
||||
var offset = 0;
|
||||
var date = new Date(d[1], 0, 1);
|
||||
if (d[3]) { date.setMonth(d[3] - 1); }
|
||||
if (d[5]) { date.setDate(d[5]); }
|
||||
if (d[7]) {
|
||||
hours = parseInt(d[7], 10);
|
||||
offset=0;
|
||||
is_pm = (d[9].toLowerCase()=="pm")
|
||||
if (is_pm && hours <= 11) hours+=12;
|
||||
if (!is_pm && hours == 12) hours=0;
|
||||
date.setHours(hours);
|
||||
|
||||
}
|
||||
if (d[8]) { date.setMinutes(d[8]); }
|
||||
if (d[10]) { date.setSeconds(d[10]); }
|
||||
if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
|
||||
if (d[14]) {
|
||||
offset = (Number(d[16]) * 60) + Number(d[17]);
|
||||
offset *= ((d[15] == '-') ? 1 : -1);
|
||||
}
|
||||
|
||||
return date;
|
||||
Date.prototype.toFormattedString = function(include_time){
|
||||
str = this.getFullYear() + "-" + Date.padded2(this.getMonth() + 1) + "-" +Date.padded2(this.getDate());
|
||||
|
||||
if (include_time) { hour=this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() }
|
||||
return str;
|
||||
}
|
||||
|
||||
Date.parseFormattedString = function (string) {
|
||||
var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
|
||||
"( ([0-9]{1,2}):([0-9]{2})? *(pm|am)" +
|
||||
"?)?)?)?";
|
||||
var d = string.match(new RegExp(regexp, "i"));
|
||||
if (d==null) return Date.parse(string); // at least give javascript a crack at it.
|
||||
var offset = 0;
|
||||
var date = new Date(d[1], 0, 1);
|
||||
if (d[3]) { date.setMonth(d[3] - 1); }
|
||||
if (d[5]) { date.setDate(d[5]); }
|
||||
if (d[7]) {
|
||||
hours = parseInt(d[7], 10);
|
||||
offset=0;
|
||||
is_pm = (d[9].toLowerCase()=="pm")
|
||||
if (is_pm && hours <= 11) hours+=12;
|
||||
if (!is_pm && hours == 12) hours=0;
|
||||
date.setHours(hours);
|
||||
|
||||
}
|
||||
if (d[8]) { date.setMinutes(d[8]); }
|
||||
if (d[10]) { date.setSeconds(d[10]); }
|
||||
if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
|
||||
if (d[14]) {
|
||||
offset = (Number(d[16]) * 60) + Number(d[17]);
|
||||
offset *= ((d[15] == '-') ? 1 : -1);
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
+10
-1
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +1,10 @@
|
||||
Date.weekdays = $w('D S T Q Q S S');
|
||||
Date.months = $w('Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Novembro Dezembro');
|
||||
|
||||
Date.first_day_of_week = 0
|
||||
|
||||
_translations = {
|
||||
"OK": "OK",
|
||||
"Now": "Agora",
|
||||
"Today": "Hoje"
|
||||
Date.weekdays = $w('D S T Q Q S S');
|
||||
Date.months = $w('Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Novembro Dezembro');
|
||||
|
||||
Date.first_day_of_week = 0
|
||||
|
||||
_translations = {
|
||||
"OK": "OK",
|
||||
"Now": "Agora",
|
||||
"Today": "Hoje"
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 66 B |
Binary file not shown.
|
After Width: | Height: | Size: 83 B |
@@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>jscolor demo</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript" src="jscolor.js"></script>
|
||||
|
||||
Click here: <input class="color" value="66ff00">
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+840
@@ -0,0 +1,840 @@
|
||||
/**
|
||||
* jscolor, JavaScript Color Picker
|
||||
*
|
||||
* @version 1.3.1
|
||||
* @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
|
||||
* @author Jan Odvarko, http://odvarko.cz
|
||||
* @created 2008-06-15
|
||||
* @updated 2010-01-23
|
||||
* @link http://jscolor.com
|
||||
*/
|
||||
|
||||
|
||||
var jscolor = {
|
||||
|
||||
|
||||
dir : '', // location of jscolor directory (leave empty to autodetect)
|
||||
bindClass : 'color', // class name
|
||||
binding : true, // automatic binding via <input class="...">
|
||||
preloading : true, // use image preloading?
|
||||
|
||||
|
||||
install : function() {
|
||||
jscolor.addEvent(window, 'load', jscolor.init);
|
||||
},
|
||||
|
||||
|
||||
init : function() {
|
||||
if(jscolor.binding) {
|
||||
jscolor.bind();
|
||||
}
|
||||
if(jscolor.preloading) {
|
||||
jscolor.preload();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getDir : function() {
|
||||
if(!jscolor.dir) {
|
||||
var detected = jscolor.detectDir();
|
||||
jscolor.dir = detected!==false ? detected : 'jscolor/';
|
||||
}
|
||||
return jscolor.dir;
|
||||
},
|
||||
|
||||
|
||||
detectDir : function() {
|
||||
var base = location.href;
|
||||
|
||||
var e = document.getElementsByTagName('base');
|
||||
for(var i=0; i<e.length; i+=1) {
|
||||
if(e[i].href) { base = e[i].href; }
|
||||
}
|
||||
|
||||
var e = document.getElementsByTagName('script');
|
||||
for(var i=0; i<e.length; i+=1) {
|
||||
if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) {
|
||||
var src = new jscolor.URI(e[i].src);
|
||||
var srcAbs = src.toAbsolute(base);
|
||||
srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename
|
||||
srcAbs.query = null;
|
||||
srcAbs.fragment = null;
|
||||
return srcAbs.toString();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
bind : function() {
|
||||
var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');
|
||||
var e = document.getElementsByTagName('input');
|
||||
for(var i=0; i<e.length; i+=1) {
|
||||
var m;
|
||||
if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
|
||||
var prop = {};
|
||||
if(m[3]) {
|
||||
try {
|
||||
eval('prop='+m[3]);
|
||||
} catch(eInvalidProp) {}
|
||||
}
|
||||
e[i].color = new jscolor.color(e[i], prop);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
preload : function() {
|
||||
for(var fn in jscolor.imgRequire) {
|
||||
if(jscolor.imgRequire.hasOwnProperty(fn)) {
|
||||
jscolor.loadImage(fn);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
images : {
|
||||
pad : [ 181, 101 ],
|
||||
sld : [ 16, 101 ],
|
||||
cross : [ 15, 15 ],
|
||||
arrow : [ 7, 11 ]
|
||||
},
|
||||
|
||||
|
||||
imgRequire : {},
|
||||
imgLoaded : {},
|
||||
|
||||
|
||||
requireImage : function(filename) {
|
||||
jscolor.imgRequire[filename] = true;
|
||||
},
|
||||
|
||||
|
||||
loadImage : function(filename) {
|
||||
if(!jscolor.imgLoaded[filename]) {
|
||||
jscolor.imgLoaded[filename] = new Image();
|
||||
jscolor.imgLoaded[filename].src = jscolor.getDir()+filename;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
fetchElement : function(mixed) {
|
||||
return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
|
||||
},
|
||||
|
||||
|
||||
addEvent : function(el, evnt, func) {
|
||||
if(el.addEventListener) {
|
||||
el.addEventListener(evnt, func, false);
|
||||
} else if(el.attachEvent) {
|
||||
el.attachEvent('on'+evnt, func);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
fireEvent : function(el, evnt) {
|
||||
if(!el) {
|
||||
return;
|
||||
}
|
||||
if(document.createEventObject) {
|
||||
var ev = document.createEventObject();
|
||||
el.fireEvent('on'+evnt, ev);
|
||||
} else if(document.createEvent) {
|
||||
var ev = document.createEvent('HTMLEvents');
|
||||
ev.initEvent(evnt, true, true);
|
||||
el.dispatchEvent(ev);
|
||||
} else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5)
|
||||
el['on'+evnt]();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getElementPos : function(e) {
|
||||
var e1=e, e2=e;
|
||||
var x=0, y=0;
|
||||
if(e1.offsetParent) {
|
||||
do {
|
||||
x += e1.offsetLeft;
|
||||
y += e1.offsetTop;
|
||||
} while(e1 = e1.offsetParent);
|
||||
}
|
||||
while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') {
|
||||
x -= e2.scrollLeft;
|
||||
y -= e2.scrollTop;
|
||||
}
|
||||
return [x, y];
|
||||
},
|
||||
|
||||
|
||||
getElementSize : function(e) {
|
||||
return [e.offsetWidth, e.offsetHeight];
|
||||
},
|
||||
|
||||
|
||||
getMousePos : function(e) {
|
||||
if(!e) { e = window.event; }
|
||||
if(typeof e.pageX === 'number') {
|
||||
return [e.pageX, e.pageY];
|
||||
} else if(typeof e.clientX === 'number') {
|
||||
return [
|
||||
e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft,
|
||||
e.clientY + document.body.scrollTop + document.documentElement.scrollTop
|
||||
];
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getViewPos : function() {
|
||||
if(typeof window.pageYOffset === 'number') {
|
||||
return [window.pageXOffset, window.pageYOffset];
|
||||
} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
|
||||
return [document.body.scrollLeft, document.body.scrollTop];
|
||||
} else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
|
||||
return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
|
||||
} else {
|
||||
return [0, 0];
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getViewSize : function() {
|
||||
if(typeof window.innerWidth === 'number') {
|
||||
return [window.innerWidth, window.innerHeight];
|
||||
} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
|
||||
return [document.body.clientWidth, document.body.clientHeight];
|
||||
} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
|
||||
return [document.documentElement.clientWidth, document.documentElement.clientHeight];
|
||||
} else {
|
||||
return [0, 0];
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
URI : function(uri) { // See RFC3986
|
||||
|
||||
this.scheme = null;
|
||||
this.authority = null;
|
||||
this.path = '';
|
||||
this.query = null;
|
||||
this.fragment = null;
|
||||
|
||||
this.parse = function(uri) {
|
||||
var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
|
||||
this.scheme = m[3] ? m[2] : null;
|
||||
this.authority = m[5] ? m[6] : null;
|
||||
this.path = m[7];
|
||||
this.query = m[9] ? m[10] : null;
|
||||
this.fragment = m[12] ? m[13] : null;
|
||||
return this;
|
||||
};
|
||||
|
||||
this.toString = function() {
|
||||
var result = '';
|
||||
if(this.scheme !== null) { result = result + this.scheme + ':'; }
|
||||
if(this.authority !== null) { result = result + '//' + this.authority; }
|
||||
if(this.path !== null) { result = result + this.path; }
|
||||
if(this.query !== null) { result = result + '?' + this.query; }
|
||||
if(this.fragment !== null) { result = result + '#' + this.fragment; }
|
||||
return result;
|
||||
};
|
||||
|
||||
this.toAbsolute = function(base) {
|
||||
var base = new jscolor.URI(base);
|
||||
var r = this;
|
||||
var t = new jscolor.URI;
|
||||
|
||||
if(base.scheme === null) { return false; }
|
||||
|
||||
if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) {
|
||||
r.scheme = null;
|
||||
}
|
||||
|
||||
if(r.scheme !== null) {
|
||||
t.scheme = r.scheme;
|
||||
t.authority = r.authority;
|
||||
t.path = removeDotSegments(r.path);
|
||||
t.query = r.query;
|
||||
} else {
|
||||
if(r.authority !== null) {
|
||||
t.authority = r.authority;
|
||||
t.path = removeDotSegments(r.path);
|
||||
t.query = r.query;
|
||||
} else {
|
||||
if(r.path === '') { // TODO: == or === ?
|
||||
t.path = base.path;
|
||||
if(r.query !== null) {
|
||||
t.query = r.query;
|
||||
} else {
|
||||
t.query = base.query;
|
||||
}
|
||||
} else {
|
||||
if(r.path.substr(0,1) === '/') {
|
||||
t.path = removeDotSegments(r.path);
|
||||
} else {
|
||||
if(base.authority !== null && base.path === '') { // TODO: == or === ?
|
||||
t.path = '/'+r.path;
|
||||
} else {
|
||||
t.path = base.path.replace(/[^\/]+$/,'')+r.path;
|
||||
}
|
||||
t.path = removeDotSegments(t.path);
|
||||
}
|
||||
t.query = r.query;
|
||||
}
|
||||
t.authority = base.authority;
|
||||
}
|
||||
t.scheme = base.scheme;
|
||||
}
|
||||
t.fragment = r.fragment;
|
||||
|
||||
return t;
|
||||
};
|
||||
|
||||
function removeDotSegments(path) {
|
||||
var out = '';
|
||||
while(path) {
|
||||
if(path.substr(0,3)==='../' || path.substr(0,2)==='./') {
|
||||
path = path.replace(/^\.+/,'').substr(1);
|
||||
} else if(path.substr(0,3)==='/./' || path==='/.') {
|
||||
path = '/'+path.substr(3);
|
||||
} else if(path.substr(0,4)==='/../' || path==='/..') {
|
||||
path = '/'+path.substr(4);
|
||||
out = out.replace(/\/?[^\/]*$/, '');
|
||||
} else if(path==='.' || path==='..') {
|
||||
path = '';
|
||||
} else {
|
||||
var rm = path.match(/^\/?[^\/]*/)[0];
|
||||
path = path.substr(rm.length);
|
||||
out = out + rm;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
if(uri) {
|
||||
this.parse(uri);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Usage example:
|
||||
* var myColor = new jscolor.color(myInputElement)
|
||||
*/
|
||||
|
||||
color : function(target, prop) {
|
||||
|
||||
|
||||
this.required = true; // refuse empty values?
|
||||
this.adjust = true; // adjust value to uniform notation?
|
||||
this.hash = false; // prefix color with # symbol?
|
||||
this.caps = true; // uppercase?
|
||||
this.valueElement = target; // value holder
|
||||
this.styleElement = target; // where to reflect current color
|
||||
this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1
|
||||
this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1
|
||||
|
||||
this.pickerOnfocus = true; // display picker on focus?
|
||||
this.pickerMode = 'HSV'; // HSV | HVS
|
||||
this.pickerPosition = 'bottom'; // left | right | top | bottom
|
||||
this.pickerFace = 10; // px
|
||||
this.pickerFaceColor = 'ThreeDFace'; // CSS color
|
||||
this.pickerBorder = 1; // px
|
||||
this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color
|
||||
this.pickerInset = 1; // px
|
||||
this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color
|
||||
this.pickerZIndex = 10000;
|
||||
|
||||
|
||||
for(var p in prop) {
|
||||
if(prop.hasOwnProperty(p)) {
|
||||
this[p] = prop[p];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.hidePicker = function() {
|
||||
if(isPickerOwner()) {
|
||||
removePicker();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.showPicker = function() {
|
||||
if(!isPickerOwner()) {
|
||||
var tp = jscolor.getElementPos(target); // target pos
|
||||
var ts = jscolor.getElementSize(target); // target size
|
||||
var vp = jscolor.getViewPos(); // view pos
|
||||
var vs = jscolor.getViewSize(); // view size
|
||||
var ps = [ // picker size
|
||||
2*this.pickerBorder + 4*this.pickerInset + 2*this.pickerFace + jscolor.images.pad[0] + 2*jscolor.images.arrow[0] + jscolor.images.sld[0],
|
||||
2*this.pickerBorder + 2*this.pickerInset + 2*this.pickerFace + jscolor.images.pad[1]
|
||||
];
|
||||
var a, b, c;
|
||||
switch(this.pickerPosition.toLowerCase()) {
|
||||
case 'left': a=1; b=0; c=-1; break;
|
||||
case 'right':a=1; b=0; c=1; break;
|
||||
case 'top': a=0; b=1; c=-1; break;
|
||||
default: a=0; b=1; c=1; break;
|
||||
}
|
||||
var l = (ts[b]+ps[b])/2;
|
||||
var pp = [ // picker pos
|
||||
-vp[a]+tp[a]+ps[a] > vs[a] ?
|
||||
(-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
|
||||
tp[a],
|
||||
-vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
|
||||
(-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
|
||||
(tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
|
||||
];
|
||||
drawPicker(pp[a], pp[b]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.importColor = function() {
|
||||
if(!valueElement) {
|
||||
this.exportColor();
|
||||
} else {
|
||||
if(!this.adjust) {
|
||||
if(!this.fromString(valueElement.value, leaveValue)) {
|
||||
styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
|
||||
styleElement.style.color = styleElement.jscStyle.color;
|
||||
this.exportColor(leaveValue | leaveStyle);
|
||||
}
|
||||
} else if(!this.required && /^\s*$/.test(valueElement.value)) {
|
||||
valueElement.value = '';
|
||||
styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
|
||||
styleElement.style.color = styleElement.jscStyle.color;
|
||||
this.exportColor(leaveValue | leaveStyle);
|
||||
|
||||
} else if(this.fromString(valueElement.value)) {
|
||||
// OK
|
||||
} else {
|
||||
this.exportColor();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.exportColor = function(flags) {
|
||||
if(!(flags & leaveValue) && valueElement) {
|
||||
var value = this.toString();
|
||||
if(this.caps) { value = value.toUpperCase(); }
|
||||
if(this.hash) { value = '#'+value; }
|
||||
valueElement.value = value;
|
||||
}
|
||||
if(!(flags & leaveStyle) && styleElement) {
|
||||
styleElement.style.backgroundColor =
|
||||
'#'+this.toString();
|
||||
styleElement.style.color =
|
||||
0.213 * this.rgb[0] +
|
||||
0.715 * this.rgb[1] +
|
||||
0.072 * this.rgb[2]
|
||||
< 0.5 ? '#FFF' : '#000';
|
||||
}
|
||||
if(!(flags & leavePad) && isPickerOwner()) {
|
||||
redrawPad();
|
||||
}
|
||||
if(!(flags & leaveSld) && isPickerOwner()) {
|
||||
redrawSld();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.fromHSV = function(h, s, v, flags) { // null = don't change
|
||||
h<0 && (h=0) || h>6 && (h=6);
|
||||
s<0 && (s=0) || s>1 && (s=1);
|
||||
v<0 && (v=0) || v>1 && (v=1);
|
||||
this.rgb = HSV_RGB(
|
||||
h===null ? this.hsv[0] : (this.hsv[0]=h),
|
||||
s===null ? this.hsv[1] : (this.hsv[1]=s),
|
||||
v===null ? this.hsv[2] : (this.hsv[2]=v)
|
||||
);
|
||||
this.exportColor(flags);
|
||||
};
|
||||
|
||||
|
||||
this.fromRGB = function(r, g, b, flags) { // null = don't change
|
||||
r<0 && (r=0) || r>1 && (r=1);
|
||||
g<0 && (g=0) || g>1 && (g=1);
|
||||
b<0 && (b=0) || b>1 && (b=1);
|
||||
var hsv = RGB_HSV(
|
||||
r===null ? this.rgb[0] : (this.rgb[0]=r),
|
||||
g===null ? this.rgb[1] : (this.rgb[1]=g),
|
||||
b===null ? this.rgb[2] : (this.rgb[2]=b)
|
||||
);
|
||||
if(hsv[0] !== null) {
|
||||
this.hsv[0] = hsv[0];
|
||||
}
|
||||
if(hsv[2] !== 0) {
|
||||
this.hsv[1] = hsv[1];
|
||||
}
|
||||
this.hsv[2] = hsv[2];
|
||||
this.exportColor(flags);
|
||||
};
|
||||
|
||||
|
||||
this.fromString = function(hex, flags) {
|
||||
var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
|
||||
if(!m) {
|
||||
return false;
|
||||
} else {
|
||||
if(m[1].length === 6) { // 6-char notation
|
||||
this.fromRGB(
|
||||
parseInt(m[1].substr(0,2),16) / 255,
|
||||
parseInt(m[1].substr(2,2),16) / 255,
|
||||
parseInt(m[1].substr(4,2),16) / 255,
|
||||
flags
|
||||
);
|
||||
} else { // 3-char notation
|
||||
this.fromRGB(
|
||||
parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255,
|
||||
parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255,
|
||||
parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255,
|
||||
flags
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.toString = function() {
|
||||
return (
|
||||
(0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) +
|
||||
(0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) +
|
||||
(0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
function RGB_HSV(r, g, b) {
|
||||
var n = Math.min(Math.min(r,g),b);
|
||||
var v = Math.max(Math.max(r,g),b);
|
||||
var m = v - n;
|
||||
if(m === 0) { return [ null, 0, v ]; }
|
||||
var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
|
||||
return [ h===6?0:h, m/v, v ];
|
||||
}
|
||||
|
||||
|
||||
function HSV_RGB(h, s, v) {
|
||||
if(h === null) { return [ v, v, v ]; }
|
||||
var i = Math.floor(h);
|
||||
var f = i%2 ? h-i : 1-(h-i);
|
||||
var m = v * (1 - s);
|
||||
var n = v * (1 - s*f);
|
||||
switch(i) {
|
||||
case 6:
|
||||
case 0: return [v,n,m];
|
||||
case 1: return [n,v,m];
|
||||
case 2: return [m,v,n];
|
||||
case 3: return [m,n,v];
|
||||
case 4: return [n,m,v];
|
||||
case 5: return [v,m,n];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function removePicker() {
|
||||
delete jscolor.picker.owner;
|
||||
document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB);
|
||||
}
|
||||
|
||||
|
||||
function drawPicker(x, y) {
|
||||
if(!jscolor.picker) {
|
||||
jscolor.picker = {
|
||||
box : document.createElement('div'),
|
||||
boxB : document.createElement('div'),
|
||||
pad : document.createElement('div'),
|
||||
padB : document.createElement('div'),
|
||||
padM : document.createElement('div'),
|
||||
sld : document.createElement('div'),
|
||||
sldB : document.createElement('div'),
|
||||
sldM : document.createElement('div')
|
||||
};
|
||||
for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) {
|
||||
var seg = document.createElement('div');
|
||||
seg.style.height = segSize+'px';
|
||||
seg.style.fontSize = '1px';
|
||||
seg.style.lineHeight = '0';
|
||||
jscolor.picker.sld.appendChild(seg);
|
||||
}
|
||||
jscolor.picker.sldB.appendChild(jscolor.picker.sld);
|
||||
jscolor.picker.box.appendChild(jscolor.picker.sldB);
|
||||
jscolor.picker.box.appendChild(jscolor.picker.sldM);
|
||||
jscolor.picker.padB.appendChild(jscolor.picker.pad);
|
||||
jscolor.picker.box.appendChild(jscolor.picker.padB);
|
||||
jscolor.picker.box.appendChild(jscolor.picker.padM);
|
||||
jscolor.picker.boxB.appendChild(jscolor.picker.box);
|
||||
}
|
||||
|
||||
var p = jscolor.picker;
|
||||
|
||||
// recompute controls positions
|
||||
posPad = [
|
||||
x+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset,
|
||||
y+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset ];
|
||||
posSld = [
|
||||
null,
|
||||
y+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset ];
|
||||
|
||||
// controls interaction
|
||||
p.box.onmouseup =
|
||||
p.box.onmouseout = function() { target.focus(); };
|
||||
p.box.onmousedown = function() { abortBlur=true; };
|
||||
p.box.onmousemove = function(e) { holdPad && setPad(e); holdSld && setSld(e); };
|
||||
p.padM.onmouseup =
|
||||
p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
|
||||
p.padM.onmousedown = function(e) { holdPad=true; setPad(e); };
|
||||
p.sldM.onmouseup =
|
||||
p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
|
||||
p.sldM.onmousedown = function(e) { holdSld=true; setSld(e); };
|
||||
|
||||
// picker
|
||||
p.box.style.width = 4*THIS.pickerInset + 2*THIS.pickerFace + jscolor.images.pad[0] + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] + 'px';
|
||||
p.box.style.height = 2*THIS.pickerInset + 2*THIS.pickerFace + jscolor.images.pad[1] + 'px';
|
||||
|
||||
// picker border
|
||||
p.boxB.style.position = 'absolute';
|
||||
p.boxB.style.clear = 'both';
|
||||
p.boxB.style.left = x+'px';
|
||||
p.boxB.style.top = y+'px';
|
||||
p.boxB.style.zIndex = THIS.pickerZIndex;
|
||||
p.boxB.style.border = THIS.pickerBorder+'px solid';
|
||||
p.boxB.style.borderColor = THIS.pickerBorderColor;
|
||||
p.boxB.style.background = THIS.pickerFaceColor;
|
||||
|
||||
// pad image
|
||||
p.pad.style.width = jscolor.images.pad[0]+'px';
|
||||
p.pad.style.height = jscolor.images.pad[1]+'px';
|
||||
|
||||
// pad border
|
||||
p.padB.style.position = 'absolute';
|
||||
p.padB.style.left = THIS.pickerFace+'px';
|
||||
p.padB.style.top = THIS.pickerFace+'px';
|
||||
p.padB.style.border = THIS.pickerInset+'px solid';
|
||||
p.padB.style.borderColor = THIS.pickerInsetColor;
|
||||
|
||||
// pad mouse area
|
||||
p.padM.style.position = 'absolute';
|
||||
p.padM.style.left = '0';
|
||||
p.padM.style.top = '0';
|
||||
p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px';
|
||||
p.padM.style.height = p.box.style.height;
|
||||
p.padM.style.cursor = 'crosshair';
|
||||
|
||||
// slider image
|
||||
p.sld.style.overflow = 'hidden';
|
||||
p.sld.style.width = jscolor.images.sld[0]+'px';
|
||||
p.sld.style.height = jscolor.images.sld[1]+'px';
|
||||
|
||||
// slider border
|
||||
p.sldB.style.position = 'absolute';
|
||||
p.sldB.style.right = THIS.pickerFace+'px';
|
||||
p.sldB.style.top = THIS.pickerFace+'px';
|
||||
p.sldB.style.border = THIS.pickerInset+'px solid';
|
||||
p.sldB.style.borderColor = THIS.pickerInsetColor;
|
||||
|
||||
// slider mouse area
|
||||
p.sldM.style.position = 'absolute';
|
||||
p.sldM.style.right = '0';
|
||||
p.sldM.style.top = '0';
|
||||
p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px';
|
||||
p.sldM.style.height = p.box.style.height;
|
||||
try {
|
||||
p.sldM.style.cursor = 'pointer';
|
||||
} catch(eOldIE) {
|
||||
p.sldM.style.cursor = 'hand';
|
||||
}
|
||||
|
||||
// load images in optimal order
|
||||
switch(modeID) {
|
||||
case 0: var padImg = 'hs.png'; break;
|
||||
case 1: var padImg = 'hv.png'; break;
|
||||
}
|
||||
p.padM.style.background = "url('"+jscolor.getDir()+"cross.gif') no-repeat";
|
||||
p.sldM.style.background = "url('"+jscolor.getDir()+"arrow.gif') no-repeat";
|
||||
p.pad.style.background = "url('"+jscolor.getDir()+padImg+"') 0 0 no-repeat";
|
||||
|
||||
// place pointers
|
||||
redrawPad();
|
||||
redrawSld();
|
||||
|
||||
jscolor.picker.owner = THIS;
|
||||
document.getElementsByTagName('body')[0].appendChild(p.boxB);
|
||||
}
|
||||
|
||||
|
||||
function redrawPad() {
|
||||
// redraw the pad pointer
|
||||
switch(modeID) {
|
||||
case 0: var yComponent = 1; break;
|
||||
case 1: var yComponent = 2; break;
|
||||
}
|
||||
var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1));
|
||||
var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
|
||||
jscolor.picker.padM.style.backgroundPosition =
|
||||
(THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
|
||||
(THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
|
||||
|
||||
// redraw the slider image
|
||||
var seg = jscolor.picker.sld.childNodes;
|
||||
|
||||
switch(modeID) {
|
||||
case 0:
|
||||
var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
|
||||
for(var i=0; i<seg.length; i+=1) {
|
||||
seg[i].style.backgroundColor = 'rgb('+
|
||||
(rgb[0]*(1-i/seg.length)*100)+'%,'+
|
||||
(rgb[1]*(1-i/seg.length)*100)+'%,'+
|
||||
(rgb[2]*(1-i/seg.length)*100)+'%)';
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
var rgb, s, c = [ THIS.hsv[2], 0, 0 ];
|
||||
var i = Math.floor(THIS.hsv[0]);
|
||||
var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i);
|
||||
switch(i) {
|
||||
case 6:
|
||||
case 0: rgb=[0,1,2]; break;
|
||||
case 1: rgb=[1,0,2]; break;
|
||||
case 2: rgb=[2,0,1]; break;
|
||||
case 3: rgb=[2,1,0]; break;
|
||||
case 4: rgb=[1,2,0]; break;
|
||||
case 5: rgb=[0,2,1]; break;
|
||||
}
|
||||
for(var i=0; i<seg.length; i+=1) {
|
||||
s = 1 - 1/(seg.length-1)*i;
|
||||
c[1] = c[0] * (1 - s*f);
|
||||
c[2] = c[0] * (1 - s);
|
||||
seg[i].style.backgroundColor = 'rgb('+
|
||||
(c[rgb[0]]*100)+'%,'+
|
||||
(c[rgb[1]]*100)+'%,'+
|
||||
(c[rgb[2]]*100)+'%)';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function redrawSld() {
|
||||
// redraw the slider pointer
|
||||
switch(modeID) {
|
||||
case 0: var yComponent = 2; break;
|
||||
case 1: var yComponent = 1; break;
|
||||
}
|
||||
var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
|
||||
jscolor.picker.sldM.style.backgroundPosition =
|
||||
'0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
|
||||
}
|
||||
|
||||
|
||||
function isPickerOwner() {
|
||||
return jscolor.picker && jscolor.picker.owner === THIS;
|
||||
}
|
||||
|
||||
|
||||
function blurTarget() {
|
||||
if(valueElement === target) {
|
||||
THIS.importColor();
|
||||
}
|
||||
if(THIS.pickerOnfocus) {
|
||||
THIS.hidePicker();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function blurValue() {
|
||||
if(valueElement !== target) {
|
||||
THIS.importColor();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function setPad(e) {
|
||||
var posM = jscolor.getMousePos(e);
|
||||
var x = posM[0]-posPad[0];
|
||||
var y = posM[1]-posPad[1];
|
||||
switch(modeID) {
|
||||
case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break;
|
||||
case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function setSld(e) {
|
||||
var posM = jscolor.getMousePos(e);
|
||||
var y = posM[1]-posPad[1];
|
||||
switch(modeID) {
|
||||
case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break;
|
||||
case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var THIS = this;
|
||||
var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0;
|
||||
var abortBlur = false;
|
||||
var
|
||||
valueElement = jscolor.fetchElement(this.valueElement),
|
||||
styleElement = jscolor.fetchElement(this.styleElement);
|
||||
var
|
||||
holdPad = false,
|
||||
holdSld = false;
|
||||
var
|
||||
posPad,
|
||||
posSld;
|
||||
var
|
||||
leaveValue = 1<<0,
|
||||
leaveStyle = 1<<1,
|
||||
leavePad = 1<<2,
|
||||
leaveSld = 1<<3;
|
||||
|
||||
// target
|
||||
jscolor.addEvent(target, 'focus', function() {
|
||||
if(THIS.pickerOnfocus) { THIS.showPicker(); }
|
||||
});
|
||||
jscolor.addEvent(target, 'blur', function() {
|
||||
if(!abortBlur) {
|
||||
window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0);
|
||||
} else {
|
||||
abortBlur = false;
|
||||
}
|
||||
});
|
||||
|
||||
// valueElement
|
||||
if(valueElement) {
|
||||
var updateField = function() {
|
||||
THIS.fromString(valueElement.value, leaveValue);
|
||||
};
|
||||
jscolor.addEvent(valueElement, 'keyup', updateField);
|
||||
jscolor.addEvent(valueElement, 'input', updateField);
|
||||
jscolor.addEvent(valueElement, 'blur', blurValue);
|
||||
valueElement.setAttribute('autocomplete', 'off');
|
||||
}
|
||||
|
||||
// styleElement
|
||||
if(styleElement) {
|
||||
styleElement.jscStyle = {
|
||||
backgroundColor : styleElement.style.backgroundColor,
|
||||
color : styleElement.style.color
|
||||
};
|
||||
}
|
||||
|
||||
// require images
|
||||
switch(modeID) {
|
||||
case 0: jscolor.requireImage('hs.png'); break;
|
||||
case 1: jscolor.requireImage('hv.png'); break;
|
||||
}
|
||||
jscolor.requireImage('cross.gif');
|
||||
jscolor.requireImage('arrow.gif');
|
||||
|
||||
this.importColor();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
jscolor.install();
|
||||
+10
-1
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
// Artemy Tregubenko (arty.name) for cleanup and help in updating to latest ver of proto-aculous.
|
||||
//
|
||||
// -----------------------------------------------------------------------------------
|
||||
var Lightbox=Class.create();Lightbox.prototype={imageArray:[],activeImage:undefined,initialize:function(){this.updateImageList();this.keyboardAction=this.keyboardAction.bindAsEventListener(this);if(LightboxOptions.resizeSpeed>10)LightboxOptions.resizeSpeed=10;if(LightboxOptions.resizeSpeed<1)LightboxOptions.resizeSpeed=1;this.resizeDuration=LightboxOptions.animate?((11-LightboxOptions.resizeSpeed)*0.15):0;this.overlayDuration=LightboxOptions.animate?0.2:0;var size=(LightboxOptions.animate?250:1)+'px';var objBody=$$('body')[0];objBody.appendChild(Builder.node('div',{id:'overlay'}));objBody.appendChild(Builder.node('div',{id:'lightbox'},[Builder.node('div',{id:'outerImageContainer'},Builder.node('div',{id:'imageContainer'},[Builder.node('img',{id:'lightboxImage'}),Builder.node('div',{id:'hoverNav'},[Builder.node('a',{id:'prevLink',href:'#'}),Builder.node('a',{id:'nextLink',href:'#'})]),Builder.node('div',{id:'loading'},Builder.node('a',{id:'loadingLink',href:'#'},Builder.node('img',{src:LightboxOptions.fileLoadingImage})))])),Builder.node('div',{id:'imageDataContainer'},Builder.node('div',{id:'imageData'},[Builder.node('div',{id:'imageDetails'},[Builder.node('span',{id:'caption'}),Builder.node('span',{id:'numberDisplay'})]),Builder.node('div',{id:'bottomNav'},Builder.node('a',{id:'bottomNavClose',href:'#'},Builder.node('img',{src:LightboxOptions.fileBottomNavCloseImage})))]))]));$('overlay').hide().observe('click',(function(){this.end();}).bind(this));$('lightbox').hide().observe('click',(function(event){if(event.element().id=='lightbox')this.end();}).bind(this));$('outerImageContainer').setStyle({width:size,height:size});$('prevLink').observe('click',(function(event){event.stop();this.changeImage(this.activeImage-1);}).bindAsEventListener(this));$('nextLink').observe('click',(function(event){event.stop();this.changeImage(this.activeImage+1);}).bindAsEventListener(this));$('loadingLink').observe('click',(function(event){event.stop();this.end();}).bind(this));$('bottomNavClose').observe('click',(function(event){event.stop();this.end();}).bind(this));var th=this;(function(){var ids='overlay lightbox outerImageContainer imageContainer lightboxImage hoverNav prevLink nextLink loading loadingLink '+'imageDataContainer imageData imageDetails caption numberDisplay bottomNav bottomNavClose';$w(ids).each(function(id){th[id]=$(id);});}).defer();},updateImageList:function(){this.updateImageList=Prototype.emptyFunction;document.observe('click',(function(event){var target=event.findElement('a[rel^=lightbox]')||event.findElement('area[rel^=lightbox]');if(target){event.stop();this.start(target);}}).bind(this));},start:function(imageLink){$$('select','object','embed').each(function(node){node.style.visibility='hidden'});var arrayPageSize=this.getPageSize();$('overlay').setStyle({width:arrayPageSize[0]+'px',height:arrayPageSize[1]+'px'});new Effect.Appear(this.overlay,{duration:this.overlayDuration,from:0.0,to:LightboxOptions.overlayOpacity});this.imageArray=[];var imageNum=0;if((imageLink.rel=='lightbox')){this.imageArray.push([imageLink.href,imageLink.title]);}else{this.imageArray=$$(imageLink.tagName+'[href][rel="'+imageLink.rel+'"]').collect(function(anchor){return[anchor.href,anchor.title];}).uniq();while(this.imageArray[imageNum][0]!=imageLink.href){imageNum++;}}
|
||||
var Lightbox=Class.create();Lightbox.prototype={imageArray:[],activeImage:undefined,initialize:function(){this.updateImageList();this.keyboardAction=this.keyboardAction.bindAsEventListener(this);if(LightboxOptions.resizeSpeed>10)LightboxOptions.resizeSpeed=10;if(LightboxOptions.resizeSpeed<1)LightboxOptions.resizeSpeed=1;this.resizeDuration=LightboxOptions.animate?((11-LightboxOptions.resizeSpeed)*0.15):0;this.overlayDuration=LightboxOptions.animate?0.2:0;var size=(LightboxOptions.animate?250:1)+'px';var objBody=$$('body')[0];objBody.appendChild(Builder.node('div',{id:'overlay'}));objBody.appendChild(Builder.node('div',{id:'lightbox'},[Builder.node('div',{id:'outerImageContainer'},Builder.node('div',{id:'imageContainer'},[Builder.node('img',{id:'lightboxImage'}),Builder.node('div',{id:'hoverNav'},[Builder.node('a',{id:'prevLink',href:'#'}),Builder.node('a',{id:'nextLink',href:'#'})]),Builder.node('div',{id:'loading'},Builder.node('a',{id:'loadingLink',href:'#'},Builder.node('img',{src:LightboxOptions.fileLoadingImage})))])),Builder.node('div',{id:'imageDataContainer'},Builder.node('div',{id:'imageData'},[Builder.node('div',{id:'imageDetails'},[Builder.node('span',{id:'caption'}),Builder.node('span',{id:'numberDisplay'})]),Builder.node('div',{id:'bottomNav'},Builder.node('a',{id:'bottomNavClose',href:'#'},Builder.node('img',{src:LightboxOptions.fileBottomNavCloseImage})))]))]));$('overlay').hide().observe('click',(function(){this.end();}).bind(this));$('lightbox').hide().observe('click',(function(event){if(event.element().id=='lightbox')this.end();}).bind(this));$('outerImageContainer').setStyle({width:size,height:size});$('prevLink').observe('click',(function(event){event.stop();this.changeImage(this.activeImage-1);}).bindAsEventListener(this));$('nextLink').observe('click',(function(event){event.stop();this.changeImage(this.activeImage+1);}).bindAsEventListener(this));$('loadingLink').observe('click',(function(event){event.stop();this.end();}).bind(this));$('bottomNavClose').observe('click',(function(event){event.stop();this.end();}).bind(this));var th=this;(function(){var ids='overlay lightbox outerImageContainer imageContainer lightboxImage hoverNav prevLink nextLink loading loadingLink '+'imageDataContainer imageData imageDetails caption numberDisplay bottomNav bottomNavClose';$w(ids).each(function(id){th[id]=$(id);});}).defer();},updateImageList:function(){this.updateImageList=Prototype.emptyFunction;document.observe('click',(function(event){var target=event.findElement('a[rel*="lightbox"]')||event.findElement('area[rel*="lightbox"]');if(target){event.stop();this.start(target);}}).bind(this));},start:function(imageLink){$$('select','object','embed').each(function(node){node.style.visibility='hidden'});var arrayPageSize=this.getPageSize();$('overlay').setStyle({width:arrayPageSize[0]+'px',height:arrayPageSize[1]+'px'});new Effect.Appear(this.overlay,{duration:this.overlayDuration,from:0.0,to:LightboxOptions.overlayOpacity});this.imageArray=[];var imageNum=0;if((imageLink.rel=='lightbox')){this.imageArray.push([imageLink.href,imageLink.title]);}else{this.imageArray=$$(imageLink.tagName+'[href][rel="'+imageLink.rel+'"]').collect(function(anchor){return[anchor.href,anchor.title];}).uniq();while(this.imageArray[imageNum][0]!=imageLink.href){imageNum++;}}
|
||||
var arrayPageScroll=document.viewport.getScrollOffsets();var lightboxTop=arrayPageScroll[1]+(document.viewport.getHeight()/10);var lightboxLeft=arrayPageScroll[0];this.lightbox.setStyle({top:lightboxTop+'px',left:lightboxLeft+'px'}).show();this.changeImage(imageNum);},changeImage:function(imageNum){this.activeImage=imageNum;if(LightboxOptions.animate)this.loading.show();this.lightboxImage.hide();this.hoverNav.hide();this.prevLink.hide();this.nextLink.hide();this.imageDataContainer.setStyle({opacity:.0001});this.numberDisplay.hide();var imgPreloader=new Image();imgPreloader.onload=(function(){this.lightboxImage.src=this.imageArray[this.activeImage][0];this.resizeImageContainer(imgPreloader.width,imgPreloader.height);}).bind(this);imgPreloader.src=this.imageArray[this.activeImage][0];},resizeImageContainer:function(imgWidth,imgHeight){var widthCurrent=this.outerImageContainer.getWidth();var heightCurrent=this.outerImageContainer.getHeight();var widthNew=(imgWidth+LightboxOptions.borderSize*2);var heightNew=(imgHeight+LightboxOptions.borderSize*2);var xScale=(widthNew/widthCurrent)*100;var yScale=(heightNew/heightCurrent)*100;var wDiff=widthCurrent-widthNew;var hDiff=heightCurrent-heightNew;if(hDiff!=0)new Effect.Scale(this.outerImageContainer,yScale,{scaleX:false,duration:this.resizeDuration,queue:'front'});if(wDiff!=0)new Effect.Scale(this.outerImageContainer,xScale,{scaleY:false,duration:this.resizeDuration,delay:this.resizeDuration});var timeout=0;if((hDiff==0)&&(wDiff==0)){timeout=100;if(Prototype.Browser.IE)timeout=250;}
|
||||
(function(){this.prevLink.setStyle({height:imgHeight+'px'});this.nextLink.setStyle({height:imgHeight+'px'});this.imageDataContainer.setStyle({width:widthNew+'px'});this.showImage();}).bind(this).delay(timeout/1000);},showImage:function(){this.loading.hide();new Effect.Appear(this.lightboxImage,{duration:this.resizeDuration,queue:'end',afterFinish:(function(){this.updateDetails();}).bind(this)});this.preloadNeighborImages();},updateDetails:function(){if(this.imageArray[this.activeImage][1]!=""){this.caption.update(this.imageArray[this.activeImage][1]).show();}
|
||||
if(this.imageArray.length>1){this.numberDisplay.update(LightboxOptions.labelImage+' '+(this.activeImage+1)+' '+LightboxOptions.labelOf+' '+this.imageArray.length).show();}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null,' \r\n']],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],['lang-css-str',/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],['lang-css-kw',/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:<!--|-->)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),['css']),PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),['css-kw']),PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),['css-str'])
|
||||
+1
-57
@@ -1,57 +1 @@
|
||||
// Copyright (C) 2008 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for SQL.
|
||||
*
|
||||
*
|
||||
* To use, include prettify.js and this file in your HTML page.
|
||||
* Then put your code in an HTML tag like
|
||||
* <pre class="prettyprint lang-sql">(my SQL code)</pre>
|
||||
*
|
||||
*
|
||||
* http://savage.net.au/SQL/sql-99.bnf.html is the basis for the grammar, and
|
||||
* http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx as the basis
|
||||
* for the keyword list.
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
||||
// A double or single quoted, possibly multi-line, string.
|
||||
[PR.PR_STRING, /^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/, null,
|
||||
'"\'']
|
||||
],
|
||||
[
|
||||
// A comment is either a line comment that starts with two dashes, or
|
||||
// two dashes preceding a long bracketed block.
|
||||
[PR.PR_COMMENT, /^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],
|
||||
[PR.PR_KEYWORD, /^(?:ADD|ALL|ALTER|AND|ANY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|NATIONAL|NOCHECK|NONCLUSTERED|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PERCENT|PLAN|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNION|UNIQUE|UPDATE|UPDATETEXT|USE|USER|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WRITETEXT)(?=[^\w-]|$)/i, null],
|
||||
// A number is a hex integer literal, a decimal real literal, or in
|
||||
// scientific notation.
|
||||
[PR.PR_LITERAL,
|
||||
/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],
|
||||
// An identifier
|
||||
[PR.PR_PLAIN, /^[a-z_][\w-]*/i],
|
||||
// A run of punctuation
|
||||
[PR.PR_PUNCTUATION, /^[^\w\t\n\r \xA0]+/]
|
||||
]),
|
||||
['sql']);
|
||||
PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[\t\n\r \xA0]+/,null,' \n\r \xa0'],[PR.PR_STRING,/^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/,null,'\"\'']],[[PR.PR_COMMENT,/^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],[PR.PR_KEYWORD,/^(?:ADD|ALL|ALTER|AND|ANY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|NATIONAL|NOCHECK|NONCLUSTERED|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PERCENT|PLAN|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNION|UNIQUE|UPDATE|UPDATETEXT|USE|USER|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WRITETEXT)(?=[^\w-]|$)/i,null],[PR.PR_LITERAL,/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],[PR.PR_PLAIN,/^[a-z_][\w-]*/i],[PR.PR_PUNCTUATION,/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]]),['sql'])
|
||||
+46
-48
@@ -1,48 +1,46 @@
|
||||
// Copyright (C) 2006 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
(function(){
|
||||
var o=true,r=null,z=false;window.PR_SHOULD_USE_CONTINUATION=o;window.PR_TAB_WIDTH=8;window.PR_normalizedHtml=window.PR=window.prettyPrintOne=window.prettyPrint=void 0;window._pr_isIE6=function(){var N=navigator&&navigator.userAgent&&/\bMSIE 6\./.test(navigator.userAgent);window._pr_isIE6=function(){return N};return N};
|
||||
var aa="!",ba="!=",ca="!==",F="#",da="%",ea="%=",G="&",fa="&&",ja="&&=",ka="&=",H="(",la="*",ma="*=",na="+=",oa=",",pa="-=",qa="->",ra="/",sa="/=",ta=":",ua="::",va=";",I="<",wa="<<",xa="<<=",ya="<=",za="=",Aa="==",Ba="===",J=">",Ca=">=",Da=">>",Ea=">>=",Fa=">>>",Ga=">>>=",Ha="?",Ia="@",L="[",M="^",Ta="^=",Ua="^^",Va="^^=",Wa="{",O="|",Xa="|=",Ya="||",Za="||=",$a="~",ab="break",bb="case",cb="continue",db="delete",eb="do",fb="else",gb="finally",hb="instanceof",ib="return",jb="throw",kb="try",lb="typeof",
|
||||
mb="(?:^^|[+-]",nb="\\$1",ob=")\\s*",pb="&",qb="<",rb=">",sb=""",tb="&#",ub="x",vb="'",wb='"',xb=" ",yb="XMP",zb="</",Ab='="',P="",Q="\\",Bb="b",Cb="t",Db="n",Eb="v",Fb="f",Gb="r",Hb="u",Ib="0",Jb="1",Kb="2",Lb="3",Mb="4",Nb="5",Ob="6",Pb="7",Qb="\\x0",Rb="\\x",Sb="-",Tb="]",Ub="\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]",R="g",Vb="\\B",Wb="\\b",Xb="\\D",Yb="\\d",Zb="\\S",$b="\\s",ac="\\W",bc="\\w",cc="(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)",
|
||||
dc="(?:",ec=")",fc="gi",gc="PRE",hc='<!DOCTYPE foo PUBLIC "foo bar">\n<foo />',ic="\t",jc="\n",kc="[^<]+|<!--[\\s\\S]*?--\>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|</?[a-zA-Z][^>]*>|<",lc="nocode",mc=' $1="$2$3$4"',S="pln",nc="string",T="lang-",oc="src",U="str",pc="'\"",qc="'\"`",rc="\"'",V="com",sc="lang-regex",tc="(/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/)",uc="kwd",vc="^(?:",wc=")\\b",xc=" \r\n\t\u00a0",yc="lit",zc="typ",Ac="0123456789",Y="pun",Bc="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename typeof using virtual wchar_t where break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try debugger eval export function get null set undefined var with Infinity NaN caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END break continue do else for if return while case done elif esac eval fi function in local set then until ",
|
||||
Cc="</span>",Dc='<span class="',Ec='">',Fc="$1 ",Gc=" <br />",Hc="<br />",Ic="console",Jc="cannot override language handler %s",Kc="default-markup",Lc="default-code",Mc="dec",Z="lang-js",$="lang-css",Nc="lang-in.tag",Oc="htm",Pc="html",Qc="mxml",Rc="xhtml",Sc="xml",Tc="xsl",Uc=" \t\r\n",Vc="atv",Wc="tag",Xc="atn",Yc="lang-uq.val",Zc="in.tag",$c="uq.val",ad="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename typeof using virtual wchar_t where ",
|
||||
bd="c",cd="cc",dd="cpp",ed="cxx",fd="cyc",gd="m",hd="null true false",id="json",jd="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params partial readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ",
|
||||
kd="cs",ld="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ",md="java",nd="break continue do else for if return while case done elif esac eval fi function in local set then until ",
|
||||
od="bsh",pd="csh",qd="sh",rd="break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",sd="cv",td="py",ud="caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ",vd="perl",wd="pl",xd="pm",yd="break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",
|
||||
zd="rb",Ad="break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try debugger eval export function get null set undefined var with Infinity NaN ",Bd="js",Cd="regex",Dd="pre",Ed="code",Fd="xmp",Gd="prettyprint",Hd="class",Id="br",Jd="\r";
|
||||
(function(){var N=function(){for(var a=[aa,ba,ca,F,da,ea,G,fa,ja,ka,H,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,I,wa,xa,ya,za,Aa,Ba,J,Ca,Da,Ea,Fa,Ga,Ha,Ia,L,M,Ta,Ua,Va,Wa,O,Xa,Ya,Za,$a,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb],b=mb,c=0;c<a.length;++c)b+=O+a[c].replace(/([^=<>:&a-z])/g,nb);b+=ob;return b}(),Ja=/&/g,Ka=/</g,La=/>/g,Kd=/\"/g;function Ld(a){return a.replace(Ja,pb).replace(Ka,qb).replace(La,rb).replace(Kd,sb)}function ga(a){return a.replace(Ja,pb).replace(Ka,qb).replace(La,rb)}var Md=/</g,Nd=/>/g,
|
||||
Od=/'/g,Pd=/"/g,Qd=/&/g,Rd=/ /g;function Sd(a){var b=a.indexOf(G);if(b<0)return a;for(--b;(b=a.indexOf(tb,b+1))>=0;){var c=a.indexOf(va,b);if(c>=0){var d=a.substring(b+3,c),g=10;if(d&&d.charAt(0)===ub){d=d.substring(1);g=16}var i=parseInt(d,g);isNaN(i)||(a=a.substring(0,b)+String.fromCharCode(i)+a.substring(c+1))}}return a.replace(Md,I).replace(Nd,J).replace(Od,vb).replace(Pd,wb).replace(Qd,G).replace(Rd,xb)}function Ma(a){return yb===a.tagName}function W(a,b){switch(a.nodeType){case 1:var c=
|
||||
a.tagName.toLowerCase();b.push(I,c);for(var d=0;d<a.attributes.length;++d){var g=a.attributes[d];if(g.specified){b.push(xb);W(g,b)}}b.push(J);for(var i=a.firstChild;i;i=i.nextSibling)W(i,b);if(a.firstChild||!/^(?:br|link|img)$/.test(c))b.push(zb,c,J);break;case 2:b.push(a.name.toLowerCase(),Ab,Ld(a.value),wb);break;case 3:case 4:b.push(ga(a.nodeValue));break}}function Na(a){for(var b=0,c=z,d=z,g=0,i=a.length;g<i;++g){var m=a[g];if(m.ignoreCase)d=o;else if(/[a-z]/i.test(m.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,
|
||||
P))){c=o;d=z;break}}function l(j){if(j.charAt(0)!==Q)return j.charCodeAt(0);switch(j.charAt(1)){case Bb:return 8;case Cb:return 9;case Db:return 10;case Eb:return 11;case Fb:return 12;case Gb:return 13;case Hb:case ub:return parseInt(j.substring(2),16)||j.charCodeAt(1);case Ib:case Jb:case Kb:case Lb:case Mb:case Nb:case Ob:case Pb:return parseInt(j.substring(1),8);default:return j.charCodeAt(1)}}function n(j){if(j<32)return(j<16?Qb:Rb)+j.toString(16);var f=String.fromCharCode(j);if(f===Q||f===Sb||
|
||||
f===L||f===Tb)f=Q+f;return f}function q(j){for(var f=j.substring(1,j.length-1).match(new RegExp(Ub,R)),s=[],k=[],h=f[0]===M,e=h?1:0,p=f.length;e<p;++e){var t=f[e];switch(t){case Vb:case Wb:case Xb:case Yb:case Zb:case $b:case ac:case bc:s.push(t);continue}var u=l(t),x;if(e+2<p&&Sb===f[e+1]){x=l(f[e+2]);e+=2}else x=u;k.push([u,x]);if(!(x<65||u>122)){x<65||u>90||k.push([Math.max(65,u)|32,Math.min(x,90)|32]);x<97||u>122||k.push([Math.max(97,u)&-33,Math.min(x,122)&-33])}}k.sort(function(Oa,Pa){return Oa[0]-
|
||||
Pa[0]||Pa[1]-Oa[1]});var B=[],E=[NaN,NaN];for(e=0;e<k.length;++e){var A=k[e];if(A[0]<=E[1]+1)E[1]=Math.max(E[1],A[1]);else B.push(E=A)}var D=[L];h&&D.push(M);D.push.apply(D,s);for(e=0;e<B.length;++e){A=B[e];D.push(n(A[0]));if(A[1]>A[0]){A[1]+1>A[0]&&D.push(Sb);D.push(n(A[1]))}}D.push(Tb);return D.join(P)}function v(j){var f=j.source.match(new RegExp(cc,R)),s=f.length,k=[],h,e=0;for(h=0;e<s;++e){var p=f[e];if(p===H)++h;else if(Q===p.charAt(0)){var t=+p.substring(1);if(t&&t<=h)k[t]=-1}}for(e=1;e<k.length;++e)if(-1===
|
||||
k[e])k[e]=++b;for(h=e=0;e<s;++e){p=f[e];if(p===H){++h;if(k[h]===undefined)f[e]=dc}else if(Q===p.charAt(0))if((t=+p.substring(1))&&t<=h)f[e]=Q+k[h]}for(h=e=0;e<s;++e)if(M===f[e]&&M!==f[e+1])f[e]=P;if(j.ignoreCase&&c)for(e=0;e<s;++e){p=f[e];var u=p.charAt(0);if(p.length>=2&&u===L)f[e]=q(p);else if(u!==Q)f[e]=p.replace(/[a-zA-Z]/g,function(x){var B=x.charCodeAt(0);return L+String.fromCharCode(B&-33,B|32)+Tb})}return f.join(P)}var w=[];g=0;for(i=a.length;g<i;++g){m=a[g];if(m.global||m.multiline)throw new Error(P+
|
||||
m);w.push(dc+v(m)+ec)}return new RegExp(w.join(O),d?fc:R)}var ha=r;function Td(a){if(r===ha){var b=document.createElement(gc);b.appendChild(document.createTextNode(hc));ha=!/</.test(b.innerHTML)}if(ha){var c=a.innerHTML;if(Ma(a))c=ga(c);return c}for(var d=[],g=a.firstChild;g;g=g.nextSibling)W(g,d);return d.join(P)}function Ud(a){var b=0;return function(c){for(var d=r,g=0,i=0,m=c.length;i<m;++i){var l=c.charAt(i);switch(l){case ic:d||(d=[]);d.push(c.substring(g,i));var n=a-b%a;for(b+=n;n>=0;n-=" ".length)d.push(" ".substring(0,
|
||||
n));g=i+1;break;case jc:b=0;break;default:++b}}if(!d)return c;d.push(c.substring(g));return d.join(P)}}var Vd=new RegExp(kc,R),Wd=/^<\!--/,Xd=/^<\[CDATA\[/,Yd=/^<br\b/i,Qa=/^<(\/?)([a-zA-Z]+)/;function Zd(a){var b=a.match(Vd),c=[],d=0,g=[];if(b)for(var i=0,m=b.length;i<m;++i){var l=b[i];if(l.length>1&&l.charAt(0)===I){if(!Wd.test(l))if(Xd.test(l)){c.push(l.substring(9,l.length-3));d+=l.length-12}else if(Yd.test(l)){c.push(jc);++d}else if(l.indexOf(lc)>=0&&$d(l)){var n=l.match(Qa)[2],q=1,v;v=i+1;a:for(;v<
|
||||
m;++v){var w=b[v].match(Qa);if(w&&w[2]===n)if(w[1]===ra){if(--q===0)break a}else++q}if(v<m){g.push(d,b.slice(i,v+1).join(P));i=v}else g.push(d,l)}else g.push(d,l)}else{var j=Sd(l);c.push(j);d+=j.length}}return{source:c.join(P),tags:g}}function $d(a){return!!a.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,mc).match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)}function ia(a,b,c,d){if(b){var g={source:b,b:a};c(g);d.push.apply(d,g.c)}}function K(a,b){var c={},d;(function(){for(var m=a.concat(b),
|
||||
l=[],n={},q=0,v=m.length;q<v;++q){var w=m[q],j=w[3];if(j)for(var f=j.length;--f>=0;)c[j.charAt(f)]=w;var s=w[1],k=P+s;if(!n.hasOwnProperty(k)){l.push(s);n[k]=r}}l.push(/[\0-\uffff]/);d=Na(l)})();var g=b.length,i=function(m){for(var l=m.source,n=m.b,q=[n,S],v=0,w=l.match(d)||[],j={},f=0,s=w.length;f<s;++f){var k=w[f],h=j[k],e,p;if(typeof h===nc)p=z;else{var t=c[k.charAt(0)];if(t){e=k.match(t[1]);h=t[0]}else{for(var u=0;u<g;++u){t=b[u];if(e=k.match(t[1])){h=t[0];break}}e||(h=S)}if((p=h.length>=5&&T===
|
||||
h.substring(0,5))&&!(e&&e[1])){p=z;h=oc}p||(j[k]=h)}var x=v;v+=k.length;if(p){var B=e[1],E=k.indexOf(B),A=E+B.length,D=h.substring(5);ia(n+x,k.substring(0,E),i,q);ia(n+x+E,B,Ra(D,B),q);ia(n+x+A,k.substring(A),i,q)}else q.push(n+x,h)}m.c=q};return i}function C(a){var b=[],c=[];if(a.tripleQuotedStrings)b.push([U,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,r,pc]);
|
||||
else a.multiLineStrings?b.push([U,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,r,qc]):b.push([U,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,r,rc]);if(a.hashComments)a.cStyleComments?b.push([V,/^#(?:[^\r\n\/]|\/(?!\*)|\/\*[^\r\n]*?\*\/)*/,r,F]):b.push([V,/^#[^\r\n]*/,r,F]);if(a.cStyleComments){c.push([V,/^\/\/[^\r\n]*/,r]);c.push([V,/^\/\*[\s\S]*?(?:\*\/|$)/,r])}a.regexLiterals&&c.push([sc,new RegExp(M+N+tc)]);var d=
|
||||
a.keywords.replace(/^\s+|\s+$/g,P);d.length&&c.push([uc,new RegExp(vc+d.replace(/\s+/g,O)+wc),r]);b.push([S,/^\s+/,r,xc]);c.push([yc,/^@[a-z_$][a-z_$@0-9]*/i,r,Ia],[zc,/^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/,r],[S,/^[a-z_$][a-z_$@0-9]*/i,r],[yc,/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,r,Ac],[Y,/^.[^\s\w\.$@\'\"\`\/\#]*/,r]);return K(b,c)}var ae=C({keywords:Bc,hashComments:o,cStyleComments:o,multiLineStrings:o,regexLiterals:o});function be(a){var b=a.source,c=a.f,d=a.c,
|
||||
g=[],i=0,m=r,l=r,n=0,q=0,v=Ud(window.PR_TAB_WIDTH),w=/([\r\n ]) /g,j=/(^| ) /gm,f=/\r\n?|\n/g,s=/[ \r\n]$/,k=o;function h(p){if(p>i){if(m&&m!==l){g.push(Cc);m=r}if(!m&&l){m=l;g.push(Dc,m,Ec)}var t=ga(v(b.substring(i,p))).replace(k?j:w,Fc);k=s.test(t);var u=window._pr_isIE6()?Gc:Hc;g.push(t.replace(f,u));i=p}}for(;1;){var e;if(e=n<c.length?q<d.length?c[n]<=d[q]:o:z){h(c[n]);if(m){g.push(Cc);m=r}g.push(c[n+1]);n+=2}else if(q<d.length){h(d[q]);l=d[q+1];q+=2}else break}h(b.length);m&&g.push(Cc);a.a=g.join(P)}
|
||||
var X={};function y(a,b){for(var c=b.length;--c>=0;){var d=b[c];if(X.hasOwnProperty(d))Ic in window&&console.i(Jc,d);else X[d]=a}}function Ra(a,b){a&&X.hasOwnProperty(a)||(a=/^\s*</.test(b)?Kc:Lc);return X[a]}y(ae,[Lc]);y(K([],[[S,/^[^<?]+/],[Mc,/^<!\w[^>]*(?:>|$)/],[V,/^<\!--[\s\S]*?(?:-\->|$)/],[T,/^<\?([\s\S]+?)(?:\?>|$)/],[T,/^<%([\s\S]+?)(?:%>|$)/],[Y,/^(?:<[%?]|[%?]>)/],[T,/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],[Z,/^<script\b[^>]*>([\s\S]+?)<\/script\b[^>]*>/i],[$,/^<style\b[^>]*>([\s\S]+?)<\/style\b[^>]*>/i],
|
||||
[Nc,/^(<\/?[a-z][^<>]*>)/i]]),[Kc,Oc,Pc,Qc,Rc,Sc,Tc]);y(K([[S,/^[\s]+/,r,Uc],[Vc,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,r,rc]],[[Wc,/^^<\/?[a-z](?:[\w:-]*\w)?|\/?>$/],[Xc,/^(?!style\b|on)[a-z](?:[\w:-]*\w)?/],[Yc,/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[Y,/^[=<>\/]+/],[Z,/^on\w+\s*=\s*\"([^\"]+)\"/i],[Z,/^on\w+\s*=\s*\'([^\']+)\'/i],[Z,/^on\w+\s*=\s*([^\"\'>\s]+)/i],[$,/^sty\w+\s*=\s*\"([^\"]+)\"/i],[$,/^sty\w+\s*=\s*\'([^\']+)\'/i],[$,/^sty\w+\s*=\s*([^\"\'>\s]+)/i]]),[Zc]);y(K([],[[Vc,/^[\s\S]+/]]),
|
||||
[$c]);y(C({keywords:ad,hashComments:o,cStyleComments:o}),[bd,cd,dd,ed,fd,gd]);y(C({keywords:hd}),[id]);y(C({keywords:jd,hashComments:o,cStyleComments:o}),[kd]);y(C({keywords:ld,cStyleComments:o}),[md]);y(C({keywords:nd,hashComments:o,multiLineStrings:o}),[od,pd,qd]);y(C({keywords:rd,hashComments:o,multiLineStrings:o,tripleQuotedStrings:o}),[sd,td]);y(C({keywords:ud,hashComments:o,multiLineStrings:o,regexLiterals:o}),[vd,wd,xd]);y(C({keywords:yd,hashComments:o,multiLineStrings:o,regexLiterals:o}),
|
||||
[zd]);y(C({keywords:Ad,cStyleComments:o,regexLiterals:o}),[Bd]);y(K([],[[U,/^[\s\S]+/]]),[Cd]);function Sa(a){var b=a.e,c=a.d;a.a=b;try{var d=Zd(b),g=d.source;a.source=g;a.b=0;a.f=d.tags;Ra(c,g)(a);be(a)}catch(i){if(Ic in window){console.log(i);console.h()}}}function ce(a,b){var c={e:a,d:b};Sa(c);return c.a}function de(a){for(var b=window._pr_isIE6(),c=[document.getElementsByTagName(Dd),document.getElementsByTagName(Ed),document.getElementsByTagName(Fd)],d=[],g=0;g<c.length;++g)for(var i=0,m=c[g].length;i<
|
||||
m;++i)d.push(c[g][i]);c=r;var l=Date;l.now||(l={now:function(){return(new Date).getTime()}});var n=0,q;function v(){for(var j=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;n<d.length&&l.now()<j;n++){var f=d[n];if(f.className&&f.className.indexOf(Gd)>=0){var s=f.className.match(/\blang-(\w+)\b/);if(s)s=s[1];for(var k=z,h=f.parentNode;h;h=h.parentNode)if((h.tagName===Dd||h.tagName===Ed||h.tagName===Fd)&&h.className&&h.className.indexOf(Gd)>=0){k=o;break}if(!k){var e=Td(f);e=e.replace(/(?:\r\n?|\n)$/,
|
||||
P);q={e:e,d:s,g:f};Sa(q);w()}}}if(n<d.length)setTimeout(v,250);else a&&a()}function w(){var j=q.a;if(j){var f=q.g;if(Ma(f)){for(var s=document.createElement(gc),k=0;k<f.attributes.length;++k){var h=f.attributes[k];if(h.specified){var e=h.name.toLowerCase();if(e===Hd)s.className=h.value;else s.setAttribute(h.name,h.value)}}s.innerHTML=j;f.parentNode.replaceChild(s,f);f=s}else f.innerHTML=j;if(b&&f.tagName===gc)for(var p=f.getElementsByTagName(Id),t=p.length;--t>=0;){var u=p[t];u.parentNode.replaceChild(document.createTextNode(Jd),
|
||||
u)}}}v()}window.PR_normalizedHtml=W;window.prettyPrintOne=ce;window.prettyPrint=de;window.PR={combinePrefixPatterns:Na,createSimpleLexer:K,registerLangHandler:y,sourceDecorator:C,PR_ATTRIB_NAME:Xc,PR_ATTRIB_VALUE:Vc,PR_COMMENT:V,PR_DECLARATION:Mc,PR_KEYWORD:uc,PR_LITERAL:yc,PR_NOCODE:lc,PR_PLAIN:S,PR_PUNCTUATION:Y,PR_SOURCE:oc,PR_STRING:U,PR_TAG:Wc,PR_TYPE:zc}})();
|
||||
})()
|
||||
window.PR_SHOULD_USE_CONTINUATION=true,window.PR_TAB_WIDTH=8,window.PR_normalizedHtml=window.PR=window.prettyPrintOne=window.prettyPrint=void
|
||||
0,window._pr_isIE6=function(){var a=navigator&&navigator.userAgent&&navigator.userAgent.match(/\bMSIE ([678])\./);return a=a?+a[1]:false,window._pr_isIE6=function(){return a},a},(function(){var
|
||||
a=true,b=null,c='break continue do else for if return while auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile catch class delete false import new operator private protected public this throw true try typeof ',d=c+'alignof align_union asm axiom bool '+'concept concept_map const_cast constexpr decltype '+'dynamic_cast explicit export friend inline late_check '+'mutable namespace nullptr reinterpret_cast static_assert static_cast '+'template typeid typename using virtual wchar_t where ',e=c+'abstract boolean byte extends final finally implements import '+'instanceof null native package strictfp super synchronized throws '+'transient ',f=e+'as base by checked decimal delegate descending event '+'fixed foreach from group implicit in interface internal into is lock '+'object out override orderby params partial readonly ref sbyte sealed '+'stackalloc string select uint ulong unchecked unsafe ushort var ',g=c+'debugger eval export function get null set undefined var with '+'Infinity NaN ',h='caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ',i='break continue do else for if return while and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ',j='break continue do else for if return while alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ',k='break continue do else for if return while case done elif esac eval fi function in local set then until ',l=d+f+g+h+i+j+k,m=(function(){var
|
||||
a=['!','!=','!==','#','%','%=','&','&&','&&=','&=','(','*','*=','+=',',','-=','->','/','/=',':','::',';','<','<<','<<=','<=','=','==','===','>','>=','>>','>>=','>>>','>>>=','?','@','[','^','^=','^^','^^=','{','|','|=','||','||=','~','break','case','continue','delete','do','else','finally','instanceof','return','throw','try','typeof'],b='(?:^^|[+-]',c;for(c=0;c<a.length;++c)b+='|'+a[c].replace(/([^=<>:&a-z])/g,'\\$1');return b+=')\\s*',b})(),n=/&/g,o=/</g,p=/>/g,q=/\"/g,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F;function
|
||||
G(a){return a.replace(n,'&').replace(o,'<').replace(p,'>').replace(q,'"')}function
|
||||
H(a){return a.replace(n,'&').replace(o,'<').replace(p,'>')}C=/</g,B=/>/g,w=/'/g,E=/"/g,v=/&/g,D=/ /g;function
|
||||
I(a){var b=a.indexOf('&'),c,d,e,f;if(b<0)return a;for(--b;(b=a.indexOf('&#',b+1))>=0;)d=a.indexOf(';',b),d>=0&&(e=a.substring(b+3,d),f=10,e&&e.charAt(0)==='x'&&(e=e.substring(1),f=16),c=parseInt(e,f),isNaN(c)||(a=a.substring(0,b)+String.fromCharCode(c)+a.substring(d+1)));return a.replace(C,'<').replace(B,'>').replace(w,'\'').replace(E,'\"').replace(D,' ').replace(v,'&')}function
|
||||
J(a){return'XMP'===a.tagName}u=/[\r\n]/g;function K(c,d){var e;return'PRE'===c.tagName?a:u.test(d)?(e='',c.currentStyle?(e=c.currentStyle.whiteSpace):window.getComputedStyle&&(e=window.getComputedStyle(c,b).whiteSpace),!e||e==='pre'):a}function
|
||||
L(a,b){var c,d,e,f;switch(a.nodeType){case 1:f=a.tagName.toLowerCase(),b.push('<',f);for(e=0;e<a.attributes.length;++e){c=a.attributes[e];if(!c.specified)continue;b.push(' '),L(c,b)}b.push('>');for(d=a.firstChild;d;d=d.nextSibling)L(d,b);(a.firstChild||!/^(?:br|link|img)$/.test(f))&&b.push('</',f,'>');break;case
|
||||
2:b.push(a.name.toLowerCase(),'=\"',G(a.value),'\"');break;case 3:case 4:b.push(H(a.nodeValue))}}function
|
||||
M(b){var c=0,d=false,e=false,f,g,h,i;for(f=0,g=b.length;f<g;++f){h=b[f];if(h.ignoreCase)e=a;else
|
||||
if(/[a-z]/i.test(h.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,''))){d=a,e=false;break}}function
|
||||
j(a){if(a.charAt(0)!=='\\')return a.charCodeAt(0);switch(a.charAt(1)){case'b':return 8;case't':return 9;case'n':return 10;case'v':return 11;case'f':return 12;case'r':return 13;case'u':case'x':return parseInt(a.substring(2),16)||a.charCodeAt(1);case'0':case'1':case'2':case'3':case'4':case'5':case'6':case'7':return parseInt(a.substring(1),8);default:return a.charCodeAt(1)}}function
|
||||
k(a){var b;return a<32?(a<16?'\\x0':'\\x')+a.toString(16):(b=String.fromCharCode(a),(b==='\\'||b==='-'||b==='['||b===']')&&(b='\\'+b),b)}function
|
||||
l(a){var b=a.substring(1,a.length-1).match(new RegExp('\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]','g')),c=[],d=[],e=b[0]==='^',f,g,h,i,m,n,o,p,q;for(h=e?1:0,m=b.length;h<m;++h){o=b[h];switch(o){case'\\B':case'\\b':case'\\D':case'\\d':case'\\S':case'\\s':case'\\W':case'\\w':c.push(o);continue}q=j(o),h+2<m&&'-'===b[h+1]?(g=j(b[h+2]),h+=2):(g=q),d.push([q,g]),g<65||q>122||(g<65||q>90||d.push([Math.max(65,q)|32,Math.min(g,90)|32]),g<97||q>122||d.push([Math.max(97,q)&-33,Math.min(g,122)&-33]))}d.sort(function(a,b){return a[0]-b[0]||b[1]-a[1]}),f=[],i=[NaN,NaN];for(h=0;h<d.length;++h)p=d[h],p[0]<=i[1]+1?(i[1]=Math.max(i[1],p[1])):f.push(i=p);n=['['],e&&n.push('^'),n.push.apply(n,c);for(h=0;h<f.length;++h)p=f[h],n.push(k(p[0])),p[1]
|
||||
>p[0]&&(p[1]+1>p[0]&&n.push('-'),n.push(k(p[1])));return n.push(']'),n.join('')}function
|
||||
m(a){var b=a.source.match(new RegExp('(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)','g')),e=b.length,f=[],g,h,i,j,k;for(j=0,i=0;j<e;++j)k=b[j],k==='('?++i:'\\'===k.charAt(0)&&(h=+k.substring(1),h&&h<=i&&(f[h]=-1));for(j=1;j<f.length;++j)-1===f[j]&&(f[j]=++c);for(j=0,i=0;j<e;++j)k=b[j],k==='('?(++i,f[i]===void
|
||||
0&&(b[j]='(?:')):'\\'===k.charAt(0)&&(h=+k.substring(1),h&&h<=i&&(b[j]='\\'+f[i]));for(j=0,i=0;j<e;++j)'^'===b[j]&&'^'!==b[j+1]&&(b[j]='');if(a.ignoreCase&&d)for(j=0;j<e;++j)k=b[j],g=k.charAt(0),k.length>=2&&g==='['?(b[j]=l(k)):g!=='\\'&&(b[j]=k.replace(/[a-zA-Z]/g,function(a){var
|
||||
b=a.charCodeAt(0);return'['+String.fromCharCode(b&-33,b|32)+']'}));return b.join('')}i=[];for(f=0,g=b.length;f<g;++f){h=b[f];if(h.global||h.multiline)throw new
|
||||
Error(''+h);i.push('(?:'+m(h)+')')}return new RegExp(i.join('|'),e?'gi':'g')}r=b;function
|
||||
N(a){var c,d,e,f;b===r&&(f=document.createElement('PRE'),f.appendChild(document.createTextNode('<!DOCTYPE foo PUBLIC \"foo bar\">\n<foo />')),r=!/</.test(f.innerHTML));if(r)return d=a.innerHTML,J(a)?(d=H(d)):K(a,d)||(d=d.replace(/(<br\s*\/?>)[\r\n]+/g,'$1').replace(/(?:[\r\n]+[ \t]*)+/g,' ')),d;e=[];for(c=a.firstChild;c;c=c.nextSibling)L(c,e);return e.join('')}function
|
||||
O(a){var c=0;return function(d){var e=b,f=0,g,h,i,j;for(h=0,i=d.length;h<i;++h){g=d.charAt(h);switch(g){case' ':e||(e=[]),e.push(d.substring(f,h)),j=a-c%a,c+=j;for(;j>=0;j-=' '.length)e.push(' '.substring(0,j));f=h+1;break;case'\n':c=0;break;default:++c}}return e?(e.push(d.substring(f)),e.join('')):d}}z=new
|
||||
RegExp('[^<]+|<!--[\\s\\S]*?-->|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>|</?[a-zA-Z](?:[^>\"\']|\'[^\']*\'|\"[^\"]*\")*>|<','g'),A=/^<\!--/,y=/^<!\[CDATA\[/,x=/^<br\b/i,F=/^<(\/?)([a-zA-Z][a-zA-Z0-9]*)/;function
|
||||
P(a){var b=a.match(z),c=[],d=0,e=[],f,g,h,i,j,k,l,m;if(b)for(g=0,k=b.length;g<k;++g){j=b[g];if(j.length>1&&j.charAt(0)==='<'){if(A.test(j))continue;if(y.test(j))c.push(j.substring(9,j.length-3)),d+=j.length-12;else
|
||||
if(x.test(j))c.push('\n'),++d;else if(j.indexOf('nocode')>=0&&Q(j)){l=(j.match(F))[2],f=1;for(h=g+1;h<k;++h){m=b[h].match(F);if(m&&m[2]===l)if(m[1]==='/'){if(--f===0)break}else++f}h<k?(e.push(d,b.slice(g,h+1).join('')),g=h):e.push(d,j)}else
|
||||
e.push(d,j)}else i=I(j),c.push(i),d+=i.length}return{source:c.join(''),tags:e}}function
|
||||
Q(a){return!!a.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,' $1=\"$2$3$4\"').match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/)}function
|
||||
R(a,b,c,d){var e;if(!b)return;e={source:b,basePos:a},c(e),d.push.apply(d,e.decorations)}function
|
||||
S(a,c){var d={},e,f,g,h;return(function(){var e=a.concat(c),f=[],g={},i,j,k,l,m,n,o;for(j=0,l=e.length;j<l;++j){m=e[j],o=m[3];if(o)for(i=o.length;--i>=0;)d[o.charAt(i)]=m;n=m[1],k=''+n,g.hasOwnProperty(k)||(f.push(n),g[k]=b)}f.push(/[\0-\uffff]/),h=M(f)})(),f=c.length,g=/\S/,e=function(a){var
|
||||
b=a.source,g=a.basePos,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;i=[g,'pln'],s=0,y=b.match(h)||[],u={};for(v=0,q=y.length;v<q;++v){w=y[v],t=u[w],p=void
|
||||
0;if(typeof t==='string')n=false;else{r=d[w.charAt(0)];if(r)p=w.match(r[1]),t=r[0];else{for(m=0;m<f;++m){r=c[m],p=w.match(r[1]);if(p){t=r[0];break}}p||(t='pln')}n=t.length>=5&&'lang-'===t.substring(0,5),n&&!(p&&typeof
|
||||
p[1]==='string')&&(n=false,t='src'),n||(u[w]=t)}x=s,s+=w.length,n?(j=p[1],l=w.indexOf(j),k=l+j.length,p[2]&&(k=w.length-p[2].length,l=k-j.length),o=t.substring(5),R(g+x,w.substring(0,l),e,i),R(g+x+l,j,W(o,j),i),R(g+x+k,w.substring(k),e,i)):i.push(g+x,t)}a.decorations=i},e}function
|
||||
T(a){var c=[],d=[],e,f;return a.tripleQuotedStrings?c.push(['str',/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,b,'\'\"']):a.multiLineStrings?c.push(['str',/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,b,'\'\"`']):c.push(['str',/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,b,'\"\'']),a.verbatimStrings&&d.push(['str',/^@\"(?:[^\"]|\"\")*(?:\"|$)/,b]),a.hashComments&&(a.cStyleComments?(c.push(['com',/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,b,'#']),d.push(['str',/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,b])):c.push(['com',/^#[^\r\n]*/,b,'#'])),a.cStyleComments&&(d.push(['com',/^\/\/[^\r\n]*/,b]),d.push(['com',/^\/\*[\s\S]*?(?:\*\/|$)/,b])),a.regexLiterals&&(e='/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/',d.push(['lang-regex',new
|
||||
RegExp('^'+m+'('+e+')')])),f=a.keywords.replace(/^\s+|\s+$/g,''),f.length&&d.push(['kwd',new
|
||||
RegExp('^(?:'+f.replace(/\s+/g,'|')+')\\b'),b]),c.push(['pln',/^\s+/,b,' \r\n \xa0']),d.push(['lit',/^@[a-z_$][a-z_$@0-9]*/i,b],['typ',/^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/,b],['pln',/^[a-z_$][a-z_$@0-9]*/i,b],['lit',new
|
||||
RegExp('^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*','i'),b,'0123456789'],['pun',/^.[^\s\w\.$@\'\"\`\/\#]*/,b]),S(c,d)}s=T({keywords:l,hashComments:a,cStyleComments:a,multiLineStrings:a,regexLiterals:a});function
|
||||
U(c){var d=c.source,e=c.extractedTags,f=c.decorations,g=[],h=0,i=b,j=b,k=0,l=0,m=O(window.PR_TAB_WIDTH),n=/([\r\n ]) /g,o=/(^| ) /gm,p=/\r\n?|\n/g,q=/[ \r\n]$/,r=a,s;function
|
||||
t(a){var c,e;a>h&&(i&&i!==j&&(g.push('</span>'),i=b),!i&&j&&(i=j,g.push('<span class=\"',i,'\">')),c=H(m(d.substring(h,a))).replace(r?o:n,'$1 '),r=q.test(c),e=window._pr_isIE6()?' <br />':'<br />',g.push(c.replace(p,e)),h=a)}while(a){k<e.length?l<f.length?(s=e[k]<=f[l]):(s=a):(s=false);if(s)t(e[k]),i&&(g.push('</span>'),i=b),g.push(e[k+1]),k+=2;else
|
||||
if(l<f.length)t(f[l]),j=f[l+1],l+=2;else break}t(d.length),i&&g.push('</span>'),c.prettyPrintedHtml=g.join('')}t={};function
|
||||
V(a,b){var c,d;for(d=b.length;--d>=0;)c=b[d],t.hasOwnProperty(c)?'console'in window&&console.warn('cannot override language handler %s',c):(t[c]=a)}function
|
||||
W(a,b){return a&&t.hasOwnProperty(a)||(a=/^\s*</.test(b)?'default-markup':'default-code'),t[a]}V(s,['default-code']),V(S([],[['pln',/^[^<?]+/],['dec',/^<!\w[^>]*(?:>|$)/],['com',/^<\!--[\s\S]*?(?:-\->|$)/],['lang-',/^<\?([\s\S]+?)(?:\?>|$)/],['lang-',/^<%([\s\S]+?)(?:%>|$)/],['pun',/^(?:<[%?]|[%?]>)/],['lang-',/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],['lang-js',/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],['lang-css',/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],['lang-in.tag',/^(<\/?[a-z][^<>]*>)/i]]),['default-markup','htm','html','mxml','xhtml','xml','xsl']),V(S([['pln',/^[\s]+/,b,' \r\n'],['atv',/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,b,'\"\'']],[['tag',/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],['atn',/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],['lang-uq.val',/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],['pun',/^[=<>\/]+/],['lang-js',/^on\w+\s*=\s*\"([^\"]+)\"/i],['lang-js',/^on\w+\s*=\s*\'([^\']+)\'/i],['lang-js',/^on\w+\s*=\s*([^\"\'>\s]+)/i],['lang-css',/^style\s*=\s*\"([^\"]+)\"/i],['lang-css',/^style\s*=\s*\'([^\']+)\'/i],['lang-css',/^style\s*=\s*([^\"\'>\s]+)/i]]),['in.tag']),V(S([],[['atv',/^[\s\S]+/]]),['uq.val']),V(T({keywords:d,hashComments:a,cStyleComments:a}),['c','cc','cpp','cxx','cyc','m']),V(T({keywords:'null true false'}),['json']),V(T({keywords:f,hashComments:a,cStyleComments:a,verbatimStrings:a}),['cs']),V(T({keywords:e,cStyleComments:a}),['java']),V(T({keywords:k,hashComments:a,multiLineStrings:a}),['bsh','csh','sh']),V(T({keywords:i,hashComments:a,multiLineStrings:a,tripleQuotedStrings:a}),['cv','py']),V(T({keywords:h,hashComments:a,multiLineStrings:a,regexLiterals:a}),['perl','pl','pm']),V(T({keywords:j,hashComments:a,multiLineStrings:a,regexLiterals:a}),['rb']),V(T({keywords:g,cStyleComments:a,regexLiterals:a}),['js']),V(S([],[['str',/^[\s\S]+/]]),['regex']);function
|
||||
X(a){var b=a.sourceCodeHtml,c=a.langExtension,d,e;a.prettyPrintedHtml=b;try{e=P(b),d=e.source,a.source=d,a.basePos=0,a.extractedTags=e.tags,W(c,d)(a),U(a)}catch(f){'console'in
|
||||
window&&(console.log(f),console.trace())}}function Y(a,b){var c={sourceCodeHtml:a,langExtension:b};return X(c),c.prettyPrintedHtml}function
|
||||
Z(c){var d=window._pr_isIE6(),e=d===6?'\r\n':'\r',f=[document.getElementsByTagName('pre'),document.getElementsByTagName('code'),document.getElementsByTagName('xmp')],g=[],h,i,j,k,l,m;for(i=0;i<f.length;++i)for(j=0,l=f[i].length;j<l;++j)g.push(f[i][j]);f=b,h=Date,h.now||(h={now:function(){return(new
|
||||
Date).getTime()}}),k=0;function n(){var b=window.PR_SHOULD_USE_CONTINUATION?h.now()+250:Infinity,d,e,f,i,j;for(;k<g.length&&h.now()<b;++k){e=g[k];if(e.className&&e.className.indexOf('prettyprint')>=0){f=e.className.match(/\blang-(\w+)\b/),f&&(f=f[1]),i=false;for(j=e.parentNode;j;j=j.parentNode)if((j.tagName==='pre'||j.tagName==='code'||j.tagName==='xmp')&&j.className&&j.className.indexOf('prettyprint')>=0){i=a;break}i||(d=N(e),d=d.replace(/(?:\r\n?|\n)$/,''),m={sourceCodeHtml:d,langExtension:f,sourceNode:e},X(m),o())}}k<g.length?setTimeout(n,250):c&&c()}function
|
||||
o(){var a=m.prettyPrintedHtml,b,c,f,g,h,i,j,k;if(!a)return;f=m.sourceNode;if(!J(f))f.innerHTML=a;else{k=document.createElement('PRE');for(g=0;g<f.attributes.length;++g)b=f.attributes[g],b.specified&&(c=b.name.toLowerCase(),c==='class'?(k.className=b.value):k.setAttribute(b.name,b.value));k.innerHTML=a,f.parentNode.replaceChild(k,f),f=k}if(d&&f.tagName==='PRE'){j=f.getElementsByTagName('br');for(h=j.length;--h>=0;)i=j[h],i.parentNode.replaceChild(document.createTextNode(e),i)}}n()}window.PR_normalizedHtml=L,window.prettyPrintOne=Y,window.prettyPrint=Z,window.PR={combinePrefixPatterns:M,createSimpleLexer:S,registerLangHandler:V,sourceDecorator:T,PR_ATTRIB_NAME:'atn',PR_ATTRIB_VALUE:'atv',PR_COMMENT:'com',PR_DECLARATION:'dec',PR_KEYWORD:'kwd',PR_LITERAL:'lit',PR_NOCODE:'nocode',PR_PLAIN:'pln',PR_PUNCTUATION:'pun',PR_SOURCE:'src',PR_STRING:'str',PR_TAG:'tag',PR_TYPE:'typ'}})()
|
||||
+10
-1
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+2304
-2304
File diff suppressed because it is too large.
Load diff
+10
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SWFObject v2.0 rc4 <http://code.google.com/p/swfobject/>
|
||||
Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
||||
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
/* SWFObject v2.0 rc4 <http://code.google.com/p/swfobject/>
|
||||
Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
||||
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,53 +1,53 @@
|
||||
/*
|
||||
Cookie Plug-in
|
||||
|
||||
This plug in automatically gets all the cookies for this site and adds them to the post_params.
|
||||
Cookies are loaded only on initialization. The refreshCookies function can be called to update the post_params.
|
||||
The cookies will override any other post params with the same name.
|
||||
*/
|
||||
|
||||
var SWFUpload;
|
||||
if (typeof(SWFUpload) === "function") {
|
||||
SWFUpload.prototype.initSettings = function (oldInitSettings) {
|
||||
return function () {
|
||||
if (typeof(oldInitSettings) === "function") {
|
||||
oldInitSettings.call(this);
|
||||
}
|
||||
|
||||
this.refreshCookies(false); // The false parameter must be sent since SWFUpload has not initialzed at this point
|
||||
};
|
||||
}(SWFUpload.prototype.initSettings);
|
||||
|
||||
// refreshes the post_params and updates SWFUpload. The sendToFlash parameters is optional and defaults to True
|
||||
SWFUpload.prototype.refreshCookies = function (sendToFlash) {
|
||||
if (sendToFlash === undefined) {
|
||||
sendToFlash = true;
|
||||
}
|
||||
sendToFlash = !!sendToFlash;
|
||||
|
||||
// Get the post_params object
|
||||
var postParams = this.settings.post_params;
|
||||
|
||||
// Get the cookies
|
||||
var i, cookieArray = document.cookie.split(';'), caLength = cookieArray.length, c, eqIndex, name, value;
|
||||
for (i = 0; i < caLength; i++) {
|
||||
c = cookieArray[i];
|
||||
|
||||
// Left Trim spaces
|
||||
while (c.charAt(0) === " ") {
|
||||
c = c.substring(1, c.length);
|
||||
}
|
||||
eqIndex = c.indexOf("=");
|
||||
if (eqIndex > 0) {
|
||||
name = c.substring(0, eqIndex);
|
||||
value = c.substring(eqIndex + 1);
|
||||
postParams[name] = value;
|
||||
}
|
||||
}
|
||||
|
||||
if (sendToFlash) {
|
||||
this.setPostParams(postParams);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
/*
|
||||
Cookie Plug-in
|
||||
|
||||
This plug in automatically gets all the cookies for this site and adds them to the post_params.
|
||||
Cookies are loaded only on initialization. The refreshCookies function can be called to update the post_params.
|
||||
The cookies will override any other post params with the same name.
|
||||
*/
|
||||
|
||||
var SWFUpload;
|
||||
if (typeof(SWFUpload) === "function") {
|
||||
SWFUpload.prototype.initSettings = function (oldInitSettings) {
|
||||
return function () {
|
||||
if (typeof(oldInitSettings) === "function") {
|
||||
oldInitSettings.call(this);
|
||||
}
|
||||
|
||||
this.refreshCookies(false); // The false parameter must be sent since SWFUpload has not initialzed at this point
|
||||
};
|
||||
}(SWFUpload.prototype.initSettings);
|
||||
|
||||
// refreshes the post_params and updates SWFUpload. The sendToFlash parameters is optional and defaults to True
|
||||
SWFUpload.prototype.refreshCookies = function (sendToFlash) {
|
||||
if (sendToFlash === undefined) {
|
||||
sendToFlash = true;
|
||||
}
|
||||
sendToFlash = !!sendToFlash;
|
||||
|
||||
// Get the post_params object
|
||||
var postParams = this.settings.post_params;
|
||||
|
||||
// Get the cookies
|
||||
var i, cookieArray = document.cookie.split(';'), caLength = cookieArray.length, c, eqIndex, name, value;
|
||||
for (i = 0; i < caLength; i++) {
|
||||
c = cookieArray[i];
|
||||
|
||||
// Left Trim spaces
|
||||
while (c.charAt(0) === " ") {
|
||||
c = c.substring(1, c.length);
|
||||
}
|
||||
eqIndex = c.indexOf("=");
|
||||
if (eqIndex > 0) {
|
||||
name = c.substring(0, eqIndex);
|
||||
value = c.substring(eqIndex + 1);
|
||||
postParams[name] = value;
|
||||
}
|
||||
}
|
||||
|
||||
if (sendToFlash) {
|
||||
this.setPostParams(postParams);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
+98
-97
@@ -1,98 +1,99 @@
|
||||
/*
|
||||
Queue Plug-in
|
||||
|
||||
Features:
|
||||
*Adds a cancelQueue() method for cancelling the entire queue.
|
||||
*All queued files are uploaded when startUpload() is called.
|
||||
*If false is returned from uploadComplete then the queue upload is stopped.
|
||||
If false is not returned (strict comparison) then the queue upload is continued.
|
||||
*Adds a QueueComplete event that is fired when all the queued files have finished uploading.
|
||||
Set the event handler with the queue_complete_handler setting.
|
||||
|
||||
*/
|
||||
|
||||
var SWFUpload;
|
||||
if (typeof(SWFUpload) === "function") {
|
||||
SWFUpload.queue = {};
|
||||
|
||||
SWFUpload.prototype.initSettings = (function (oldInitSettings) {
|
||||
return function () {
|
||||
if (typeof(oldInitSettings) === "function") {
|
||||
oldInitSettings.call(this);
|
||||
}
|
||||
|
||||
this.queueSettings = {};
|
||||
|
||||
this.queueSettings.queue_cancelled_flag = false;
|
||||
this.queueSettings.queue_upload_count = 0;
|
||||
|
||||
this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
|
||||
this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler;
|
||||
this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
|
||||
this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler;
|
||||
|
||||
this.settings.queue_complete_handler = this.settings.queue_complete_handler || null;
|
||||
};
|
||||
})(SWFUpload.prototype.initSettings);
|
||||
|
||||
SWFUpload.prototype.startUpload = function (fileID) {
|
||||
this.queueSettings.queue_cancelled_flag = false;
|
||||
this.callFlash("StartUpload", [fileID]);
|
||||
};
|
||||
|
||||
SWFUpload.prototype.cancelQueue = function () {
|
||||
this.queueSettings.queue_cancelled_flag = true;
|
||||
this.stopUpload();
|
||||
|
||||
var stats = this.getStats();
|
||||
while (stats.files_queued > 0) {
|
||||
this.cancelUpload();
|
||||
stats = this.getStats();
|
||||
}
|
||||
};
|
||||
|
||||
SWFUpload.queue.uploadStartHandler = function (file) {
|
||||
var returnValue;
|
||||
if (typeof(this.queueSettings.user_upload_start_handler) === "function") {
|
||||
returnValue = this.queueSettings.user_upload_start_handler.call(this, file);
|
||||
}
|
||||
|
||||
// To prevent upload a real "FALSE" value must be returned, otherwise default to a real "TRUE" value.
|
||||
returnValue = (returnValue === false) ? false : true;
|
||||
|
||||
this.queueSettings.queue_cancelled_flag = !returnValue;
|
||||
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
SWFUpload.queue.uploadCompleteHandler = function (file) {
|
||||
var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
|
||||
var continueUpload;
|
||||
|
||||
if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
|
||||
this.queueSettings.queue_upload_count++;
|
||||
}
|
||||
|
||||
if (typeof(user_upload_complete_handler) === "function") {
|
||||
continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
|
||||
} else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) {
|
||||
// If the file was stopped and re-queued don't restart the upload
|
||||
continueUpload = false;
|
||||
} else {
|
||||
continueUpload = true;
|
||||
}
|
||||
|
||||
if (continueUpload) {
|
||||
var stats = this.getStats();
|
||||
if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) {
|
||||
this.startUpload();
|
||||
} else if (this.queueSettings.queue_cancelled_flag === false) {
|
||||
this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]);
|
||||
this.queueSettings.queue_upload_count = 0;
|
||||
} else {
|
||||
this.queueSettings.queue_cancelled_flag = false;
|
||||
this.queueSettings.queue_upload_count = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
/*
|
||||
Queue Plug-in
|
||||
|
||||
Features:
|
||||
*Adds a cancelQueue() method for cancelling the entire queue.
|
||||
*All queued files are uploaded when startUpload() is called.
|
||||
*If false is returned from uploadComplete then the queue upload is stopped.
|
||||
If false is not returned (strict comparison) then the queue upload is continued.
|
||||
*Adds a QueueComplete event that is fired when all the queued files have finished uploading.
|
||||
Set the event handler with the queue_complete_handler setting.
|
||||
|
||||
*/
|
||||
|
||||
var SWFUpload;
|
||||
if (typeof(SWFUpload) === "function") {
|
||||
SWFUpload.queue = {};
|
||||
|
||||
SWFUpload.prototype.initSettings = (function (oldInitSettings) {
|
||||
return function () {
|
||||
if (typeof(oldInitSettings) === "function") {
|
||||
oldInitSettings.call(this);
|
||||
}
|
||||
|
||||
this.queueSettings = {};
|
||||
|
||||
this.queueSettings.queue_cancelled_flag = false;
|
||||
this.queueSettings.queue_upload_count = 0;
|
||||
|
||||
this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
|
||||
this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler;
|
||||
this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
|
||||
this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler;
|
||||
|
||||
this.settings.queue_complete_handler = this.settings.queue_complete_handler || null;
|
||||
};
|
||||
})(SWFUpload.prototype.initSettings);
|
||||
|
||||
SWFUpload.prototype.startUpload = function (fileID) {
|
||||
this.queueSettings.queue_cancelled_flag = false;
|
||||
this.callFlash("StartUpload", [fileID]);
|
||||
};
|
||||
|
||||
SWFUpload.prototype.cancelQueue = function () {
|
||||
this.queueSettings.queue_cancelled_flag = true;
|
||||
this.stopUpload();
|
||||
|
||||
var stats = this.getStats();
|
||||
while (stats.files_queued > 0) {
|
||||
this.cancelUpload();
|
||||
stats = this.getStats();
|
||||
}
|
||||
};
|
||||
|
||||
SWFUpload.queue.uploadStartHandler = function (file) {
|
||||
var returnValue;
|
||||
|
||||
if (typeof(this.queueSettings.user_upload_start_handler) === "function") {
|
||||
returnValue = this.queueSettings.user_upload_start_handler.call(this, file);
|
||||
}
|
||||
|
||||
// To prevent upload a real "FALSE" value must be returned, otherwise default to a real "TRUE" value.
|
||||
returnValue = (returnValue === false) ? false : true;
|
||||
|
||||
this.queueSettings.queue_cancelled_flag = !returnValue;
|
||||
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
SWFUpload.queue.uploadCompleteHandler = function (file) {
|
||||
var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
|
||||
var continueUpload;
|
||||
|
||||
if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
|
||||
this.queueSettings.queue_upload_count++;
|
||||
}
|
||||
|
||||
if (typeof(user_upload_complete_handler) === "function") {
|
||||
continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
|
||||
} else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) {
|
||||
// If the file was stopped and re-queued don't restart the upload
|
||||
continueUpload = false;
|
||||
} else {
|
||||
continueUpload = true;
|
||||
}
|
||||
|
||||
if (continueUpload) {
|
||||
var stats = this.getStats();
|
||||
if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) {
|
||||
this.startUpload();
|
||||
} else if (this.queueSettings.queue_cancelled_flag === false) {
|
||||
this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]);
|
||||
this.queueSettings.queue_upload_count = 0;
|
||||
} else {
|
||||
this.queueSettings.queue_cancelled_flag = false;
|
||||
this.queueSettings.queue_upload_count = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
+111
-111
@@ -1,111 +1,111 @@
|
||||
/*
|
||||
SWFUpload.SWFObject Plugin
|
||||
|
||||
Summary:
|
||||
This plugin uses SWFObject to embed SWFUpload dynamically in the page. SWFObject provides accurate Flash Player detection and DOM Ready loading.
|
||||
This plugin replaces the Graceful Degradation plugin.
|
||||
|
||||
Features:
|
||||
* swfupload_load_failed_hander event
|
||||
* swfupload_pre_load_handler event
|
||||
* minimum_flash_version setting (default: "9.0.28")
|
||||
* SWFUpload.onload event for early loading
|
||||
|
||||
Usage:
|
||||
Provide handlers and settings as needed. When using the SWFUpload.SWFObject plugin you should initialize SWFUploading
|
||||
in SWFUpload.onload rather than in window.onload. When initialized this way SWFUpload can load earlier preventing the UI flicker
|
||||
that was seen using the Graceful Degradation plugin.
|
||||
|
||||
<script type="text/javascript">
|
||||
var swfu;
|
||||
SWFUpload.onload = function () {
|
||||
swfu = new SWFUpload({
|
||||
minimum_flash_version: "9.0.28",
|
||||
swfupload_pre_load_handler: swfuploadPreLoad,
|
||||
swfupload_load_failed_handler: swfuploadLoadFailed
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
Notes:
|
||||
You must provide set minimum_flash_version setting to "8" if you are using SWFUpload for Flash Player 8.
|
||||
The swfuploadLoadFailed event is only fired if the minimum version of Flash Player is not met. Other issues such as missing SWF files, browser bugs
|
||||
or corrupt Flash Player installations will not trigger this event.
|
||||
The swfuploadPreLoad event is fired as soon as the minimum version of Flash Player is found. It does not wait for SWFUpload to load and can
|
||||
be used to prepare the SWFUploadUI and hide alternate content.
|
||||
swfobject's onDomReady event is cross-browser safe but will default to the window.onload event when DOMReady is not supported by the browser.
|
||||
Early DOM Loading is supported in major modern browsers but cannot be guaranteed for every browser ever made.
|
||||
*/
|
||||
|
||||
|
||||
/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
|
||||
Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
||||
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){Line truncated
|
||||
|
||||
|
||||
|
||||
var SWFUpload;
|
||||
if (typeof(SWFUpload) === "function") {
|
||||
SWFUpload.onload = function () {};
|
||||
|
||||
swfobject.addDomLoadEvent(function () {
|
||||
if (typeof(SWFUpload.onload) === "function") {
|
||||
SWFUpload.onload.call(window);
|
||||
}
|
||||
});
|
||||
|
||||
SWFUpload.prototype.initSettings = (function (oldInitSettings) {
|
||||
return function () {
|
||||
if (typeof(oldInitSettings) === "function") {
|
||||
oldInitSettings.call(this);
|
||||
}
|
||||
|
||||
this.ensureDefault = function (settingName, defaultValue) {
|
||||
this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
|
||||
};
|
||||
|
||||
this.ensureDefault("minimum_flash_version", "9.0.28");
|
||||
this.ensureDefault("swfupload_pre_load_handler", null);
|
||||
this.ensureDefault("swfupload_load_failed_handler", null);
|
||||
|
||||
delete this.ensureDefault;
|
||||
|
||||
};
|
||||
})(SWFUpload.prototype.initSettings);
|
||||
|
||||
|
||||
SWFUpload.prototype.loadFlash = function (oldLoadFlash) {
|
||||
return function () {
|
||||
var hasFlash = swfobject.hasFlashPlayerVersion(this.settings.minimum_flash_version);
|
||||
|
||||
if (hasFlash) {
|
||||
this.queueEvent("swfupload_pre_load_handler");
|
||||
if (typeof(oldLoadFlash) === "function") {
|
||||
oldLoadFlash.call(this);
|
||||
}
|
||||
} else {
|
||||
this.queueEvent("swfupload_load_failed_handler");
|
||||
}
|
||||
};
|
||||
|
||||
}(SWFUpload.prototype.loadFlash);
|
||||
|
||||
SWFUpload.prototype.displayDebugInfo = function (oldDisplayDebugInfo) {
|
||||
return function () {
|
||||
if (typeof(oldDisplayDebugInfo) === "function") {
|
||||
oldDisplayDebugInfo.call(this);
|
||||
}
|
||||
|
||||
this.debug(
|
||||
[
|
||||
"SWFUpload.SWFObject Plugin settings:", "\n",
|
||||
"\t", "minimum_flash_version: ", this.settings.minimum_flash_version, "\n",
|
||||
"\t", "swfupload_pre_load_handler assigned: ", (typeof(this.settings.swfupload_pre_load_handler) === "function").toString(), "\n",
|
||||
"\t", "swfupload_load_failed_handler assigned: ", (typeof(this.settings.swfupload_load_failed_handler) === "function").toString(), "\n",
|
||||
].join("")
|
||||
);
|
||||
};
|
||||
}(SWFUpload.prototype.displayDebugInfo);
|
||||
}
|
||||
/*
|
||||
SWFUpload.SWFObject Plugin
|
||||
|
||||
Summary:
|
||||
This plugin uses SWFObject to embed SWFUpload dynamically in the page. SWFObject provides accurate Flash Player detection and DOM Ready loading.
|
||||
This plugin replaces the Graceful Degradation plugin.
|
||||
|
||||
Features:
|
||||
* swfupload_load_failed_hander event
|
||||
* swfupload_pre_load_handler event
|
||||
* minimum_flash_version setting (default: "9.0.28")
|
||||
* SWFUpload.onload event for early loading
|
||||
|
||||
Usage:
|
||||
Provide handlers and settings as needed. When using the SWFUpload.SWFObject plugin you should initialize SWFUploading
|
||||
in SWFUpload.onload rather than in window.onload. When initialized this way SWFUpload can load earlier preventing the UI flicker
|
||||
that was seen using the Graceful Degradation plugin.
|
||||
|
||||
<script type="text/javascript">
|
||||
var swfu;
|
||||
SWFUpload.onload = function () {
|
||||
swfu = new SWFUpload({
|
||||
minimum_flash_version: "9.0.28",
|
||||
swfupload_pre_load_handler: swfuploadPreLoad,
|
||||
swfupload_load_failed_handler: swfuploadLoadFailed
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
Notes:
|
||||
You must provide set minimum_flash_version setting to "8" if you are using SWFUpload for Flash Player 8.
|
||||
The swfuploadLoadFailed event is only fired if the minimum version of Flash Player is not met. Other issues such as missing SWF files, browser bugs
|
||||
or corrupt Flash Player installations will not trigger this event.
|
||||
The swfuploadPreLoad event is fired as soon as the minimum version of Flash Player is found. It does not wait for SWFUpload to load and can
|
||||
be used to prepare the SWFUploadUI and hide alternate content.
|
||||
swfobject's onDomReady event is cross-browser safe but will default to the window.onload event when DOMReady is not supported by the browser.
|
||||
Early DOM Loading is supported in major modern browsers but cannot be guaranteed for every browser ever made.
|
||||
*/
|
||||
|
||||
|
||||
/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
|
||||
Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
|
||||
This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
||||
*/
|
||||
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){Line truncated
|
||||
|
||||
|
||||
|
||||
var SWFUpload;
|
||||
if (typeof(SWFUpload) === "function") {
|
||||
SWFUpload.onload = function () {};
|
||||
|
||||
swfobject.addDomLoadEvent(function () {
|
||||
if (typeof(SWFUpload.onload) === "function") {
|
||||
SWFUpload.onload.call(window);
|
||||
}
|
||||
});
|
||||
|
||||
SWFUpload.prototype.initSettings = (function (oldInitSettings) {
|
||||
return function () {
|
||||
if (typeof(oldInitSettings) === "function") {
|
||||
oldInitSettings.call(this);
|
||||
}
|
||||
|
||||
this.ensureDefault = function (settingName, defaultValue) {
|
||||
this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
|
||||
};
|
||||
|
||||
this.ensureDefault("minimum_flash_version", "9.0.28");
|
||||
this.ensureDefault("swfupload_pre_load_handler", null);
|
||||
this.ensureDefault("swfupload_load_failed_handler", null);
|
||||
|
||||
delete this.ensureDefault;
|
||||
|
||||
};
|
||||
})(SWFUpload.prototype.initSettings);
|
||||
|
||||
|
||||
SWFUpload.prototype.loadFlash = function (oldLoadFlash) {
|
||||
return function () {
|
||||
var hasFlash = swfobject.hasFlashPlayerVersion(this.settings.minimum_flash_version);
|
||||
|
||||
if (hasFlash) {
|
||||
this.queueEvent("swfupload_pre_load_handler");
|
||||
if (typeof(oldLoadFlash) === "function") {
|
||||
oldLoadFlash.call(this);
|
||||
}
|
||||
} else {
|
||||
this.queueEvent("swfupload_load_failed_handler");
|
||||
}
|
||||
};
|
||||
|
||||
}(SWFUpload.prototype.loadFlash);
|
||||
|
||||
SWFUpload.prototype.displayDebugInfo = function (oldDisplayDebugInfo) {
|
||||
return function () {
|
||||
if (typeof(oldDisplayDebugInfo) === "function") {
|
||||
oldDisplayDebugInfo.call(this);
|
||||
}
|
||||
|
||||
this.debug(
|
||||
[
|
||||
"SWFUpload.SWFObject Plugin settings:", "\n",
|
||||
"\t", "minimum_flash_version: ", this.settings.minimum_flash_version, "\n",
|
||||
"\t", "swfupload_pre_load_handler assigned: ", (typeof(this.settings.swfupload_pre_load_handler) === "function").toString(), "\n",
|
||||
"\t", "swfupload_load_failed_handler assigned: ", (typeof(this.settings.swfupload_load_failed_handler) === "function").toString(), "\n",
|
||||
].join("")
|
||||
);
|
||||
};
|
||||
}(SWFUpload.prototype.displayDebugInfo);
|
||||
}
|
||||
+980
-980
File diff suppressed because it is too large.
Load diff
@@ -1,716 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS XML HTTP REQUEST:: Albums Typeahead
|
||||
//------------------------------------------------------------------------------
|
||||
// Supports Safari, Mozilla 1.3+ (Firefox, etc) and IE 5.5+
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.iinvisionpower.com
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT VARS
|
||||
/*--------------------------------------------*/
|
||||
|
||||
var mem_div = 'ipb-get-members';
|
||||
var divobj;
|
||||
var iframeobj;
|
||||
var formobj;
|
||||
var xmlobj;
|
||||
var _result_cache = new Array();
|
||||
var _div_rows = 0;
|
||||
var _cur_updown_pressed = 0;
|
||||
var _last_key_code = 0;
|
||||
var _event_key_code = 0;
|
||||
var _cur_input_val = '';
|
||||
var _old_input_val = '';
|
||||
var _hiliteindex = -1;
|
||||
var _hilite_sug_div;
|
||||
var _complete_div_list;
|
||||
var delay_action = false;
|
||||
var _allow_update = true;
|
||||
var _form_onsubmit_saved;
|
||||
var _urllookup;
|
||||
var _timemout_main = 0;
|
||||
var _timeout_blur = 0;
|
||||
var _in_focus = 0;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// SHOW POSSIBLE MEMBER NAME MATCHES
|
||||
/*--------------------------------------------*/
|
||||
|
||||
main_loop = function()
|
||||
{
|
||||
if ( ( _old_input_val != _cur_input_val ) && ( _cur_input_val.length >= 3 ) && ( _in_focus == 1 ) )
|
||||
{
|
||||
if ( ! delay_action && _allow_update )
|
||||
{
|
||||
//----------------------------------
|
||||
// Try cache
|
||||
//----------------------------------
|
||||
|
||||
var cached = _result_cache[ _cur_input_val ];
|
||||
|
||||
if ( cached )
|
||||
{
|
||||
returnSearch( _cur_input_val, cached[0], cached[1] );
|
||||
}
|
||||
else
|
||||
{
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var returned = xmlobj.xmlhandler.responseText;
|
||||
|
||||
//----------------------------------
|
||||
// Did we get something?
|
||||
//----------------------------------
|
||||
|
||||
if ( returned.charAt(0) == '<' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
eval( returned );
|
||||
}
|
||||
};
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
xmlobj.process( ipb_var_base_url + '&autocom=gallery&req=quickch&op=albumnames&name='+escape(inobj.value) );
|
||||
|
||||
inobj.focus();
|
||||
}
|
||||
}
|
||||
|
||||
delay_action = false;
|
||||
}
|
||||
|
||||
_old_input_val = _cur_input_val;
|
||||
|
||||
_timemout_main = setTimeout( 'main_loop()', 10 );
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Initalize...
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function init_js( formobjname, fieldobjname )
|
||||
{
|
||||
//----------------------------------
|
||||
// Set up
|
||||
//----------------------------------
|
||||
|
||||
formobj = document.getElementById( formobjname );
|
||||
inobj = document.getElementById( fieldobjname );
|
||||
divobj = document.getElementById( mem_div );
|
||||
|
||||
inobj.setAttribute( "autocomplete", "off" );
|
||||
inobj.onfocus = function () { _in_focus = 1; };
|
||||
inobj.onblur = onblurhandler;
|
||||
inobj.onsubmit = submit_handler;
|
||||
|
||||
//----------------------------------
|
||||
// Already got a submit handler?
|
||||
//----------------------------------
|
||||
|
||||
if ( formobj.onsubmit )
|
||||
{
|
||||
_form_onsubmit_saved = formobj.onsubmit;
|
||||
}
|
||||
|
||||
formobj.onsubmit = submit_handler;
|
||||
|
||||
if ( inobj.createTextRange )
|
||||
{
|
||||
inobj.onkeyup = new Function( "return onkeyuphandler(event);" );
|
||||
}
|
||||
else
|
||||
{
|
||||
inobj.onkeyup = onkeyuphandler;
|
||||
}
|
||||
|
||||
cache_name_results("",new Array(),new Array(),new Array());
|
||||
|
||||
_cur_input_val = inobj.value;
|
||||
|
||||
document.onkeydown = keydownhandler;
|
||||
|
||||
set_up_key_down();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Set up key down
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function set_up_key_down()
|
||||
{
|
||||
if ( document.createEventObject )
|
||||
{
|
||||
var y = document.createEventObject();
|
||||
y.ctrlKey = true;
|
||||
y.keyCode = 70;
|
||||
document.fireEvent( "onkeydown", y )
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Key down handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function keydownhandler( event )
|
||||
{
|
||||
if( ! event && window.event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
if ( event )
|
||||
{
|
||||
_last_key_code = event.keyCode;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// On blur handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function onblurhandler( event )
|
||||
{
|
||||
if ( ! event && window.event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
if ( ! _cur_updown_pressed )
|
||||
{
|
||||
_in_focus = 0;
|
||||
|
||||
my_xr_hide_div( divobj );
|
||||
_hiliteindex = -1;
|
||||
|
||||
// Tab?
|
||||
|
||||
if ( _last_key_code == 9 )
|
||||
{
|
||||
_last_key_code = -1;
|
||||
}
|
||||
}
|
||||
|
||||
_cur_updown_pressed = false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// On key up handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function key_handler_function()
|
||||
{
|
||||
//----------------------------------
|
||||
// trap up/down cursor
|
||||
//----------------------------------
|
||||
|
||||
if ( _event_key_code == 40 || _event_key_code == 38 )
|
||||
{
|
||||
_allow_update = false;
|
||||
blur_then_focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
_cur_updown_pressed = false;
|
||||
_allow_update = true;
|
||||
}
|
||||
|
||||
_cur_input_val = inobj.value;
|
||||
|
||||
handle_cursor_press( _event_key_code );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Handle cursor press
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function handle_cursor_press( eventcode )
|
||||
{
|
||||
if ( eventcode == 40 )
|
||||
{
|
||||
hilite_new_value( _hiliteindex + 1 );
|
||||
}
|
||||
else if ( eventcode == 38 )
|
||||
{
|
||||
hilite_new_value( _hiliteindex - 1 );
|
||||
}
|
||||
else if ( eventcode == 13 || eventcode == 3 )
|
||||
{
|
||||
//----------------------------------
|
||||
// Are we looking through the divs?
|
||||
//----------------------------------
|
||||
|
||||
if ( _hiliteindex != -1 )
|
||||
{
|
||||
my_xr_hide_div( divobj );
|
||||
_hiliteindex = -1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Highlight new value (cursor keys pressed)
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function hilite_new_value( index )
|
||||
{
|
||||
if ( _div_rows <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
my_show_div( divobj );
|
||||
|
||||
if ( index > _div_rows )
|
||||
{
|
||||
index = _div_rows - 1;
|
||||
}
|
||||
|
||||
if ( _hiliteindex != -1 && index != _hiliteindex )
|
||||
{
|
||||
set_style_for_element( _hilite_sug_div, 'wrapdiv' );
|
||||
}
|
||||
|
||||
if ( index < 0 )
|
||||
{
|
||||
_hiliteindex = -1;
|
||||
inobj.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
_hiliteindex = index;
|
||||
_hilite_sug_div = divobj.getElementsByTagName('DIV').item( index );
|
||||
|
||||
set_style_for_element( _hilite_sug_div, 'spanhilite' );
|
||||
|
||||
newval = find_span_value_for_class( _hilite_sug_div, 'namespan' );
|
||||
|
||||
if ( newval && typeof(newval) != 'undefined' )
|
||||
{
|
||||
inobj.value = find_span_value_for_class( _hilite_sug_div, 'namespan' );
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Blur then focus
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function blur_then_focus()
|
||||
{
|
||||
_cur_updown_pressed = true;
|
||||
|
||||
inobj.blur();
|
||||
|
||||
_timemout_blur = setTimeout( "set_input_field_focus();", 10 );
|
||||
return;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Set input field focus
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function set_input_field_focus()
|
||||
{
|
||||
inobj.focus();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Styles element
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function set_style_for_element( c, name )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! c )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
c.className = name;
|
||||
|
||||
switch( name )
|
||||
{
|
||||
case 'wrapdiv':
|
||||
c.style.backgroundColor = "white";
|
||||
c.style.color = "black";
|
||||
|
||||
if ( c.displaySpan )
|
||||
{
|
||||
c.displaySpan.style.color = "green";
|
||||
}
|
||||
|
||||
break;
|
||||
case 'wrapspan':
|
||||
c.style.display = "block";
|
||||
c.style.paddingLeft = "3";
|
||||
c.style.paddingRight = "3";
|
||||
c.style.height = "16px";
|
||||
c.style.overflow = "hidden";
|
||||
break;
|
||||
case 'namespan':
|
||||
c.style.cssFloat = "left";
|
||||
c.style.width = '100%';
|
||||
break;
|
||||
case 'idspan':
|
||||
c.style.cssFloat = "right";
|
||||
c.style.display = 'none';
|
||||
break;
|
||||
case 'spanhilite':
|
||||
c.style.backgroundColor = "#3366cc";
|
||||
c.style.color = "white";
|
||||
|
||||
if ( c.displaySpan )
|
||||
{
|
||||
c.displaySpan.style.color = "white";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Get value of named span
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function find_span_value_for_class( i, dc )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! i )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ga = i.getElementsByTagName('div');
|
||||
|
||||
if ( ga )
|
||||
{
|
||||
for( var f=0; f < ga.length; ++f )
|
||||
{
|
||||
if ( ga[f].className == dc )
|
||||
{
|
||||
var value = ga[f].innerHTML;
|
||||
|
||||
if ( value == " " )
|
||||
{
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Displays the actual list
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function display_suggested_list( na, da, ia )
|
||||
{
|
||||
//----------------------------------
|
||||
// Clear div
|
||||
//----------------------------------
|
||||
|
||||
while( divobj.childNodes.length > 0 )
|
||||
{
|
||||
divobj.removeChild( divobj.childNodes[0] );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Write Div
|
||||
//----------------------------------
|
||||
|
||||
_div_rows = 0;
|
||||
|
||||
for( var f = 0 ; f < na.length; ++f )
|
||||
{
|
||||
_div_rows++;
|
||||
var od = document.createElement("DIV");
|
||||
set_style_for_element( od, 'wrapdiv' );
|
||||
od.onmousedown = sb_mdown;
|
||||
od.onmouseover = sb_mover;
|
||||
od.onmouseout = sb_mout;
|
||||
|
||||
var span_wrap = document.createElement("SPAN");
|
||||
set_style_for_element( span_wrap, 'wrapspan' );
|
||||
|
||||
var span_name = document.createElement("SPAN");
|
||||
span_name.innerHTML = da[f];
|
||||
|
||||
var span_dname = document.createElement("div");
|
||||
span_dname.innerHTML = na[f];
|
||||
|
||||
var span_id = document.createElement("SPAN");
|
||||
|
||||
set_style_for_element( span_name, 'namespan' );
|
||||
set_style_for_element( span_dname, 'namespan' );
|
||||
set_style_for_element( span_id, 'idspan' );
|
||||
|
||||
od.displaySpan = span_id;
|
||||
|
||||
span_id.innerHTML = ia[f];
|
||||
|
||||
span_wrap.appendChild( span_name );
|
||||
span_wrap.appendChild( span_id );
|
||||
span_wrap.appendChild( span_dname );
|
||||
od.appendChild( span_wrap );
|
||||
divobj.appendChild( od );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Calc pos.
|
||||
//----------------------------------
|
||||
|
||||
var mid = inobj;
|
||||
var left_px = _get_obj_leftpos(mid);
|
||||
var top_px = _get_obj_toppos(mid) + mid.offsetHeight;
|
||||
var width = parseInt( divobj.style.width );
|
||||
var height = parseInt( divobj.style.height );
|
||||
|
||||
//----------------------------------
|
||||
// Show menu DIV
|
||||
//----------------------------------
|
||||
|
||||
divobj.style.position = "absolute";
|
||||
|
||||
//----------------------------------
|
||||
// Try and keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
if ( (left_px + width) >= document.body.clientWidth )
|
||||
{
|
||||
left_px = left_px + mid.offsetWidth - width;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Try and keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
if ( (top_px + height) >= document.body.clientHeight )
|
||||
{
|
||||
top_px = top_px - height;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Finalize menu position
|
||||
//----------------------------------
|
||||
|
||||
divobj.style.left = left_px + "px";
|
||||
divobj.style.top = top_px + "px";
|
||||
divobj.style.display = "block";
|
||||
|
||||
_hiliteindex= -1;
|
||||
|
||||
//----------------------------------
|
||||
// Workaround for IE bug which shows
|
||||
// select boxes and other windows GUI
|
||||
// over divs. SHOW IFRAME
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! document.getElementById( 'if_xhr_' + mem_div ) )
|
||||
{
|
||||
iframeobj = document.createElement('iframe');
|
||||
|
||||
iframeobj.src = 'javascript:;';
|
||||
iframeobj.id = 'if_xhr_' + mem_div;
|
||||
|
||||
document.getElementsByTagName('body')[0].appendChild( iframeobj );
|
||||
}
|
||||
else
|
||||
{
|
||||
iframeobj = document.getElementById( 'if_xhr_' + mem_div );
|
||||
}
|
||||
|
||||
iframeobj.scrolling = 'no';
|
||||
iframeobj.frameborder = 'no';
|
||||
iframeobj.className = 'iframeshim';
|
||||
iframeobj.style.position = 'absolute';
|
||||
|
||||
iframeobj.style.width = parseInt(divobj.offsetWidth) + 'px';
|
||||
iframeobj.style.height = parseInt(divobj.offsetHeight) + 'px';
|
||||
iframeobj.style.top = divobj.style.top;
|
||||
iframeobj.style.left = divobj.style.left;
|
||||
iframeobj.style.zIndex = divobj.style.zIndex - 1;
|
||||
iframeobj.style.display = "block";
|
||||
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
//alert(error); // Oh dear, someones stolen the iframe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Caches the results
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cache_name_results( mstring, na, da, ia )
|
||||
{
|
||||
_result_cache[mstring] = new Array( na, da, ia );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// This is the function the response XML text gives
|
||||
/*--------------------------------------------*/
|
||||
|
||||
returnSearch = function( mstring, namearray, displayarray, idarray )
|
||||
{
|
||||
//----------------------------------
|
||||
// Cache..
|
||||
//----------------------------------
|
||||
|
||||
cache_name_results( mstring, namearray, displayarray, idarray );
|
||||
|
||||
if ( _in_focus != 1 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Display
|
||||
//----------------------------------
|
||||
|
||||
display_suggested_list( namearray, displayarray, idarray );
|
||||
|
||||
//----------------------------------
|
||||
// Resize or hide?
|
||||
//----------------------------------
|
||||
|
||||
if ( _div_rows > 0 )
|
||||
{
|
||||
divobj.style.height = 16 * _div_rows + 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
my_xr_hide_div( divobj );
|
||||
_hiliteindex = -1;
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Submit handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
submit_handler = function ( event )
|
||||
{
|
||||
delay_action = true;
|
||||
var retval = true;
|
||||
|
||||
if ( _hiliteindex != -1 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( _form_onsubmit_saved )
|
||||
{
|
||||
eval( 'tmpsubmit = ' + _form_onsubmit_saved );
|
||||
retval = tmpsubmit();
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// On key up handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
onkeyuphandler = function( event )
|
||||
{
|
||||
_event_key_code = event.keyCode;
|
||||
key_handler_function();
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Div mouse events
|
||||
/*--------------------------------------------*/
|
||||
|
||||
sb_mdown = function()
|
||||
{
|
||||
delay_action = true;
|
||||
inobj.value = find_span_value_for_class( this, 'namespan' );
|
||||
};
|
||||
|
||||
sb_mover = function()
|
||||
{
|
||||
set_style_for_element( this, 'spanhilite' );
|
||||
};
|
||||
|
||||
sb_mout = function()
|
||||
{
|
||||
set_style_for_element( this, 'wrapdiv' );
|
||||
};
|
||||
|
||||
function my_xr_hide_div ( dobj )
|
||||
{
|
||||
dobj.style.display = "none";
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
try
|
||||
{
|
||||
document.getElementById( 'if_xhr_' + mem_div ).style.display = "none";
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
//alert(e);// Oh dear, someones stolen the iframe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
+931
-92
File diff suppressed because it is too large.
Load diff
@@ -32,7 +32,7 @@ _attach.prototype.attach = {
|
||||
* @param {object} options Options to pass to object
|
||||
*/
|
||||
registerUploader: function( id, type, wrapper, options )
|
||||
{
|
||||
{
|
||||
//if( !ipb.vars['use_swfupload'] ){ return false; }
|
||||
|
||||
if( Object.isUndefined( id ) || id == null )
|
||||
@@ -286,14 +286,14 @@ _attach.prototype.attach = {
|
||||
|
||||
if( fileindex && filename )
|
||||
{
|
||||
ipb.editorInsert( "[attachment=" + fileindex + ":" + filename + "]", 'ed-0' );
|
||||
ipb.editorInsert( "[attachment=" + fileindex + ":" + filename.replace( /\[/, '' ).replace( /\]/, '' ) + "]", 'ed-0' );
|
||||
}
|
||||
else if( fileindex )
|
||||
{
|
||||
ipb.editorInsert( "[attachment=" + fileindex + "]", 'ed-0' );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
ipb.attach.init();
|
||||
|
||||
//==============================================================
|
||||
@@ -482,7 +482,7 @@ _attach.prototype.attachSWF = Class.create({
|
||||
file_queue_error_handler: this._fileQueueError.bind(this),
|
||||
queue_complete_handler: this._queueComplete.bind(this),
|
||||
file_queued_handler: this._fileQueued.bind(this)
|
||||
}
|
||||
};
|
||||
|
||||
swfu = new SWFUpload( settings );
|
||||
|
||||
@@ -880,7 +880,7 @@ _attach.prototype.attachSWF = Class.create({
|
||||
progress_bar.setStyle( "width: " + percent + "%" ).update( percent + "%" );
|
||||
|
||||
this._setStatus( file.index, 'in_progress' );
|
||||
this._updateInfo( file.index, ipb.lang['upload_progress'].gsub( /\[done\]/, ipb.global.convertSize( bytesLoaded ) ).gsub( /\[total\]/, ipb.global.convertSize( bytesTotal ) ) )
|
||||
this._updateInfo( file.index, ipb.lang['upload_progress'].gsub( /\[done\]/, ipb.global.convertSize( bytesLoaded ) ).gsub( /\[total\]/, ipb.global.convertSize( bytesTotal ) ) );
|
||||
|
||||
Debug.write( "ips.attach.js: (ID " + this.id + ", uploadProgress)" );
|
||||
},
|
||||
|
||||
@@ -260,5 +260,6 @@ _attach.prototype.attachajax = {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.attachajax.init();
|
||||
+166
-74
@@ -33,6 +33,7 @@ _blog.prototype.blog = {
|
||||
},
|
||||
popups: {},
|
||||
cp1: null,
|
||||
blogs: {},
|
||||
|
||||
|
||||
/*------------------------------*/
|
||||
@@ -72,6 +73,9 @@ _blog.prototype.blog = {
|
||||
{
|
||||
$('comments').scrollTo();
|
||||
}
|
||||
|
||||
ipb.delegate.register(".__delete", ipb.blog.deleteDialogue );
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
@@ -98,12 +102,6 @@ _blog.prototype.blog = {
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( ! Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] + ": " + t.responseJSON['error'] );
|
||||
return;
|
||||
}
|
||||
|
||||
$('recentajaxcontent').update( t.responseText );
|
||||
$('ratitle').update( newTitle );
|
||||
}
|
||||
@@ -111,64 +109,6 @@ _blog.prototype.blog = {
|
||||
|
||||
},
|
||||
|
||||
/* INIT Comment tracker button */
|
||||
setUpCommentNotification: function( memberId, trackerId, entryId )
|
||||
{
|
||||
if ( memberId )
|
||||
{
|
||||
if ( trackerId )
|
||||
{
|
||||
$('__commentTrack_on').hide();
|
||||
$('__commentTrack_off').show();
|
||||
|
||||
ipb.blog.cton = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('__commentTrack_on').show();
|
||||
$('__commentTrack_off').hide();
|
||||
|
||||
ipb.blog.cton = false;
|
||||
}
|
||||
|
||||
$('__commentTrack_off').observe('click', ipb.blog.fireCommentTrackToggle.bindAsEventListener( this, entryId ) );
|
||||
$('__commentTrack_on').observe('click', ipb.blog.fireCommentTrackToggle.bindAsEventListener( this, entryId ) );
|
||||
}
|
||||
},
|
||||
|
||||
fireCommentTrackToggle: function( e, entryId )
|
||||
{
|
||||
Event.stop(e);
|
||||
ipb.blog.cton = ( ipb.blog.cton ) ? false : true;
|
||||
|
||||
var url = ipb.vars['base_url'] + "app=blog&module=ajax&section=comments&do=toggleTracker&blogid=" + ipb.blog.blogID + "&entry_id=" + entryId + "&md5check=" + ipb.vars['secure_hash'];
|
||||
|
||||
new Ajax.Request( url.replace(/&/g, '&'),
|
||||
{
|
||||
method: 'get',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( !Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] + ": " + t.responseJSON['error'] );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ipb.blog.cton )
|
||||
{
|
||||
$('__commentTrack_on').hide();
|
||||
$('__commentTrack_off').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('__commentTrack_on').show();
|
||||
$('__commentTrack_off').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/* INIT blogs as table */
|
||||
setUpBlogsAsTable: function()
|
||||
{
|
||||
@@ -317,14 +257,16 @@ _blog.prototype.blog = {
|
||||
|
||||
var _go = true;
|
||||
|
||||
if ( $F('formCatAddInput') )
|
||||
var newCatName = ipb.blog.cleanCategoryName($F('formCatAddInput'));
|
||||
|
||||
if (newCatName)
|
||||
{
|
||||
/* Already got a meow by this name? */
|
||||
if ( ipb.blog.currentCats.size() )
|
||||
{
|
||||
ipb.blog.currentCats.each( function( c )
|
||||
{
|
||||
if ( c.value['category_title'] == $F('formCatAddInput') )
|
||||
if ( c.value['category_title'] == newCatName )
|
||||
{
|
||||
alert( ipb.lang['blog_cat_exists'] );
|
||||
|
||||
@@ -338,7 +280,7 @@ _blog.prototype.blog = {
|
||||
{
|
||||
ipb.blog._newCats.each( function( t )
|
||||
{
|
||||
if ( t.value == $F('formCatAddInput') )
|
||||
if ( t.value == newCatName )
|
||||
{
|
||||
alert( ipb.lang['blog_cat_exists'] );
|
||||
|
||||
@@ -351,7 +293,7 @@ _blog.prototype.blog = {
|
||||
if ( _go == true )
|
||||
{
|
||||
var _id = 'catNew-' + parseInt( ipb.blog._newCats.size() + 1 );
|
||||
var _name = $F('formCatAddInput');
|
||||
var _name = newCatName;
|
||||
|
||||
ipb.blog._newCats.set( _id, { 'category_title' : _name, '_selected' : 1 } );
|
||||
|
||||
@@ -362,6 +304,26 @@ _blog.prototype.blog = {
|
||||
}
|
||||
},
|
||||
|
||||
cleanCategoryName: function(name)
|
||||
{
|
||||
name = name.replace(' ', ' ');
|
||||
name = name.replace("\r", '');
|
||||
name = name.replace("\n", '');
|
||||
|
||||
name = name.replace('&', '&');
|
||||
name = name.replace('<!--', '<!--');
|
||||
name = name.replace('-->', '-->');
|
||||
name = name.replace('<script', '<script');
|
||||
name = name.replace('>', '>');
|
||||
name = name.replace('<', '<');
|
||||
name = name.replace('"', '"');
|
||||
name = name.replace('$', '$');
|
||||
name = name.replace('!', '!');
|
||||
name = name.replace('\'', ''');
|
||||
|
||||
return name;
|
||||
},
|
||||
|
||||
/* Form INIT */
|
||||
initPostForm: function()
|
||||
{
|
||||
@@ -387,12 +349,12 @@ _blog.prototype.blog = {
|
||||
{
|
||||
if ( $('bfs_modOptions') && $F('bfs_modOptions') == 'published' )
|
||||
{
|
||||
$('bfs_submit').value = 'Publish Now';
|
||||
$('bfs_submit').value = ipb.lang['blog_publish_now'];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('bfs_submit').value = 'Save Draft';
|
||||
$('bfs_submit').value = ipb.lang['blog_save_draft'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -400,8 +362,49 @@ _blog.prototype.blog = {
|
||||
$('bf_modWrapper').hide();
|
||||
$('bf_timeOpts').hide();
|
||||
$('bf_timeOpts2').hide();
|
||||
|
||||
/* Blog choose */
|
||||
if ( $('blog_chooser') )
|
||||
{
|
||||
$('blog_chooser').observe( 'change', ipb.blog.pfBlogChooser.bindAsEventListener( this ) );
|
||||
}
|
||||
},
|
||||
|
||||
pfBlogChooser: function( e )
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
blogid = $('blog_chooser').options[ $('blog_chooser').selectedIndex ].value;
|
||||
|
||||
var url = ipb.vars['base_url'] + "app=blog&module=ajax&section=post&do=getdata&blogid=" + blogid + "&md5check=" + ipb.vars['secure_hash'];
|
||||
|
||||
new Ajax.Request( url.replace(/&/g, '&'),
|
||||
{
|
||||
method: 'get',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] + ": " + t.responseJSON['error'] );
|
||||
return;
|
||||
}
|
||||
|
||||
ipb.blog.currentCats = $H( t.responseJSON.cats );
|
||||
ipb.blog.currentTags = $H( t.responseJSON.tags );
|
||||
|
||||
ipb.blog.formInitCats(e);
|
||||
ipb.blog.formTogglePopularTags(e);
|
||||
|
||||
if ( ipb.blog.currentTags.size() < 1 )
|
||||
{
|
||||
$('tags_container').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
pfTriggerSubmit: function( e, type )
|
||||
{
|
||||
Event.stop(e);
|
||||
@@ -509,7 +512,7 @@ _blog.prototype.blog = {
|
||||
$('theme_preview').observe('click', ipb.blog.previewTheme);
|
||||
$('theme_save').observe('click', ipb.blog.saveTheme);
|
||||
$('theme_color_picker').observe('click', ipb.blog.openPicker);
|
||||
}
|
||||
};
|
||||
|
||||
ipb.blog.popups['themes'] = new ipb.Popup('theme_editor', { type: 'pane', modal: false, hideAtStart: true, initial: ipb.templates['add_theme'] }, { afterInit: afterInit } );
|
||||
ipb.blog.popups['themes'].show();
|
||||
@@ -951,7 +954,7 @@ _blog.prototype.blog = {
|
||||
} else {
|
||||
$('main_blog_wrapper').removeClassName('with_right');
|
||||
$('cblock_right').addClassName('temp').hide();
|
||||
$('cblock_left').innerHTML += " "; // Force a redraw for safari
|
||||
$('cblock_right').innerHTML += " "; // Force a redraw for safari
|
||||
}
|
||||
|
||||
if( ipb.blog.updateLeft )
|
||||
@@ -1052,7 +1055,96 @@ _blog.prototype.blog = {
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
/**
|
||||
* Delete pop-up
|
||||
*/
|
||||
deleteDialogue: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var id = elem.id.replace( 'blogDelete_', '' );
|
||||
|
||||
if ( ipb.blog.popups[ 'del_' + id ] )
|
||||
{
|
||||
ipb.blog.popups[ 'del_' + id ].show(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
ipb.blog.popups[ 'del_' + id ] = new ipb.Popup( 'd_e_l__' + id, {
|
||||
type: 'balloon',
|
||||
initial: ipb.templates['deleteDialogue'].evaluate( { 'id' : id } ),
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
defer: false,
|
||||
warning: true,
|
||||
attach: { target: $('blog-' + id + '__mod_options'), position: 'auto', 'event': 'click' },
|
||||
w: '400px'
|
||||
});
|
||||
|
||||
/* Populate select box */
|
||||
if ( ipb.blog.blogs.size() )
|
||||
{
|
||||
ipb.blog.blogs.each( function( b )
|
||||
{
|
||||
if ( b.key != id )
|
||||
{
|
||||
var _o = new Element( 'option' );
|
||||
_o.value = b.key;
|
||||
_o.text = b.value.replace( ''', "'" ).replace( '"', '"' );
|
||||
|
||||
$('delselect_' + id).insert( _o );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
$('delButton_' + id).observe('click', ipb.blog.ohJustDeleteItAlready.bindAsEventListener( this, id ) );
|
||||
$('delMove_' + id).observe('change', ipb.blog.deleteMoveCheck.bindAsEventListener( this, id ) );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* YeAh
|
||||
*/
|
||||
ohJustDeleteItAlready: function( e, id )
|
||||
{
|
||||
Event.stop(e);
|
||||
if ( ! $('delConfirm_' + id ).checked )
|
||||
{
|
||||
alert( 'If you want to delete this blog, you must check the box' );
|
||||
return false;
|
||||
}
|
||||
|
||||
var url = $('blogDelete_' + id ).href;
|
||||
|
||||
if ( $('delMove_' + id ) && $('delMove_' + id ).checked )
|
||||
{
|
||||
url += '&moveTo=' + $('delselect_' + id ).options[ $('delselect_' + id ).selectedIndex ].value;
|
||||
}
|
||||
|
||||
/* OG */
|
||||
window.location = url;
|
||||
},
|
||||
|
||||
/**
|
||||
* <insert stuff>
|
||||
*/
|
||||
deleteMoveCheck: function( e, id )
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( $('delMove_' + id).checked )
|
||||
{
|
||||
$('delMore_' + id).hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('delMore_' + id).show();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.blog.init();
|
||||
ipb.blog.init();
|
||||
@@ -29,8 +29,8 @@ _blogucp.prototype.blogucp = {
|
||||
|
||||
$$('.blogform').each( function(elem)
|
||||
{
|
||||
Debug.write( elem );
|
||||
switch( elem.tagName )
|
||||
console.log( elem );
|
||||
/*switch( elem.tagName )
|
||||
{
|
||||
case 'INPUT':
|
||||
case 'LABEL':
|
||||
@@ -39,7 +39,7 @@ _blogucp.prototype.blogucp = {
|
||||
case 'SELECT':
|
||||
$( elem ).observe('change', ipb.blogucp.updateForm);
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,6 +51,17 @@ _blogucp.prototype.blogucp = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Stop importing RSS feed
|
||||
*/
|
||||
stopRssFeed: function( blogId )
|
||||
{
|
||||
if( confirm( ipb.lang['delete_confirm'] ) )
|
||||
{
|
||||
window.location = ipb.vars['base_url'] + "app=core&module=usercp&tab=blog&area=stopRssImport&do=custom&blogid=" + blogId + '&secure_key=' + ipb.vars['secure_hash'];
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Delete pop-up
|
||||
*/
|
||||
@@ -111,7 +122,7 @@ _blogucp.prototype.blogucp = {
|
||||
|
||||
var url = $('blogDelete_' + id ).href;
|
||||
|
||||
if ( $('delMove_' + id ).checked )
|
||||
if ( $('delMove_' + id ) && $('delMove_' + id ).checked )
|
||||
{
|
||||
url += '&moveTo=' + $('delselect_' + id ).options[ $('delselect_' + id ).selectedIndex ].value;
|
||||
}
|
||||
@@ -311,6 +322,6 @@ _blogucp.prototype.blogucp = {
|
||||
{
|
||||
if( $( elem ) ){ $( elem ).show(); }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.blogucp.init();
|
||||
+201
-10
@@ -39,8 +39,11 @@ _idx.prototype.board = {
|
||||
{
|
||||
if ( ! ipb.board._statusClick )
|
||||
{
|
||||
$('hookStatusTextField').value = '';
|
||||
$('hookStatusTextField').setStyle( { color: 'black' } );
|
||||
if( $('hookStatusTextField') )
|
||||
{
|
||||
$('hookStatusTextField').value = '';
|
||||
//$('hookStatusTextField').setStyle( { color: 'black' } );
|
||||
}
|
||||
|
||||
ipb.board._statusClick = 1;
|
||||
}
|
||||
@@ -79,25 +82,42 @@ _idx.prototype.board = {
|
||||
$(cat).select('.toggle')[0].observe( 'click', ipb.board.toggleCat );
|
||||
});
|
||||
|
||||
cookie = ipb.Cookie.get('toggleCats');
|
||||
cookie = ipb.Cookie.get('toggleCats');
|
||||
|
||||
if( cookie )
|
||||
{
|
||||
var cookies = cookie.split( ',' );
|
||||
var cookies = cookie.split( ',' );
|
||||
var newCookies = new Array();
|
||||
var resetCookie = false;
|
||||
|
||||
//-------------------------
|
||||
// Little fun for you...
|
||||
//-------------------------
|
||||
|
||||
for( var abcdefg=0; abcdefg < cookies.length; abcdefg++ )
|
||||
{
|
||||
if( cookies[ abcdefg ] )
|
||||
{
|
||||
var wrapper = $( 'category_' + cookies[ abcdefg ] ).up('.category_block').down('.table_wrap');
|
||||
|
||||
wrapper.hide();
|
||||
$( 'category_' + cookies[ abcdefg ] ).addClassName('collapsed');
|
||||
if( $( 'category_' + cookies[ abcdefg ] ) )
|
||||
{
|
||||
var wrapper = $( 'category_' + cookies[ abcdefg ] ).up('.category_block').down('.table_wrap');
|
||||
|
||||
wrapper.hide();
|
||||
$( 'category_' + cookies[ abcdefg ] ).addClassName('collapsed');
|
||||
|
||||
newCookies.push( cookies[ abcdefg ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
resetCookie = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( resetCookie )
|
||||
{
|
||||
ipb.Cookie.set( 'toggleCats', newCookies.join( ',' ) );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -169,6 +189,8 @@ _idx.prototype.board = {
|
||||
Debug.write("Stats are visible");
|
||||
$('open_sidebar').hide();
|
||||
$('close_sidebar').show();
|
||||
|
||||
ipb.board.setUpSideBarBlocks();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -207,7 +229,7 @@ _idx.prototype.board = {
|
||||
new Effect.Morph( $('categories'), { style: 'with_sidebar', duration: 0.4, afterFinish: function(){
|
||||
$('categories').removeClassName('with_sidebar').removeClassName('no_sidebar');
|
||||
new Effect.Appear( $('index_stats'), { duration: 0.4, queue: 'end', afterFinish: function(){
|
||||
ipb.board.animating = false;
|
||||
ipb.board.animating = false; $('index_stats').show(); ipb.board.setUpSideBarBlocks();
|
||||
} } );
|
||||
} } );
|
||||
|
||||
@@ -226,6 +248,175 @@ _idx.prototype.board = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Add in collapsable icons
|
||||
*/
|
||||
setUpSideBarBlocks: function()
|
||||
{
|
||||
if( $('index_stats').visible() && ! $$('.index_stats_collapse').length )
|
||||
{
|
||||
$$('#index_stats h3').each( function(h3)
|
||||
{
|
||||
$( h3 ).identify();
|
||||
|
||||
/* Set title - fugly
|
||||
Here we run through escape first to change foreign chars to %xx with xx being latin, and then we remove % after */
|
||||
title = escape( $( h3 ).innerHTML.replace( /<(\/)?([^>]+?)>/g, '' ) ).replace( /%/g, '' );
|
||||
title = title.replace( / /g, '' ).replace( /[^a-zA-Z0-9]/, '' ).toLowerCase();
|
||||
|
||||
$( h3 ).up('div').addClassName( '__xX' + title );
|
||||
|
||||
/* insert the image */
|
||||
$( h3 ).update( '<a href="#" class="index_stats_collapse open">-</a>' + h3.innerHTML );
|
||||
});
|
||||
|
||||
cookie = ipb.Cookie.get('toggleSBlocks');
|
||||
|
||||
if( cookie )
|
||||
{
|
||||
var cookies = cookie.split( ',' );
|
||||
|
||||
for( var abcdefg=0; abcdefg < cookies.length; abcdefg++ )
|
||||
{
|
||||
if( cookies[ abcdefg ] )
|
||||
{
|
||||
var top = $('index_stats').down('.__xX' + cookies[ abcdefg ] );
|
||||
|
||||
if ( top )
|
||||
{
|
||||
var wrapper = top.down('._sbcollapsable');
|
||||
|
||||
if ( ! wrapper )
|
||||
{
|
||||
wrapper = top.down('ul');
|
||||
}
|
||||
|
||||
if ( ! wrapper )
|
||||
{
|
||||
wrapper = top.down('ol');
|
||||
}
|
||||
|
||||
if ( ! wrapper )
|
||||
{
|
||||
wrapper = top.down('div');
|
||||
}
|
||||
|
||||
if ( ! wrapper )
|
||||
{
|
||||
wrapper = top.down('table');
|
||||
}
|
||||
|
||||
if ( wrapper )
|
||||
{
|
||||
if ( top.hasClassName('alt') )
|
||||
{
|
||||
top._isAlt = true;
|
||||
top.removeClassName('alt');
|
||||
}
|
||||
|
||||
wrapper.hide();
|
||||
}
|
||||
|
||||
top.down('.index_stats_collapse').removeClassName('open').addClassName('close');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ipb.delegate.register(".index_stats_collapse", ipb.board.toggleSideBarBlock);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle the block
|
||||
*/
|
||||
toggleSideBarBlock: function( e, elem )
|
||||
{
|
||||
Event.stop(e);
|
||||
elem.identify();
|
||||
|
||||
var remove = $A();
|
||||
cookie = ipb.Cookie.get('toggleSBlocks');
|
||||
|
||||
if( cookie == null )
|
||||
{
|
||||
cookie = $A();
|
||||
}
|
||||
else
|
||||
{
|
||||
cookie = cookie.split(',');
|
||||
}
|
||||
|
||||
/* Test for known class name */
|
||||
var top = elem.up('div');
|
||||
|
||||
moo = top.className.match('__xX([0-9А-Яа-яA-Za-z]+)');
|
||||
topId = moo[1];
|
||||
|
||||
block = top.down('._sbcollapsable');
|
||||
|
||||
if ( ! $( block ) )
|
||||
{
|
||||
block = elem.up('div').down('ul');
|
||||
}
|
||||
|
||||
if ( ! $( block ) )
|
||||
{
|
||||
block = elem.up('div').down('ol');
|
||||
}
|
||||
|
||||
if ( ! $( block ) )
|
||||
{
|
||||
block = elem.up('div').down('div');
|
||||
}
|
||||
|
||||
if ( ! $( block ) )
|
||||
{
|
||||
block = elem.up('div').down('table');
|
||||
}
|
||||
|
||||
if ( $( block ) )
|
||||
{
|
||||
$( block ).identify();
|
||||
|
||||
ipb.board.animating = true;
|
||||
|
||||
if ( $( block ).visible() )
|
||||
{
|
||||
if ( $( top ).hasClassName('alt') )
|
||||
{
|
||||
$( top )._isAlt = true;
|
||||
$( top ).removeClassName('alt');
|
||||
}
|
||||
|
||||
top.down('.index_stats_collapse').removeClassName('open').addClassName('close');
|
||||
|
||||
Debug.write( "Adding " + topId );
|
||||
cookie.push( topId );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $( top )._isAlt )
|
||||
{
|
||||
$( top ).addClassName('alt');
|
||||
}
|
||||
|
||||
top.down('.index_stats_collapse').removeClassName('close').addClassName('open');
|
||||
|
||||
Debug.write( "Removing " + topId );
|
||||
remove.push( topId );
|
||||
}
|
||||
|
||||
Effect.toggle( block, 'blind', {duration: 0.4, afterFinish: function(){ ipb.board.animating = false; } } );
|
||||
}
|
||||
|
||||
cookie = "," + cookie.uniq().without( remove ).join(',') + ",";
|
||||
|
||||
ipb.Cookie.set('toggleSBlocks', cookie, 1);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Check for DST
|
||||
*/
|
||||
@@ -250,6 +441,6 @@ _idx.prototype.board = {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.board.init();
|
||||
@@ -132,7 +132,7 @@ _cal.prototype.calendar = {
|
||||
$( popup.inner ).select('.cancel').each( function(s){
|
||||
s.observe('click', function(e){
|
||||
popup.destroy();
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -169,5 +169,6 @@ _cal.prototype.calendar = {
|
||||
} );
|
||||
}
|
||||
|
||||
}
|
||||
ipb.calendar.init();
|
||||
};
|
||||
|
||||
ipb.calendar.init();
|
||||
+2536
-34
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,680 +0,0 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.board.js - Board index code */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Rikki Tissier */
|
||||
/************************************************/
|
||||
|
||||
var _idx = window.IPBoard;
|
||||
|
||||
_idx.prototype.downloads = {
|
||||
totalChecked: 0,
|
||||
lastFileId: 0,
|
||||
lastScreenshotId: 0,
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.downloads.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
ipb.downloads.setUpToggle();
|
||||
ipb.downloads.initEvents();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Init events for cat listing
|
||||
*/
|
||||
initEvents: function()
|
||||
{
|
||||
if( $('show_filters') )
|
||||
{
|
||||
$('show_filters').observe('click', ipb.downloads.toggleFilters );
|
||||
$('filter_form').hide();
|
||||
}
|
||||
|
||||
/* Set up mod checkboxes for cats */
|
||||
if( $('files_all') )
|
||||
{
|
||||
ipb.downloads.preCheckFiles();
|
||||
$('files_all').observe( 'click', ipb.downloads.checkAllFiles );
|
||||
}
|
||||
|
||||
$$('.topic_mod').each( function(check){
|
||||
check.observe( 'click', ipb.downloads.checkFile );
|
||||
} );
|
||||
|
||||
/* Checkboxes in moderation panel */
|
||||
$$('.check_all').each( function(check){
|
||||
check.observe( 'click', ipb.downloads.checkAllInForm );
|
||||
} );
|
||||
|
||||
/* Checkboxes in moderation panel */
|
||||
$$('.delete_link').each( function(check){
|
||||
check.observe( 'click', ipb.downloads.checkConfirm );
|
||||
} );
|
||||
|
||||
$$('.topic_moderation').each( function(check){
|
||||
check.observe( 'click', ipb.downloads.checkModfile );
|
||||
} );
|
||||
|
||||
if( $('showUploadField') )
|
||||
{
|
||||
$('showUploadField').observe('click', ipb.downloads.toggleField );
|
||||
}
|
||||
|
||||
if( $('showEstimates') )
|
||||
{
|
||||
$('showEstimates').observe('click', ipb.downloads.showEstimates );
|
||||
}
|
||||
|
||||
if( $('showEmailForm') )
|
||||
{
|
||||
$('showEmailForm').observe('click', ipb.downloads.showEmailForm );
|
||||
}
|
||||
|
||||
// Resize images
|
||||
$$('.download-description').each( function(elem){
|
||||
ipb.global.findImgs( $( elem ) );
|
||||
});
|
||||
|
||||
if( typeof(hidecomments) != 'undefined' && hidecomments )
|
||||
{
|
||||
if( showcomments )
|
||||
{
|
||||
if( $('displayComments') )
|
||||
{
|
||||
$('displayComments').observe('click', function(e){ Event.stop(e); new Effect.ScrollTo( 'comments-wrapper', { offset: -50 } ); } );
|
||||
}
|
||||
|
||||
if( $('comment' + showcomments ) )
|
||||
{
|
||||
new Effect.ScrollTo( 'comment' + showcomments, { offset: 0 } );
|
||||
}
|
||||
else
|
||||
{
|
||||
new Effect.ScrollTo( 'comments-wrapper', { offset: -50 } );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$('comments-wrapper').hide();
|
||||
|
||||
if( $('displayComments') )
|
||||
{
|
||||
$('displayComments').observe('click', ipb.downloads.showMeComments );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( typeof(showcomments) != 'undefined' && showcomments )
|
||||
{
|
||||
if( $('comment' + showcomments ) )
|
||||
{
|
||||
new Effect.ScrollTo( 'comment' + showcomments, { offset: 0 } );
|
||||
}
|
||||
else
|
||||
{
|
||||
new Effect.ScrollTo( 'comments-wrapper', { offset: -50 } );
|
||||
}
|
||||
}
|
||||
|
||||
if( $('view-screenshots') )
|
||||
{
|
||||
$('view-screenshots').observe('click', ipb.downloads.toggleScreenshots );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle screenshots display
|
||||
*/
|
||||
toggleScreenshots: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if( $('file_action_bar').hasClassName('after_download_link') )
|
||||
{
|
||||
$('file_action_bar').removeClassName('after_download_link');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('file_action_bar').addClassName('after_download_link');
|
||||
}
|
||||
|
||||
Effect.toggle( $('file_screenshots'), 'blind', {duration: 0.2} );
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize submit form. Handles the upload/link/path stuff.
|
||||
*/
|
||||
initSubmitForm: function()
|
||||
{
|
||||
if( $('file-management-path') )
|
||||
{
|
||||
$('file-management-path').hide();
|
||||
|
||||
/* Init links */
|
||||
$('show-file-path-field').observe( 'click', ipb.downloads.toggleFilePane );
|
||||
$('show-file-normal-field').observe( 'click', ipb.downloads.toggleFilePane );
|
||||
}
|
||||
|
||||
if( $('ss-management-path') )
|
||||
{
|
||||
$('ss-management-path').hide();
|
||||
|
||||
/* Init links */
|
||||
$('show-ss-path-field').observe( 'click', ipb.downloads.toggleScreenshotPane );
|
||||
$('show-ss-normal-field').observe( 'click', ipb.downloads.toggleScreenshotPane );
|
||||
}
|
||||
|
||||
if( $('add_new_link') )
|
||||
{
|
||||
$('add_new_link').observe( 'click', ipb.downloads.addFileLink );
|
||||
}
|
||||
|
||||
if( $('add_new_ss') )
|
||||
{
|
||||
$('add_new_ss').observe( 'click', ipb.downloads.addScreenshotLink );
|
||||
}
|
||||
},
|
||||
|
||||
addFileLink: function(e)
|
||||
{
|
||||
ipb.downloads.lastFileId = ipb.downloads.lastFileId + 1;
|
||||
var html = ipb.templates['new_file_link'].evaluate( { id: ipb.downloads.lastFileId } );
|
||||
|
||||
$( 'linked-file-allowed' ).insert( { before: html } );
|
||||
|
||||
Event.stop(e);
|
||||
return false;
|
||||
},
|
||||
|
||||
addScreenshotLink: function(e)
|
||||
{
|
||||
ipb.downloads.lastScreenshotId = ipb.downloads.lastScreenshotId + 1;
|
||||
var html = ipb.templates['new_ss_link'].evaluate( { id: ipb.downloads.lastScreenshotId } );
|
||||
|
||||
$( 'linked-ss-allowed' ).insert( { before: html } );
|
||||
|
||||
Event.stop(e);
|
||||
return false;
|
||||
},
|
||||
|
||||
toggleFilePane: function(e)
|
||||
{
|
||||
if( $('file-management-path').visible() )
|
||||
{
|
||||
new Effect.Parallel([
|
||||
new Effect.BlindUp( $('file-management-path'), { sync: true } ),
|
||||
new Effect.BlindDown( $('file-management-normal'), { sync: true } )
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
new Effect.Parallel([
|
||||
new Effect.BlindDown( $('file-management-path'), { sync: true } ),
|
||||
new Effect.BlindUp( $('file-management-normal'), { sync: true } )
|
||||
]);
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
return false;
|
||||
},
|
||||
|
||||
toggleScreenshotPane: function(e)
|
||||
{
|
||||
if( $('ss-management-path').visible() )
|
||||
{
|
||||
new Effect.Parallel([
|
||||
new Effect.BlindUp( $('ss-management-path'), { sync: true } ),
|
||||
new Effect.BlindDown( $('ss-management-normal'), { sync: true } )
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
new Effect.Parallel([
|
||||
new Effect.BlindDown( $('ss-management-path'), { sync: true } ),
|
||||
new Effect.BlindUp( $('ss-management-normal'), { sync: true } )
|
||||
]);
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
return false;
|
||||
},
|
||||
|
||||
showMeComments: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
$('comments-wrapper').toggle();
|
||||
|
||||
new Effect.ScrollTo( 'comments-wrapper', { offset: -50 } );
|
||||
},
|
||||
|
||||
checkEmailForm: function(e)
|
||||
{
|
||||
if( !$('field-email').value )
|
||||
{
|
||||
alert( ipb.lang['idm_msg_email'] );
|
||||
Event.stop(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !$('field-content').value )
|
||||
{
|
||||
alert( ipb.lang['idm_msg_text'] );
|
||||
Event.stop(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
showEstimates: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
popup = new ipb.Popup( 'dlestimates', { type: 'pane', modal: false, w: '500px', initial: $('dlestimates').innerHTML, hideAtStart: false, close: 'a[rel="close"]' } );
|
||||
return false;
|
||||
},
|
||||
|
||||
showEmailForm: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
popup = new ipb.Popup( 'email_form', { type: 'pane', modal: false, w: '500px', initial: $('email_form').innerHTML, hideAtStart: false, close: 'a[rel="close"]' } );
|
||||
|
||||
//$('email_form').innerHTML = '';
|
||||
|
||||
if( $('email-form_form') )
|
||||
{
|
||||
$('email-form_form').observe('submit', ipb.downloads.checkEmailForm);
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggling the upload field displaying
|
||||
*/
|
||||
toggleField: function(e)
|
||||
{
|
||||
if( $('uploadField') )
|
||||
{
|
||||
Event.stop(e);
|
||||
Effect.toggle( $('uploadField'), 'blind', {duration: 0.2} );
|
||||
Effect.toggle( $('uploadText'), 'blind', {duration: 0.2} );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Confirmation for all delete links
|
||||
*/
|
||||
checkConfirm: function(e)
|
||||
{
|
||||
if( !confirm( ipb.lang['delete_confirm'] ) )
|
||||
{
|
||||
Event.stop(e);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Moderator submitting the mod form
|
||||
*/
|
||||
submitModForm: function(e)
|
||||
{
|
||||
var action = $( Event.findElement(e, 'form') ).down('select');
|
||||
|
||||
// Check for delete action
|
||||
if( $F(action) == 'del' ){
|
||||
if( !confirm( ipb.lang['delete_confirm'] ) ){
|
||||
Event.stop(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Inits the forum tables ready for collapsing
|
||||
*/
|
||||
setUpToggle: function()
|
||||
{
|
||||
$$('.ipb_table').each( function(tab){
|
||||
$( tab ).wrap( 'div', { 'class': 'table_wrap' } );
|
||||
});
|
||||
|
||||
$$('.category_block').each( function(cat){
|
||||
if( $(cat).select('.toggle')[0] )
|
||||
{
|
||||
$(cat).select('.toggle')[0].observe( 'click', ipb.downloads.toggleCat );
|
||||
}
|
||||
});
|
||||
|
||||
cookie = ipb.Cookie.get('toggleIdmCats');
|
||||
|
||||
if( cookie )
|
||||
{
|
||||
var cookies = cookie.split( ',' );
|
||||
|
||||
//-------------------------
|
||||
// Little fun for you...
|
||||
//-------------------------
|
||||
for( var abcdefg=0; abcdefg < cookies.length; abcdefg++ )
|
||||
{
|
||||
if( cookies[ abcdefg ] )
|
||||
{
|
||||
var wrapper = $( cookies[ abcdefg ] ).up('.category_block').down('.table_wrap');
|
||||
|
||||
wrapper.hide();
|
||||
$( cookies[ abcdefg ] ).addClassName('collapsed');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Show/hide a category
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
toggleCat: function(e)
|
||||
{
|
||||
var click = Event.element(e);
|
||||
var remove = $A();
|
||||
var wrapper = $( click ).up('.category_block').down('.table_wrap');
|
||||
catname = $( click ).up('h3');
|
||||
var catid = catname.id;
|
||||
|
||||
// Get cookie
|
||||
cookie = ipb.Cookie.get('toggleIdmCats');
|
||||
if( cookie == null ){
|
||||
cookie = $A();
|
||||
} else {
|
||||
cookie = cookie.split(',');
|
||||
}
|
||||
|
||||
Effect.toggle( wrapper, 'blind', {duration: 0.4} );
|
||||
|
||||
if( catname.hasClassName('collapsed') )
|
||||
{
|
||||
catname.removeClassName('collapsed');
|
||||
remove.push( catid );
|
||||
}
|
||||
else
|
||||
{
|
||||
new Effect.Morph( $(catname), {style: 'collapsed', duration: 0.4, afterFinish: function(){
|
||||
$( catname ).addClassName('collapsed');
|
||||
} });
|
||||
cookie.push( catid );
|
||||
}
|
||||
|
||||
cookie = "," + cookie.uniq().without( remove ).join(',') + ",";
|
||||
ipb.Cookie.set('toggleIdmCats', cookie, 1);
|
||||
|
||||
Event.stop( e );
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggling the filters
|
||||
*/
|
||||
toggleFilters: function(e)
|
||||
{
|
||||
if( $('filter_form') )
|
||||
{
|
||||
Effect.toggle( $('filter_form'), 'blind', {duration: 0.2} );
|
||||
Effect.toggle( $('show_filters'), 'blind', {duration: 0.2} );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check the files we've selected
|
||||
*/
|
||||
preCheckFiles: function()
|
||||
{
|
||||
topics = $F('selectedfileids').split(',');
|
||||
|
||||
var checkboxesOnPage = 0;
|
||||
var checkedOnPage = 0;
|
||||
|
||||
if( topics )
|
||||
{
|
||||
topics.each( function(check){
|
||||
if( check != '' )
|
||||
{
|
||||
if( $('file_' + check ) )
|
||||
{
|
||||
checkedOnPage++;
|
||||
$('file_' + check ).checked = true;
|
||||
}
|
||||
|
||||
ipb.downloads.totalChecked++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$$('.topic_mod').each( function(check){
|
||||
checkboxesOnPage++;
|
||||
} );
|
||||
|
||||
if( checkedOnPage == checkboxesOnPage && checkboxesOnPage > 0 )
|
||||
{
|
||||
$('files_all').checked = true;
|
||||
}
|
||||
|
||||
ipb.downloads.updateFileModButton();
|
||||
},
|
||||
|
||||
/**
|
||||
* Check all the files in this form
|
||||
*/
|
||||
checkAllInForm: function(e)
|
||||
{
|
||||
checked = 0;
|
||||
check = Event.findElement(e, 'input');
|
||||
toCheck = $F(check);
|
||||
form = check.up('form');
|
||||
selectedTopics = new Array;
|
||||
|
||||
form.select('.selectedfileids').each( function(field){
|
||||
selectedTopics = field.value.split(',').compact();
|
||||
});
|
||||
|
||||
toRemove = new Array();
|
||||
|
||||
form.select('.topic_moderation').each( function(check){
|
||||
if( toCheck != null )
|
||||
{
|
||||
check.checked = true;
|
||||
selectedTopics.push( check.id.replace('file_', '') );
|
||||
checked++;
|
||||
}
|
||||
else
|
||||
{
|
||||
check.checked = false;
|
||||
toRemove.push( check.id.replace('file_', '') );
|
||||
}
|
||||
});
|
||||
|
||||
selectedTopics = selectedTopics.uniq().without( toRemove ).join(',');
|
||||
|
||||
form.select('.submit_button').each( function(button)
|
||||
{
|
||||
if( checked == 0 ){
|
||||
button.disabled = true;
|
||||
} else {
|
||||
button.disabled = false;
|
||||
}
|
||||
|
||||
button.value = ipb.lang['with_selected'].replace('{num}', checked);
|
||||
});
|
||||
|
||||
form.select('.selectedfileids').each( function(hidden)
|
||||
{
|
||||
hidden.value = selectedTopics;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Check a file on the moderation form
|
||||
*/
|
||||
checkModfile: function(e)
|
||||
{
|
||||
check = Event.findElement(e, 'input');
|
||||
toCheck = $(check);
|
||||
form = check.up('form');
|
||||
|
||||
var checkboxesOnPage = 0;
|
||||
var checkedOnPage = 0;
|
||||
|
||||
form.select('.selectedfileids').each( function(field){
|
||||
selectedTopics = field.value.split(',').compact();
|
||||
});
|
||||
remove = new Array();
|
||||
|
||||
form.select('.topic_moderation').each( function(check){
|
||||
checkboxesOnPage++;
|
||||
|
||||
if( check.checked == true )
|
||||
{
|
||||
checkedOnPage++;
|
||||
selectedTopics.push( check.id.replace('file_', '') );
|
||||
}
|
||||
else
|
||||
{
|
||||
remove.push( check.id.replace('file_', '') );
|
||||
form.select('.check_all')[0].checked = false;
|
||||
}
|
||||
} );
|
||||
|
||||
if( checkedOnPage == checkboxesOnPage )
|
||||
{
|
||||
form.select('.check_all')[0].checked = true;
|
||||
}
|
||||
|
||||
selectedTopics = selectedTopics.uniq().without( remove ).join(',');
|
||||
|
||||
form.select('.submit_button').each( function(button)
|
||||
{
|
||||
if( checkedOnPage == 0 ){
|
||||
button.disabled = true;
|
||||
} else {
|
||||
button.disabled = false;
|
||||
}
|
||||
|
||||
button.value = ipb.lang['with_selected'].replace('{num}', checkedOnPage);
|
||||
});
|
||||
|
||||
form.select('.selectedfileids').each( function(hidden)
|
||||
{
|
||||
hidden.value = selectedTopics;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Check all the files
|
||||
*/
|
||||
checkAllFiles: function(e)
|
||||
{
|
||||
check = Event.findElement(e, 'input');
|
||||
toCheck = $F(check);
|
||||
ipb.downloads.totalChecked = 0;
|
||||
toRemove = new Array();
|
||||
selectedTopics = $F('selectedfileids').split(',').compact();
|
||||
|
||||
$$('.topic_mod').each( function(check){
|
||||
if( toCheck != null )
|
||||
{
|
||||
check.checked = true;
|
||||
selectedTopics.push( check.id.replace('file_', '') );
|
||||
ipb.downloads.totalChecked++;
|
||||
}
|
||||
else
|
||||
{
|
||||
toRemove.push( check.id.replace('file_', '') );
|
||||
check.checked = false;
|
||||
}
|
||||
});
|
||||
|
||||
selectedTopics = selectedTopics.uniq().without( toRemove ).join(',');
|
||||
ipb.Cookie.set('modfileids', selectedTopics, 0);
|
||||
|
||||
$('selectedfileids').value = selectedTopics;
|
||||
|
||||
ipb.downloads.updateFileModButton();
|
||||
},
|
||||
|
||||
/**
|
||||
* Check a single file
|
||||
*/
|
||||
checkFile: function(e)
|
||||
{
|
||||
remove = new Array();
|
||||
check = Event.findElement( e, 'input' );
|
||||
selectedTopics = $F('selectedfileids').split(',').compact();
|
||||
|
||||
var checkboxesOnPage = 0;
|
||||
var checkedOnPage = 0;
|
||||
|
||||
if( check.checked == true )
|
||||
{
|
||||
selectedTopics.push( check.id.replace('file_', '') );
|
||||
ipb.downloads.totalChecked++;
|
||||
}
|
||||
else
|
||||
{
|
||||
remove.push( check.id.replace('file_', '') );
|
||||
ipb.downloads.totalChecked--;
|
||||
}
|
||||
|
||||
$$('.topic_mod').each( function(check){
|
||||
checkboxesOnPage++;
|
||||
|
||||
if( $(check).checked == true )
|
||||
{
|
||||
checkedOnPage++;
|
||||
}
|
||||
} );
|
||||
|
||||
if( $('files_all' ) )
|
||||
{
|
||||
if( checkedOnPage == checkboxesOnPage )
|
||||
{
|
||||
$('files_all' ).checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('files_all' ).checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
selectedTopics = selectedTopics.uniq().without( remove ).join(',');
|
||||
ipb.Cookie.set('modfileids', selectedTopics, 0);
|
||||
|
||||
$('selectedfileids').value = selectedTopics;
|
||||
|
||||
ipb.downloads.updateFileModButton();
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the moderation button
|
||||
*/
|
||||
updateFileModButton: function( )
|
||||
{
|
||||
if( $('mod_submit') )
|
||||
{
|
||||
if( ipb.downloads.totalChecked == 0 ){
|
||||
$('mod_submit').disabled = true;
|
||||
} else {
|
||||
$('mod_submit').disabled = false;
|
||||
}
|
||||
|
||||
$('mod_submit').value = ipb.lang['with_selected'].replace('{num}', ipb.downloads.totalChecked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ipb.downloads.init();
|
||||
+198
-40
@@ -25,11 +25,16 @@ _editor_rte = Class.create({
|
||||
{
|
||||
},
|
||||
editor_write_contents: function( text, do_init )
|
||||
{
|
||||
if ( text.blank() && Prototype.Browser.Gecko )
|
||||
{
|
||||
|
||||
if ( ( Object.isUndefined(text) || text === false || text.blank() ) && Prototype.Browser.Gecko )
|
||||
{
|
||||
text = '<br />';
|
||||
}
|
||||
else if ( Object.isUndefined(text) || text === false )
|
||||
{
|
||||
text = '';
|
||||
}
|
||||
|
||||
if ( this.editor_document && this.editor_document.initialized )
|
||||
{
|
||||
@@ -106,7 +111,7 @@ _editor_rte = Class.create({
|
||||
else
|
||||
{
|
||||
// Bug #17772
|
||||
if( !Object.isUndefined( init_text ) )
|
||||
if( !Object.isUndefined( init_text ) && init_text != false )
|
||||
{
|
||||
init_text = init_text.replace( /§/g, "&sect");
|
||||
}
|
||||
@@ -150,12 +155,35 @@ _editor_rte = Class.create({
|
||||
this.editor_window = this.editor_box.contentWindow;
|
||||
this.editor_document = this.editor_window.document;
|
||||
|
||||
this.editor_write_contents( (Object.isUndefined( init_text ) || ! init_text ? this.items['text_obj'].value : init_text), true );
|
||||
|
||||
if ( ! this.items['text_obj'].value && ( init_text === false || Object.isUndefined( init_text ) ) )
|
||||
{
|
||||
/* Wipe editor */
|
||||
this.editor_write_contents(false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.editor_write_contents( (Object.isUndefined( init_text ) || ! init_text ? this.items['text_obj'].value : init_text), true );
|
||||
}
|
||||
|
||||
this.editor_document.editor_id = this.editor_id;
|
||||
this.editor_window.editor_id = this.editor_id;
|
||||
this.editor_window.has_focus = false;
|
||||
|
||||
// Go on.. cursor, flash you bastard
|
||||
try
|
||||
{
|
||||
Debug.write( "Attempt to get focus" );
|
||||
this.editor_check_focus();
|
||||
|
||||
// Sometimes moves the focus to the RTE
|
||||
this.editor_document.execCommand("InsertHorizontalRule", false, null);
|
||||
this.editor_document.execCommand("undo" , false, null);
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
Debug.write( "#011 " + error );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill tags
|
||||
//-----------------------------------------
|
||||
@@ -206,14 +234,20 @@ _editor_rte = Class.create({
|
||||
}
|
||||
|
||||
this.editor_document.execCommand( cmd, dialog, argument );
|
||||
|
||||
this._ie_cache = null;
|
||||
return false;
|
||||
},
|
||||
/* ! get_selection */
|
||||
get_selection: function()
|
||||
{
|
||||
var rng = this._ie_cache ? this._ie_cache : this.editor_document.selection.createRange();
|
||||
|
||||
//Debug.write( 'get selection: ie_cache:' + this._ie_cache.htmlText + '.' );
|
||||
|
||||
if ( rng.htmlText )
|
||||
{
|
||||
Debug.write( 'htmlTest:' + rng.htmlText + '.' );
|
||||
return rng.htmlText;
|
||||
}
|
||||
else
|
||||
@@ -377,10 +411,10 @@ _editor_rte = Class.create({
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/* ! insert_text */
|
||||
insert_text: function(text)
|
||||
{
|
||||
//Debug.write( this.editor_document );
|
||||
Debug.write( "Inserting " + text + "." );
|
||||
this.editor_check_focus();
|
||||
|
||||
if ( typeof( this.editor_document.selection ) != 'undefined'
|
||||
@@ -390,28 +424,24 @@ _editor_rte = Class.create({
|
||||
this.editor_document.selection.clear();
|
||||
}
|
||||
|
||||
/*if( this.get_selection() ){
|
||||
var sel = this._ie_cache;
|
||||
} else {
|
||||
var sel = this.editor_document.selection.createRange();
|
||||
}*/
|
||||
|
||||
var sel = this._ie_cache ? this._ie_cache : this.editor_document.selection.createRange();
|
||||
|
||||
sel.pasteHTML(text);
|
||||
sel.select();
|
||||
this._ie_cache = null;
|
||||
},
|
||||
|
||||
/* ! insert_emoticon */
|
||||
insert_emoticon: function( emo_id, emo_image, emo_code, event )
|
||||
{
|
||||
Debug.write( "Adding emoticon " + emo_code );
|
||||
|
||||
try
|
||||
{
|
||||
//this._ie_cache = null;
|
||||
// INIT
|
||||
var _emo_url = ipb.vars['emoticon_url'] + "/" + emo_image;
|
||||
var _emo_html = ' <img src="' + _emo_url + '" class="bbc_emoticon" alt="' + this.unhtmlspecialchars( emo_code ) + '" />';
|
||||
|
||||
this.wrap_tags_lite( " " + _emo_html, " ");
|
||||
this.wrap_tags_lite( " " + _emo_html, " ", false);
|
||||
}
|
||||
catch( error )
|
||||
{
|
||||
@@ -493,6 +523,13 @@ _editor_rte = Class.create({
|
||||
{
|
||||
Debug.write("Updating for submit");
|
||||
this.items['text_obj'].value = this.editor_get_contents();
|
||||
Debug.write( "Before: " + this.items['text_obj'].value );
|
||||
// IE does crappy things. </3
|
||||
if ( Prototype.Browser.IE )
|
||||
{
|
||||
this.items['text_obj'].value = this.items['text_obj'].value.replace( / /g, ' ' );
|
||||
this.items['text_obj'].value = this.items['text_obj'].value.replace( /\s+?$/, '' );
|
||||
}
|
||||
|
||||
// http://trac.webkit.org/changeset/47640
|
||||
// Safari bug with execcommand and underline + strikethrough
|
||||
@@ -501,7 +538,7 @@ _editor_rte = Class.create({
|
||||
this.items['text_obj'].value = this.items['text_obj'].value.replace( /<span class="Apple-style-span" style="text-decoration: underline;">([^>]*)<\/span>/gi, "<u>$1</u>" );
|
||||
this.items['text_obj'].value = this.items['text_obj'].value.replace( /<span class="Apple-style-span" style="text-decoration: line-through;">([^>]*)<\/span>/gi, "<strike>$1</strike>" );
|
||||
}
|
||||
|
||||
Debug.write( "After: " + this.items['text_obj'].value );
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@@ -528,8 +565,8 @@ _editor_std = Class.create({
|
||||
this.editor_window = this.items['text_obj'];
|
||||
this.editor_document = this.items['text_obj'];
|
||||
this.editor_box = this.items['text_obj'];
|
||||
|
||||
if( !Object.isUndefined( init_text ) )
|
||||
|
||||
if( !Object.isUndefined( init_text ) && init_text !== false )
|
||||
{
|
||||
this.editor_write_contents( init_text );
|
||||
}
|
||||
@@ -564,7 +601,10 @@ _editor_std = Class.create({
|
||||
},
|
||||
editor_write_contents: function(text)
|
||||
{
|
||||
this.items['text_obj'].value = text;
|
||||
if ( text !== false )
|
||||
{
|
||||
this.items['text_obj'].value = text;
|
||||
}
|
||||
},
|
||||
editor_get_contents: function()
|
||||
{
|
||||
@@ -663,14 +703,14 @@ _editor_std = Class.create({
|
||||
//Debug.write('Set context');
|
||||
},
|
||||
get_selection: function()
|
||||
{
|
||||
if ( !Object.isUndefined( this.editor_document.selectionStart ) )
|
||||
{
|
||||
if ( !Object.isUndefined( this.editor_document.selectionStart ) )
|
||||
{
|
||||
return this.editor_document.value.substr(this.editor_document.selectionStart, this.editor_document.selectionEnd - this.editor_document.selectionStart);
|
||||
}
|
||||
else if ( ( document.selection && document.selection.createRange ) || this._ie_cache )
|
||||
{
|
||||
return this._ie_cache ? this._ie_cache.text : document.selection.createRange().text;
|
||||
return ( ! document.selection.createRange().text && this._ie_cache ) ? this._ie_cache.text : document.selection.createRange().text;
|
||||
}
|
||||
else if ( window.getSelection )
|
||||
{
|
||||
@@ -897,7 +937,7 @@ _editor_std = Class.create({
|
||||
// MAIN EDITOR CODE
|
||||
|
||||
if( USE_RTE ){//&& !Prototype.Browser.WebKit ){ // Dont support safari
|
||||
Debug.write("Extending with RTE")
|
||||
Debug.write("Extending with RTE");
|
||||
_type = _editor_rte;
|
||||
} else {
|
||||
Debug.write("Extending with STD");
|
||||
@@ -938,6 +978,7 @@ _editor.prototype.editor = Class.create(_type, {
|
||||
this.key_handlers = [];
|
||||
this.showing_sidebar = false;
|
||||
this.emoticons_loaded = false;
|
||||
this.emoClick = false;
|
||||
|
||||
this.options = Object.extend({
|
||||
file_path: '',
|
||||
@@ -947,7 +988,6 @@ _editor.prototype.editor = Class.create(_type, {
|
||||
button_update: []
|
||||
}, arguments[3] || {});
|
||||
|
||||
|
||||
this.button_update = $A( [ "bold", "italic", "underline", "justifyleft", "justifycenter",
|
||||
"justifyright", "insertorderedlist", "insertunorderedlist", "superscript", "subscript", "strikethrough" ].concat( this.options.button_update ) );
|
||||
|
||||
@@ -985,6 +1025,7 @@ _editor.prototype.editor = Class.create(_type, {
|
||||
|
||||
Debug.write("All editor initialization complete");
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Initialization
|
||||
@@ -1111,7 +1152,7 @@ _editor.prototype.editor = Class.create(_type, {
|
||||
*/
|
||||
resize_to: function( size )
|
||||
{
|
||||
var afterFinish = function(){}
|
||||
var afterFinish = function(){};
|
||||
|
||||
// Bug #17799
|
||||
// Opera 10 wouldn't resize the emoticon pane when the editor resize buttons were used
|
||||
@@ -1162,9 +1203,30 @@ _editor.prototype.editor = Class.create(_type, {
|
||||
ips_frame_html += " background: #FFFFFF;\n";
|
||||
ips_frame_html += " margin: 0px;\n";
|
||||
ips_frame_html += " padding: 4px;\n";
|
||||
ips_frame_html += " font-family: Verdana, arial, sans-serif;\n";
|
||||
ips_frame_html += " font-family: arial, verdana, tahoma, sans-serif;\n";
|
||||
ips_frame_html += " font-size: 9pt;\n";
|
||||
ips_frame_html += "}\n";
|
||||
ips_frame_html += "font[size=\"1\"] {\n";
|
||||
ips_frame_html += " font-size: 9px;\n";
|
||||
ips_frame_html += "}\n";
|
||||
ips_frame_html += "font[size=\"2\"] {\n";
|
||||
ips_frame_html += " font-size: 13px;\n";
|
||||
ips_frame_html += "}\n";
|
||||
ips_frame_html += "font[size=\"3\"] {\n";
|
||||
ips_frame_html += " font-size: 15px;\n";
|
||||
ips_frame_html += "}\n";
|
||||
ips_frame_html += "font[size=\"4\"] {\n";
|
||||
ips_frame_html += " font-size: 17px;\n";
|
||||
ips_frame_html += "}\n";
|
||||
ips_frame_html += "font[size=\"5\"] {\n";
|
||||
ips_frame_html += " font-size: 21px;\n";
|
||||
ips_frame_html += "}\n";
|
||||
ips_frame_html += "font[size=\"6\"] {\n";
|
||||
ips_frame_html += " font-size: 26px;\n";
|
||||
ips_frame_html += "}\n";
|
||||
ips_frame_html += "font[size=\"7\"] {\n";
|
||||
ips_frame_html += " font-size: 36px;\n";
|
||||
ips_frame_html += "}\n";
|
||||
ips_frame_html += "</style>\n";
|
||||
|
||||
if( isRTL && rtlFull )
|
||||
@@ -1452,7 +1514,7 @@ _editor.prototype.editor = Class.create(_type, {
|
||||
|
||||
elem.insert( { after: wrap } );
|
||||
}
|
||||
|
||||
|
||||
// Init function for IE
|
||||
var beforeOpen = function( menu ){
|
||||
this.editor_check_focus();
|
||||
@@ -1507,7 +1569,7 @@ _editor.prototype.editor = Class.create(_type, {
|
||||
}
|
||||
|
||||
td = new Element('td', { id: this.id + '_' + elem.readAttribute('cmd') + '_color_' + color } );
|
||||
td.setStyle('background-color: #' + color).writeAttribute('colorname', color);
|
||||
td.setStyle('background-color: #' + color).setStyle('background-image: none').writeAttribute('colorname', color);
|
||||
|
||||
tr.insert( td );
|
||||
|
||||
@@ -1920,6 +1982,7 @@ _editor.prototype.editor = Class.create(_type, {
|
||||
|
||||
return false;
|
||||
},
|
||||
/* ! wrap_tags_lite */
|
||||
wrap_tags_lite: function( start_text, close_text, replace_selection )
|
||||
{
|
||||
selected_text = '';
|
||||
@@ -1935,11 +1998,15 @@ _editor.prototype.editor = Class.create(_type, {
|
||||
|
||||
return false;
|
||||
},
|
||||
/* ! preserve_ie_range */
|
||||
preserve_ie_range: function()
|
||||
{
|
||||
if ( Prototype.Browser.IE && document.selection )
|
||||
if ( Prototype.Browser.IE && document.selection && ! this.emoClick )
|
||||
{
|
||||
this._ie_cache = this.is_rte ? this.editor_document.selection.createRange() : document.selection.createRange();
|
||||
/* Don't preserve range for emoticon click. It buggers things up epically */
|
||||
this._ie_cache = this.is_rte ? ( this.editor_document.selection.createRange ) ? this.editor_document.selection.createRange() : null : document.selection.createRange();
|
||||
Debug.write( "Preserved IE Range: ");
|
||||
this.emoClick = false;
|
||||
}
|
||||
},
|
||||
clean_html: function( t )
|
||||
@@ -2471,9 +2538,8 @@ if( ( Prototype.Browser.Gecko || Prototype.Browser.WebKit ) && USE_RTE ){
|
||||
this.emoticon_window_id.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//==============================================================================================================//
|
||||
// OPERA SPECIFIC CODE
|
||||
@@ -2644,6 +2710,13 @@ _editor_events = Class.create({
|
||||
Debug.write("Here 2");
|
||||
var option = ( $(this.id + '_' + styleid + '_option') ) ? $F( this.id + '_' + styleid + '_option' ) : '';
|
||||
|
||||
// If this is RTE, change newlines to br tags.
|
||||
// @link http://community.invisionpower.com/tracker/issue-21173-line-breaks-arent-converted-to-%26lt%3Bbr%26gt%3B-in-code-popup-in-rte/
|
||||
if( USE_RTE )
|
||||
{
|
||||
value = value.replace( /\n/g, '<br />' );
|
||||
}
|
||||
|
||||
if( ( info['optional_option'] == '1' && option.blank() ) || info['useoption'] == '0' ){
|
||||
this.wrap_tags_lite( '[' + info['tag'] + ']' + value, '[/' + info['tag'] + ']', 1 );
|
||||
} else {
|
||||
@@ -2663,12 +2736,17 @@ _editor_events = Class.create({
|
||||
|
||||
this.palettes[ 'otherstyles_' + styleid ].doClose();
|
||||
},
|
||||
|
||||
/* ! editor_document_onmouseup */
|
||||
editor_document_onmouseup: function(e)
|
||||
{
|
||||
Debug.write("Mouse up");
|
||||
ipb.menus.closeAll(); // Close menus
|
||||
this.set_context();
|
||||
|
||||
if ( Prototype.Browser.IE )
|
||||
{
|
||||
//this.preserve_ie_range();
|
||||
}
|
||||
},
|
||||
editor_document_onkeyup: function(e)
|
||||
{
|
||||
@@ -2757,7 +2835,14 @@ _editor_events = Class.create({
|
||||
else if( elem.readAttribute('cmd') == 'help' )
|
||||
{
|
||||
//Event.stop(e);
|
||||
window.open( ipb.vars['base_url'] + "&app=forums&module=extras§ion=legends&do=bbcode", "bbcode", "status=0,toolbar=0,width=1024,height=800,scrollbars=1");
|
||||
if( inACP )
|
||||
{
|
||||
window.open( ipb.vars['front_url'] + "&app=forums&module=extras§ion=legends&do=bbcode", "bbcode", "status=0,toolbar=0,width=1024,height=800,scrollbars=1");
|
||||
}
|
||||
else
|
||||
{
|
||||
window.open( ipb.vars['base_url'] + "&app=forums&module=extras§ion=legends&do=bbcode", "bbcode", "status=0,toolbar=0,width=1024,height=800,scrollbars=1");
|
||||
}
|
||||
Event.stop(e);
|
||||
return false;
|
||||
}
|
||||
@@ -2924,7 +3009,7 @@ _editor_events = Class.create({
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
this.insert_emoticon( emo.readAttribute('emo_id'), emo.readAttribute('emo_img'), emo.readAttribute('emo_code'), e );
|
||||
},
|
||||
link_onclick: function(e)
|
||||
@@ -2950,6 +3035,24 @@ _editor_events = Class.create({
|
||||
$( this.id + '_url' ).value = this.defaults['link_url'];
|
||||
$( this.id + '_urltext' ).value = selection;
|
||||
}
|
||||
else if( selection.match(/<a/) )
|
||||
{
|
||||
if ( res = selection.match( /href="([^"]+?)"([^>]+?)?>([^<]+?)<\/a>/i ) )
|
||||
{
|
||||
Debug.write( res );
|
||||
if ( res.length )
|
||||
{
|
||||
$( this.id + '_url' ).value = res[1];
|
||||
$( this.id + '_urltext' ).value = res[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
$( this.id + '_url' ).value = selection.strip();
|
||||
$( this.id + '_urltext' ).value = this.defaults['link_text'];
|
||||
}
|
||||
_active = $( this.id + '_urltext' );
|
||||
}
|
||||
}
|
||||
else if( selection.match(/[A-Za-z]+:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/) ){
|
||||
$( this.id + '_url' ).value = selection.strip();
|
||||
$( this.id + '_urltext' ).value = this.defaults['link_text'];
|
||||
@@ -3107,6 +3210,63 @@ _editor_events = Class.create({
|
||||
}
|
||||
});
|
||||
|
||||
var x_expanded = new Array();
|
||||
|
||||
function editorMinimize( key )
|
||||
{
|
||||
Debug.write( 'shrinking: ' + key );
|
||||
x_expanded[key] = 0;
|
||||
|
||||
$(key + '_textarea').setStyle( { height: '70px' } );
|
||||
|
||||
$('editor_' + key).removeClassName('ips_editor');
|
||||
$(key + '_controls').hide();
|
||||
|
||||
/* is there value? */
|
||||
if ( $(key + '_textarea').value )
|
||||
{
|
||||
editorExpand( key );
|
||||
}
|
||||
|
||||
$(key + '_textarea').observe( 'focus', function(e) {
|
||||
editorExpand( key );
|
||||
} );
|
||||
}
|
||||
|
||||
function editorExpand( key )
|
||||
{
|
||||
$H(x_expanded).each( function(i)
|
||||
{
|
||||
/* Shrink set up editors */
|
||||
if ( i.key != key )
|
||||
{
|
||||
editorCollapse( i.key );
|
||||
}
|
||||
} );
|
||||
|
||||
if ( x_expanded[key] == 0 )
|
||||
{
|
||||
Debug.write(" expanding: " + key);
|
||||
$(key + '_controls').appear();
|
||||
$('editor_' + key).addClassName('ips_editor');
|
||||
|
||||
ipb.editors[key] = new ipb.editor( key, USE_RTE );
|
||||
$( ipb.editors[key ] ).resize_to( 250 );
|
||||
x_expanded[ key ] = 1;
|
||||
|
||||
try
|
||||
{
|
||||
ipb.editors[key].editor_window.focus();
|
||||
} catch(err) { Debug.write( err ); }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function editorCollapse(key)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*_editor.prototype.switchEditor = function( editorID )
|
||||
{
|
||||
if( !ipb.editors[ editorID ] ){ Debug.error( "No editor found for ID " + editorID ); }
|
||||
@@ -3121,6 +3281,4 @@ _editor_events = Class.create({
|
||||
} else {
|
||||
editor._loading = true;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
}*/
|
||||
@@ -25,85 +25,6 @@ _fb.prototype.facebook = {
|
||||
//});
|
||||
},
|
||||
|
||||
/**
|
||||
* Wrapper for loadUser when used on the log in page
|
||||
*/
|
||||
login_loadUser: function()
|
||||
{
|
||||
/* Annoyingly, this has to go here */
|
||||
ipb.facebook.api = FB.Facebook.apiClient;
|
||||
|
||||
ipb.facebook.loadUser();
|
||||
},
|
||||
|
||||
/**
|
||||
* Wrapper for loadUser when used on the register page
|
||||
*/
|
||||
register_loadUser: function()
|
||||
{
|
||||
var content = $('fb-template-main').innerHTML;
|
||||
|
||||
/* Annoyingly, this has to go here */
|
||||
ipb.facebook.api = FB.Facebook.apiClient;
|
||||
|
||||
$('fbUserBox').update( content );
|
||||
FB.XFBML.Host.parseDomTree();
|
||||
|
||||
/* Set up handler */
|
||||
$('fbc_completeNewAcc').observe('click', ipb.facebook.login_completeNewAcc );
|
||||
},
|
||||
|
||||
/**
|
||||
* Wrapper for loadUser when used on the UserCP page
|
||||
*/
|
||||
usercp_loadUser: function()
|
||||
{
|
||||
/* Has this ID been saved, yet? */
|
||||
if ( ! ipb.facebook.mem_fb_uid )
|
||||
{
|
||||
window.location = ipb.vars['base_url'] + 'app=core&module=usercp&tab=members&area=facebookLink&do=custom&secure_key=' + ipb.vars['secure_hash'];
|
||||
}
|
||||
|
||||
var content = $('fb-template').innerHTML;
|
||||
|
||||
/* Annoyingly, this has to go here */
|
||||
ipb.facebook.api = FB.Facebook.apiClient;
|
||||
|
||||
$('fbUserBox').update( content );
|
||||
FB.XFBML.Host.parseDomTree();
|
||||
|
||||
/* Set up handler */
|
||||
$('userCPForm').observe( 'submit', ipb.facebook.stupidBug );
|
||||
$('fbc_remove').observe( 'click', ipb.facebook.usercp_remove );
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates the log in box
|
||||
*
|
||||
*/
|
||||
login_updateBox: function()
|
||||
{
|
||||
/* INIT */
|
||||
var content = $('fb-template-main').innerHTML;
|
||||
|
||||
if ( ipb.facebook.linkedMember['member_id'] > 0 )
|
||||
{
|
||||
content = content + $('fb-template-linked').innerHTML;
|
||||
}
|
||||
else
|
||||
{
|
||||
content = content + $('fb-template-notlinked').innerHTML;
|
||||
}
|
||||
|
||||
$('fbUserBox').update( content );
|
||||
FB.XFBML.Host.parseDomTree();
|
||||
|
||||
/* Set up handlers */
|
||||
$('fbc_completeNewAcc').observe('click', ipb.facebook.login_completeNewAcc );
|
||||
$('fbc_completeWithLink').observe('click', ipb.facebook.login_linkCheck );
|
||||
$('fbc_complete').observe('click', ipb.facebook.login_complete );
|
||||
},
|
||||
|
||||
/**
|
||||
* Loads the URL to remove the app
|
||||
*
|
||||
@@ -111,123 +32,7 @@ _fb.prototype.facebook = {
|
||||
usercp_remove: function()
|
||||
{
|
||||
window.location = ipb.vars['base_url'] + 'app=core&module=usercp&tab=members&area=facebookRemove&do=custom&secure_key=' + ipb.vars['secure_hash'];
|
||||
},
|
||||
|
||||
/**
|
||||
* Get around clashes with FBJS
|
||||
*
|
||||
*/
|
||||
stupidBug: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
var location = $('userCPForm').action + '&secure_hash=' + ipb.vars['secure_hash'] + '&do=save';
|
||||
|
||||
[ '_pic', '_avatar', '_status', '_aboutme' ].each( function (i) {
|
||||
location += '&fbc_s' + i + '='+ ( $('fbc_s' + i).checked ? 1 : 0 );
|
||||
} );
|
||||
|
||||
window.location = location;
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Simply submits our form so PHP can do the final checks
|
||||
*
|
||||
*/
|
||||
login_completeNewAcc: function()
|
||||
{
|
||||
$('fbc_linkNewAccForm').submit();
|
||||
},
|
||||
|
||||
/**
|
||||
* Simply submits our form so PHP can do the final checks
|
||||
*
|
||||
*/
|
||||
login_complete: function()
|
||||
{
|
||||
$('fbc_linkAlreadyForm').submit();
|
||||
},
|
||||
|
||||
/**
|
||||
* Check, via AJAX for an existing account
|
||||
*
|
||||
*/
|
||||
login_linkCheck: function()
|
||||
{
|
||||
/* Fetch FB ID */
|
||||
fbUserId = ipb.facebook.api.get_session().uid;
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + '&app=core&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=login&do=authenticateUser&fbid=' + fbUserId,
|
||||
{
|
||||
method: 'post',
|
||||
parameters: { 'emailaddress' : $('fbc_emailAddress').value, 'password' : $('fbc_password').value },
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
_result = t.responseJSON;
|
||||
|
||||
if ( _result['status'] == 'error' )
|
||||
{
|
||||
$('fbc_linkError').update("Email или пароль неверны.");
|
||||
$('fbc_linkError').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( _result['memberData']['fb_uid'] != 0 )
|
||||
{
|
||||
$('fbc_linkError').update("Пользователь уже связан с учетной записью facebook");
|
||||
$('fbc_linkError').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Submit the form and let PHP re-check this and use the facebook PHP ipb.facebook.api to validate the signature, etc */
|
||||
$('fbc_linkForm').submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Check to see if the facebook user is linked to an IPB account
|
||||
*/
|
||||
loadUser: function()
|
||||
{
|
||||
/* Already been here? */
|
||||
if ( typeof( ipb.facebook.linkedMember['member_id'] ) != 'undefined' )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Fetch FB ID */
|
||||
fbUserId = ipb.facebook.api.get_session().uid;
|
||||
|
||||
/* Got a linked member? */
|
||||
new Ajax.Request( ipb.vars['base_url'] + '&app=core&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=facebook&do=getUserByFbId&fbid=' + fbUserId,
|
||||
{
|
||||
method: 'post',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
ipb.facebook.linkedMember = { 'member_id' : 0 };
|
||||
}
|
||||
else
|
||||
{
|
||||
ipb.facebook.linkedMember = t.responseJSON;
|
||||
}
|
||||
|
||||
ipb.facebook.login_updateBox();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.facebook.init();
|
||||
@@ -12,11 +12,14 @@ var _forums = window.IPBoard;
|
||||
_forums.prototype.forums = {
|
||||
totalChecked: 0,
|
||||
showMod: [],
|
||||
deletePerms: {},
|
||||
deleteUrls: {},
|
||||
deletePopUps: {},
|
||||
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.forums.js");
|
||||
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
ipb.forums.initEvents();
|
||||
});
|
||||
@@ -46,6 +49,21 @@ _forums.prototype.forums = {
|
||||
$$('.topic_mod').each( function(check){
|
||||
check.observe( 'click', ipb.forums.checkTopic );
|
||||
} );
|
||||
|
||||
if( $('showforumJump') )
|
||||
{
|
||||
$('showforumJump').observe( "change", ipb.forums.jumpToForum );
|
||||
$('forum_jump_submit').hide();
|
||||
}
|
||||
},
|
||||
|
||||
jumpToForum: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
$('forum_jump').submit();
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
submitModForm: function(e)
|
||||
@@ -75,9 +93,8 @@ _forums.prototype.forums = {
|
||||
$( mod ).observe('mouseover', ipb.forums.moverModeration);
|
||||
$( mod ).observe('mouseout', ipb.forums.moutModeration);
|
||||
|
||||
|
||||
$( mod ).observe('mouseover', function(e){
|
||||
$(mod).setStyle( 'cursor: pointer;' );
|
||||
$(mod).setStyle( { 'cursor': 'pointer' } );
|
||||
Event.stop(e);
|
||||
});
|
||||
$( mod ).observe('mouseout', function(e){
|
||||
@@ -96,8 +113,8 @@ _forums.prototype.forums = {
|
||||
theUL.show().setOpacity( 0.3 );
|
||||
ipb.forums.showMod.push( theUL );
|
||||
|
||||
if( theUL.down('.t_rename') ){ $( theUL.down('.t_rename') ).observe( 'click', ipb.forums.topicRename ) }
|
||||
if( theUL.down('.t_delete') ){ $( theUL.down('.t_delete') ).observe( 'click', ipb.forums.topicDelete ) }
|
||||
if( theUL.down('.t_rename') ){ $( theUL.down('.t_rename') ).observe( 'click', ipb.forums.topicRename ); }
|
||||
if( theUL.down('.t_delete') ){ $( theUL.down('.t_delete') ).observe( 'click', ipb.forums.topicDelete ); }
|
||||
}
|
||||
Event.stop(e);
|
||||
},
|
||||
@@ -109,7 +126,13 @@ _forums.prototype.forums = {
|
||||
{
|
||||
elem = elem.up('.topic_moderation');
|
||||
}
|
||||
elem.setStyle('cursor: pointer').setOpacity(1); // Fix the cursor
|
||||
|
||||
if ( $$('.__topic') )
|
||||
{
|
||||
ipb.global.topicPreviewShowIcon(e);
|
||||
}
|
||||
|
||||
elem.setStyle( { 'cursor': 'pointer' } ).setOpacity(1); // Fix the cursor
|
||||
//new Effect.Appear( $( elem ), {duration: 0.2} );
|
||||
},
|
||||
|
||||
@@ -121,20 +144,64 @@ _forums.prototype.forums = {
|
||||
elem = elem.up('.topic_moderation');
|
||||
}
|
||||
|
||||
//new Effect.Fade( $(elem), {duration: 0.2, to: 0.3} );
|
||||
if ( $$('.__topic') )
|
||||
{
|
||||
ipb.global.topicPreviewHideIcon(e);
|
||||
}
|
||||
|
||||
elem.setOpacity( 0.3 );
|
||||
},
|
||||
|
||||
topicDelete: function(e)
|
||||
{
|
||||
if( !confirm( ipb.lang['delete_topic_confirm'] ) )
|
||||
/* Right then */
|
||||
if ( ipb.forums.deletePerms['canDelete'] && ! ipb.forums.deletePerms['canSoftDelete'] )
|
||||
{
|
||||
/* Do the usual, sir */
|
||||
if( !confirm( ipb.lang['delete_topic_confirm'] ) )
|
||||
{
|
||||
Event.stop(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Event.stop(e);
|
||||
elem = Event.element(e);
|
||||
|
||||
var topicid = elem.up().id.replace( /t_deletelink_/, '' );
|
||||
|
||||
if( !topicid ){ return; }
|
||||
|
||||
/* First off, fix URLs */
|
||||
var _url_delete = ipb.forums.deleteUrls['hardDelete'].evaluate( { 'tid': topicid } ).replace(/&/g, '&') + '&nr=1';
|
||||
var _url_soft = ipb.forums.deleteUrls['softDelete'].evaluate( { 'tid': topicid } ).replace(/&/g, '&') + '&nr=1';
|
||||
var _permaShow = '';
|
||||
|
||||
/* Can we hard delete? */
|
||||
if ( ! ipb.forums.deletePerms['canDelete'] )
|
||||
{
|
||||
_permaShow = 'display:none;';
|
||||
}
|
||||
|
||||
/* Create the pop-up */
|
||||
var popid = 'pop__delete_popup_' + topicid;
|
||||
var content = new Template( $('delPopUp').innerHTML ).evaluate( { removeUrl: _url_soft, permaDelete: _permaShow, permaUrl: _url_delete } );
|
||||
|
||||
ipb.forums.deletePopUps = new ipb.Popup( popid, { type: 'balloon',
|
||||
initial: content,
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
attach: { target: $('tid-link-' + topicid ), position: 'auto' },
|
||||
w: '450px' });
|
||||
}
|
||||
},
|
||||
|
||||
topicRename: function(e)
|
||||
{
|
||||
if( DISABLE_AJAX ){
|
||||
return false;
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
|
||||
// We need to find the topic concerned
|
||||
@@ -145,7 +212,7 @@ _forums.prototype.forums = {
|
||||
var temp = ipb.templates['topic_rename'].evaluate( { inputid: link.id + '_input',
|
||||
submitid: link.id + '_submit',
|
||||
cancelid: link.id + '_cancel',
|
||||
value: link.innerHTML.unescapeHTML().replace( /'/g, "'" ) } );
|
||||
value: link.innerHTML.unescapeHTML().replace( /'/g, "'" ).replace( /</g, "<" ).replace( />/g, ">" ) } );
|
||||
|
||||
$( link ).insert( { before: temp } );
|
||||
|
||||
@@ -338,13 +405,23 @@ _forums.prototype.forums = {
|
||||
{
|
||||
if( $('mod_submit') )
|
||||
{
|
||||
if( ipb.forums.totalChecked == 0 ){
|
||||
$('mod_submit').disabled = true;
|
||||
} else {
|
||||
var _v = $('mod_tact').options[ $('mod_tact').selectedIndex ].value;
|
||||
|
||||
if ( _v.match( /^t_/ ) )
|
||||
{
|
||||
$('mod_submit').disabled = false;
|
||||
$('mod_submit').value = ipb.lang['justgo'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ipb.forums.totalChecked == 0 ){
|
||||
$('mod_submit').disabled = true;
|
||||
} else {
|
||||
$('mod_submit').disabled = false;
|
||||
}
|
||||
|
||||
$('mod_submit').value = ipb.lang['with_selected'].replace('{num}', ipb.forums.totalChecked);
|
||||
}
|
||||
|
||||
$('mod_submit').value = ipb.lang['with_selected'].replace('{num}', ipb.forums.totalChecked);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -366,5 +443,6 @@ _forums.prototype.forums = {
|
||||
popup = new ipb.Popup( 'whoPosted', { type: 'pane', modal: false, w: '500px', h: '400px', ajaxURL: url, hideAtStart: false, close: 'a[rel="close"]' } );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
ipb.forums.init();
|
||||
};
|
||||
|
||||
ipb.forums.init();
|
||||
@@ -36,5 +36,6 @@ _friends.prototype.friends = {
|
||||
}
|
||||
Event.stop(e);
|
||||
}
|
||||
}
|
||||
ipb.friends.init();
|
||||
};
|
||||
|
||||
ipb.friends.init();
|
||||
@@ -1,717 +0,0 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.gallery.js - Gallery javascript */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Rikki Tissier & Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
/* Hack to get lastDescendant
|
||||
Thanks: http://proto-scripty.wikidot.com/prototype:tip-getting-last-descendant-of-an-element
|
||||
*/
|
||||
Element.addMethods({
|
||||
lastDescendant: function(element) {
|
||||
element = $(element).lastChild;
|
||||
while (element && element.nodeType != 1)
|
||||
element = element.previousSibling;
|
||||
return $(element);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
var _gallery = window.IPBoard;
|
||||
|
||||
_gallery.prototype.gallery = {
|
||||
|
||||
totalChecked: 0,
|
||||
inSection: '',
|
||||
|
||||
cur_left: 0,
|
||||
cur_right: 0,
|
||||
cur_image: 0,
|
||||
|
||||
catPopups: [],
|
||||
/*timer: [],
|
||||
blockSizes: [],*/
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.gallery.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
/* Gallery meta popup */
|
||||
if( $('meta-link') )
|
||||
{
|
||||
$('meta-link').observe('click', ipb.gallery.showMeta );
|
||||
}
|
||||
|
||||
if( ipb.gallery.inSection == 'image' )
|
||||
{
|
||||
ipb.gallery.preCheckComments();
|
||||
|
||||
ipb.delegate.register('a[rel="bookmark"]', ipb.gallery.showLinkToComment );
|
||||
ipb.delegate.register('a[rel~=newwindow]', ipb.global.openNewWindow, { 'force': 1 } );
|
||||
ipb.delegate.register('a[rel~=popup]', ipb.gallery.openPopUp );
|
||||
ipb.delegate.register('.delete_item', ipb.gallery.confirmSingleDelete );
|
||||
ipb.delegate.register('.comment_mod', ipb.gallery.checkComment );
|
||||
ipb.delegate.register('.multiquote', ipb.gallery.toggleMultiquote);
|
||||
|
||||
if( $('show_filters') )
|
||||
{
|
||||
$('show_filters').observe('click', ipb.gallery.toggleFilters );
|
||||
$('filter_form').hide();
|
||||
}
|
||||
}
|
||||
else if( ipb.gallery.inSection == 'category' )
|
||||
{
|
||||
ipb.gallery.preCheckImages();
|
||||
|
||||
//ipb.delegate.register('.image_mod', ipb.gallery.checkImage );
|
||||
ipb.delegate.register('.check_all', ipb.gallery.checkAllInForm );
|
||||
}
|
||||
|
||||
if( $('album') )
|
||||
{
|
||||
$('album').hide();
|
||||
}
|
||||
|
||||
$$('.subcatsTrigger').each( function(elem) {
|
||||
|
||||
var thisid = elem.identify();
|
||||
thisid = thisid.replace( 'subCatsDDTrigger_', '' );
|
||||
|
||||
if( $('subCatsDD_' + thisid ) )
|
||||
{
|
||||
$('subCatsDD_' + thisid ).hide();
|
||||
$(elem).observe('click', ipb.gallery.showSubCats );
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
buildSubCatPopup: function( e, id )
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if( ipb.gallery.catPopups[ id ] ){
|
||||
ipb.gallery.catPopups[ id ].show();
|
||||
}
|
||||
else
|
||||
{
|
||||
ipb.gallery.catPopups[ id ] = new ipb.Popup( id + '_popup', {
|
||||
initial: $( id + '_subcats' ).innerHTML,
|
||||
type: 'balloon',
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
attach: {
|
||||
target: $(id + '_subcat_link'),
|
||||
position: 'auto',
|
||||
'event': 'click'
|
||||
},
|
||||
w: '300px'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
registerCategory: function( id, href )
|
||||
{
|
||||
if( !$('category_' + id) ){ return; }
|
||||
|
||||
href = href.replace('&', '&');
|
||||
|
||||
$('category_' + id).down('.preview').wrap( 'a', { href: href, 'class': 'enhanced_link', title: ipb.lang['go_to_category'] } );
|
||||
$('category_' + id).down('.description').hide();
|
||||
|
||||
var mouseOvered = true;
|
||||
|
||||
if( $('category_' + id + '_description' ) )
|
||||
{
|
||||
$('category_' + id).observe('mouseenter', function(e){
|
||||
new Effect.Appear( $('category_' + id + '_description'), { duration: 0.3 } );
|
||||
});
|
||||
$('category_' + id).observe('mouseleave', function(e){
|
||||
new Effect.Fade( $('category_' + id + '_description'), { duration: 0.3 } );
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
toggleFilters: function(e)
|
||||
{
|
||||
if( $('filter_form') )
|
||||
{
|
||||
Effect.toggle( $('filter_form'), 'blind', {duration: 0.2} );
|
||||
Effect.toggle( $('show_filters'), 'blind', {duration: 0.2} );
|
||||
}
|
||||
},
|
||||
|
||||
rotateImage: function( e, dir )
|
||||
{
|
||||
Debug.write( curnotes.size() );
|
||||
|
||||
// If we have notes, just refresh
|
||||
if( !Object.isUndefined( curnotes ) && curnotes.size() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
if( ( dir != 'left' && dir != 'right' ) || !$('image_view_' + ipb.gallery.imageID) ){ return; }
|
||||
|
||||
new Ajax.Request(
|
||||
ipb.vars['base_url']+'app=gallery&module=ajax§ion=image&do=rotate-' + dir + '&secure_key=' + ipb.vars['secure_hash'] + '&img=' + ipb.gallery.imageID,
|
||||
{
|
||||
method: 'post',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/* No Permission */
|
||||
if( t.responseText == 'nopermission' )
|
||||
{
|
||||
alert( ipb.lang['no_permission'] );
|
||||
}
|
||||
else if( t.responseText == 'rotate_failed' )
|
||||
{
|
||||
alert( ipb.lang['gallery_rotate_failed'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
var rand = Math.round( Math.random() * 100000000 );
|
||||
var img = $('image_view_' + ipb.gallery.imageID);
|
||||
var tmpSrc = img.src;
|
||||
|
||||
tmpSrc = tmpSrc.replace(/t=[0-9]+/, '');
|
||||
|
||||
$( img ).src = tmpSrc + "?t=" + rand;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
return false;
|
||||
|
||||
},
|
||||
|
||||
setUpGalleryBlock: function(id)
|
||||
{
|
||||
if( ipb.Cookie.get('galleryBlock_' + id) == '1' ){
|
||||
$( id + '_title').addClassName('expanded');
|
||||
$( id + '_content').show();
|
||||
} else {
|
||||
$( id + '_title').addClassName('collapsed');
|
||||
$( id + '_content').hide();
|
||||
}
|
||||
|
||||
$( id + '_title').observe( 'click', ipb.gallery.toggleImageViewBlock.bindAsEventListener( this, id ) );
|
||||
},
|
||||
|
||||
toggleImageViewBlock: function( e, id )
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if( $( id + '_content' ).visible() ){
|
||||
new Effect.BlindUp( $( id + '_content' ), { duration: 0.2 } );
|
||||
$( id + '_title' ).removeClassName('expanded').addClassName('collapsed');
|
||||
ipb.Cookie.set('galleryBlock_' + id, '0', true);
|
||||
} else {
|
||||
new Effect.BlindDown( $( id + '_content' ), { duration: 0.2 } );
|
||||
$( id + '_title' ).removeClassName('collapsed').addClassName('expanded');
|
||||
ipb.Cookie.set('galleryBlock_' + id, '1', true);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
openPopUp: function(e, link)
|
||||
{
|
||||
window.open(link.href, "image", "status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1");
|
||||
Event.stop(e);
|
||||
return false;
|
||||
},
|
||||
|
||||
showSubCats: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
elem = Event.findElement( e, 'h5' );
|
||||
var thisid = elem.identify();
|
||||
thisid = thisid.replace( 'subCatsDDTrigger_', '' );
|
||||
|
||||
$('subCatsDD_' + thisid ).toggle();
|
||||
},
|
||||
|
||||
/**
|
||||
* Photostrip code - at the top because it'll prob be updated the most :P
|
||||
*/
|
||||
photostripInit: function()
|
||||
{
|
||||
if( ipb.gallery.cur_left > 0 )
|
||||
{
|
||||
$('slide_left').show();
|
||||
$('slide_left').observe( 'mouseover', ipb.gallery.photostripMouesover );
|
||||
$('slide_left').observe( 'mouseout', ipb.gallery.photostripMouesout );
|
||||
$('slide_left').observe( 'click', ipb.gallery.photostripSlideLeft );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('slide_left').hide();
|
||||
}
|
||||
|
||||
if( ipb.gallery.cur_right > 0 )
|
||||
{
|
||||
$('slide_right').show();
|
||||
$('slide_right').observe( 'mouseover', ipb.gallery.photostripMouesover );
|
||||
$('slide_right').observe( 'mouseout', ipb.gallery.photostripMouesout );
|
||||
$('slide_right').observe( 'click', ipb.gallery.photostripSlideRight );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('slide_right').hide();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Photostrip code - at the top because it'll prob be updated the most :P
|
||||
*/
|
||||
resetPhotostrip: function()
|
||||
{
|
||||
var count = 1;
|
||||
|
||||
$('strip').childElements().each( function(elem){
|
||||
if( count == 1 )
|
||||
{
|
||||
ipb.gallery.cur_left = elem.id.replace( /strip_/, '' );
|
||||
}
|
||||
|
||||
if( count == 5 )
|
||||
{
|
||||
ipb.gallery.cur_right = elem.id.replace( /strip_/, '' );
|
||||
}
|
||||
|
||||
count++;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Photostrip slide left
|
||||
*/
|
||||
photostripSlideLeft: function(e)
|
||||
{
|
||||
new Ajax.Request(
|
||||
ipb.vars['base_url']+'app=gallery&module=ajax§ion=photostrip&do=slide_right&secure_key=' + ipb.vars['secure_hash'] + '&img='+ipb.gallery.cur_left+'&cur_img='+ipb.gallery.cur_image,
|
||||
{
|
||||
method: 'post',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/* No Permission */
|
||||
if( t.responseText == 'nopermission' )
|
||||
{
|
||||
alert( ipb.lang['no_permission'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get rid of first item in the list
|
||||
$('strip').lastDescendant().remove();
|
||||
|
||||
// Add the new item
|
||||
$('strip').insert( { top: t.responseText } );
|
||||
|
||||
// And then reset
|
||||
ipb.gallery.resetPhotostrip();
|
||||
ipb.gallery.photostripInit();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Photostrip slide right
|
||||
*/
|
||||
photostripSlideRight: function(e)
|
||||
{
|
||||
new Ajax.Request(
|
||||
ipb.vars['base_url']+'app=gallery&module=ajax§ion=photostrip&do=slide_left&secure_key=' + ipb.vars['secure_hash'] + '&img='+ipb.gallery.cur_right+'&cur_img='+ipb.gallery.cur_image,
|
||||
{
|
||||
method: 'post',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/* No Permission */
|
||||
if( t.responseText == 'nopermission' )
|
||||
{
|
||||
alert( ipb.lang['no_permission'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get rid of first item in the list
|
||||
$('strip').firstDescendant().remove();
|
||||
|
||||
// Add the new item
|
||||
$('strip').insert( { bottom: t.responseText } );
|
||||
|
||||
// And then reset
|
||||
ipb.gallery.resetPhotostrip();
|
||||
ipb.gallery.photostripInit();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Photostrip slider cell mouseover
|
||||
*/
|
||||
photostripMouesover: function(e)
|
||||
{
|
||||
cell = Event.findElement( e, 'div' );
|
||||
|
||||
$(cell.id).addClassName('post2');
|
||||
$(cell.id).addClassName('clickable');
|
||||
},
|
||||
|
||||
/**
|
||||
* Photostrip slider cell mouseout
|
||||
*/
|
||||
photostripMouesout: function(e)
|
||||
{
|
||||
cell = Event.findElement( e, 'div' );
|
||||
|
||||
$(cell.id).removeClassName('post2');
|
||||
$(cell.id).removeClassName('clickable');
|
||||
},
|
||||
|
||||
/**
|
||||
* Show the meta information popup
|
||||
*/
|
||||
showMeta: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
popup = new ipb.Popup( 'showmeta', { type: 'pane', modal: false, w: '600px', h: '500px', initial: $('metacontent').innerHTML, hideAtStart: false, close: 'a[rel="close"]' } );
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Show the comment link
|
||||
*/
|
||||
showLinkToComment: function(e, elem)
|
||||
{
|
||||
_t = prompt( ipb.lang['copy_topic_link'], $( elem ).readAttribute('href') );
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
/**
|
||||
* Confirm they want to delete stuff
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
confirmSingleDelete: function(e, elem)
|
||||
{
|
||||
if( !confirm( ipb.lang['delete_post_confirm'] ) )
|
||||
{
|
||||
Event.stop(e);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Do album manager dropdown change
|
||||
*
|
||||
* @var object select The select box element
|
||||
*/
|
||||
goToAlbumOp: function( select )
|
||||
{
|
||||
goto_url = select.options[select.selectedIndex].value;
|
||||
|
||||
if( goto_url == 'null' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( goto_url.match( /do=del/ ) )
|
||||
{
|
||||
if( confirm( deletion_confirm_lang ) )
|
||||
{
|
||||
document.location = ipb.vars['base_url'] + goto_url;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
document.location = ipb.vars['base_url'] + goto_url;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggles the multimod buttons in posts
|
||||
*
|
||||
* @param {event} e The event
|
||||
* @param {element} elem The element that fired
|
||||
*/
|
||||
toggleMultiquote: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
// Get list of already quoted posts
|
||||
try {
|
||||
quoted = ipb.Cookie.get('gal_pids').split(',').compact();
|
||||
} catch(err){
|
||||
quoted = $A();
|
||||
}
|
||||
|
||||
id = elem.id.replace('multiq_', '');
|
||||
|
||||
// Hokay, are we selecting/deselecting?
|
||||
if( elem.hasClassName('selected') )
|
||||
{
|
||||
elem.removeClassName('selected');
|
||||
quoted = quoted.uniq().without( id ).join(',');
|
||||
}
|
||||
else
|
||||
{
|
||||
elem.addClassName('selected');
|
||||
quoted.push( id );
|
||||
quoted = quoted.uniq().join(',');
|
||||
}
|
||||
|
||||
// Save cookie
|
||||
ipb.Cookie.set('gal_pids', quoted, 0);
|
||||
},
|
||||
|
||||
/**
|
||||
* Check the files we've selected
|
||||
*/
|
||||
preCheckComments: function()
|
||||
{
|
||||
if( $('selectedgcids') )
|
||||
{
|
||||
var topics = $F('selectedgcids').split(',');
|
||||
}
|
||||
|
||||
var checkboxesOnPage = 0;
|
||||
var checkedOnPage = 0;
|
||||
|
||||
if( topics )
|
||||
{
|
||||
topics.each( function(check){
|
||||
if( check != '' )
|
||||
{
|
||||
if( $('pid_' + check ) )
|
||||
{
|
||||
checkedOnPage++;
|
||||
$('pid_' + check ).checked = true;
|
||||
}
|
||||
|
||||
ipb.gallery.totalChecked++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$$('.comment_mod').each( function(check){
|
||||
checkboxesOnPage++;
|
||||
} );
|
||||
|
||||
if( $('comments_all') )
|
||||
{
|
||||
if( checkedOnPage == checkboxesOnPage )
|
||||
{
|
||||
$('comments_all').checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
ipb.gallery.updateModButton();
|
||||
},
|
||||
|
||||
/**
|
||||
* Confirm they want to delete stuff
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
checkComment: function(e, elem)
|
||||
{
|
||||
remove = new Array();
|
||||
check = elem;
|
||||
selectedTopics = $F('selectedgcids').split(',').compact();
|
||||
|
||||
var checkboxesOnPage = 0;
|
||||
var checkedOnPage = 0;
|
||||
|
||||
if( check.checked == true )
|
||||
{
|
||||
Debug.write("Checked");
|
||||
selectedTopics.push( check.id.replace('pid_', '') );
|
||||
ipb.gallery.totalChecked++;
|
||||
}
|
||||
else
|
||||
{
|
||||
remove.push( check.id.replace('pid_', '') );
|
||||
ipb.gallery.totalChecked--;
|
||||
}
|
||||
|
||||
$$('.comment_mod').each( function(check){
|
||||
checkboxesOnPage++;
|
||||
|
||||
if( $(check).checked == true )
|
||||
{
|
||||
checkedOnPage++;
|
||||
}
|
||||
} );
|
||||
|
||||
if( $('comments_all') )
|
||||
{
|
||||
if( checkedOnPage == checkboxesOnPage )
|
||||
{
|
||||
$('comments_all').checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('comments_all' ).checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
selectedTopics = selectedTopics.uniq().without( remove ).join(',');
|
||||
ipb.Cookie.set('modgcids', selectedTopics, 0);
|
||||
|
||||
$('selectedgcids').value = selectedTopics;
|
||||
|
||||
ipb.gallery.updateModButton();
|
||||
},
|
||||
|
||||
/**
|
||||
* Check the files we've selected
|
||||
*/
|
||||
preCheckImages: function()
|
||||
{
|
||||
var topics = [];
|
||||
|
||||
if( $('selectedimgids' ) ){
|
||||
topics = $F('selectedimgids').split(',');
|
||||
}
|
||||
|
||||
var checkboxesOnPage = 0;
|
||||
var checkedOnPage = 0;
|
||||
|
||||
if( topics )
|
||||
{
|
||||
topics.each( function(check){
|
||||
if( check != '' )
|
||||
{
|
||||
if( $('img_' + check ) )
|
||||
{
|
||||
checkedOnPage++;
|
||||
$('img_' + check ).checked = true;
|
||||
}
|
||||
|
||||
ipb.gallery.totalChecked++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$$('.image_mod').each( function(check){
|
||||
checkboxesOnPage++;
|
||||
} );
|
||||
|
||||
if( $('imgs_all') )
|
||||
{
|
||||
if( checkedOnPage == checkboxesOnPage )
|
||||
{
|
||||
$('imgs_all').checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
ipb.gallery.updateModButton();
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the moderation button
|
||||
*/
|
||||
updateModButton: function( )
|
||||
{
|
||||
if( $('mod_submit') )
|
||||
{
|
||||
if( ipb.gallery.totalChecked == 0 ){
|
||||
$('mod_submit').disabled = true;
|
||||
} else {
|
||||
$('mod_submit').disabled = false;
|
||||
}
|
||||
|
||||
$('mod_submit').value = ipb.lang['with_selected'].replace('{num}', ipb.gallery.totalChecked);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check all the files in this form
|
||||
*/
|
||||
checkAllInForm: function(e)
|
||||
{
|
||||
selectedTopics = $F('selectedimgids').split(',').compact();
|
||||
remove = new Array();
|
||||
|
||||
check = Event.findElement(e, 'input');
|
||||
toCheck = $F(check);
|
||||
form = check.up('form');
|
||||
|
||||
form.select('.image_mod').each( function(check){
|
||||
if( toCheck != null )
|
||||
{
|
||||
selectedTopics.push( check.id.replace('img_', '') );
|
||||
check.checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
remove.push( check.id.replace('img_', '') );
|
||||
check.checked = false;
|
||||
}
|
||||
});
|
||||
|
||||
selectedTopics = selectedTopics.uniq().without( remove ).join(',');
|
||||
ipb.Cookie.set('modimgids', selectedTopics, 0);
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the supplied post to hidden
|
||||
*
|
||||
* @var {int} id The ID of the post to hide
|
||||
*/
|
||||
setCommentHidden: function(id)
|
||||
{
|
||||
if( $( 'comment_id_' + id ).select('.post_wrap')[0] )
|
||||
{
|
||||
$( 'comment_id_' + id ).select('.post_wrap')[0].hide();
|
||||
|
||||
if( $('unhide_post_' + id ) )
|
||||
{
|
||||
$('unhide_post_' + id).observe('click', ipb.gallery.showHiddenComment );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Unhides the supplied post
|
||||
*
|
||||
* @var {event} e The link event
|
||||
*/
|
||||
showHiddenComment: function(e)
|
||||
{
|
||||
link = Event.findElement(e, 'a');
|
||||
id = link.id.replace('unhide_post_', '');
|
||||
|
||||
if( $('comment_id_' + id ).select('.post_wrap')[0] )
|
||||
{
|
||||
elem = $('comment_id_' + id ).select('.post_wrap')[0];
|
||||
new Effect.Parallel( [
|
||||
new Effect.BlindDown( elem ),
|
||||
new Effect.Appear( elem )
|
||||
], { duration: 0.5 } );
|
||||
}
|
||||
|
||||
if( $('comment_id_' + id ).select('.post_ignore')[0] )
|
||||
{
|
||||
elem = $('comment_id_' + id ).select('.post_ignore')[0];
|
||||
/*new Effect.BlindUp( elem, {duration: 0.2} );*/
|
||||
elem.hide();
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
}
|
||||
}
|
||||
|
||||
ipb.gallery.init();
|
||||
@@ -1,88 +1,88 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.help.js - Help File Javascript */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
var _help = window.IPBoard;
|
||||
|
||||
_help.prototype.help = {
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
*/
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.help.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
$$('li.helpRow a').each( function(elem){
|
||||
elem.observe('click', ipb.help.showHelpFile );
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Shows a prompt allowing user to copy the URL
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
showHelpFile: function(e)
|
||||
{
|
||||
if( $( Event.element(e) ).tagName != 'A' ){ return; }
|
||||
|
||||
Event.stop(e);
|
||||
|
||||
if( ipb.help.loading == true ){ return; }
|
||||
|
||||
if( Event.element(e).hasClassName( 'isOpen' ) )
|
||||
{
|
||||
Event.element(e).removeClassName( 'isOpen' );
|
||||
Event.element(e).up('.helpRow').down( '.openedText' ).hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if( Event.element(e).up('.helpRow').down( '.openedText' ) )
|
||||
{
|
||||
Event.element(e).addClassName( 'isOpen' );
|
||||
Event.element(e).up('.helpRow').down( '.openedText' ).show();
|
||||
return;
|
||||
}
|
||||
|
||||
var url = $( Event.element(e) ).readAttribute('href');
|
||||
url = url + '&xml=1';
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
ipb.help.loading = true;
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( t.responseText == 'error' )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
ipb.help.loading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Create a div and show the help text
|
||||
var text = new Element( 'div' ).update( t.responseText ).addClassName('openedText');
|
||||
$( Event.element(e) ).up('.helpRow').insert( { bottom: text } );
|
||||
Event.element(e).addClassName( 'isOpen' );
|
||||
ipb.help.loading = false;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.help.js - Help File Javascript */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
var _help = window.IPBoard;
|
||||
|
||||
_help.prototype.help = {
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
*
|
||||
*/
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.help.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
$$('li.helpRow a').each( function(elem){
|
||||
elem.observe('click', ipb.help.showHelpFile );
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Shows a prompt allowing user to copy the URL
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
showHelpFile: function(e)
|
||||
{
|
||||
if( $( Event.element(e) ).tagName != 'A' ){ return; }
|
||||
|
||||
Event.stop(e);
|
||||
|
||||
if( ipb.help.loading == true ){ return; }
|
||||
|
||||
if( Event.element(e).hasClassName( 'isOpen' ) )
|
||||
{
|
||||
Event.element(e).removeClassName( 'isOpen' );
|
||||
Event.element(e).up('.helpRow').down( '.openedText' ).hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if( Event.element(e).up('.helpRow').down( '.openedText' ) )
|
||||
{
|
||||
Event.element(e).addClassName( 'isOpen' );
|
||||
Event.element(e).up('.helpRow').down( '.openedText' ).show();
|
||||
return;
|
||||
}
|
||||
|
||||
var url = $( Event.element(e) ).readAttribute('href');
|
||||
url = url + '&xml=1';
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
ipb.help.loading = true;
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( t.responseText == 'error' )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
ipb.help.loading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// Create a div and show the help text
|
||||
var text = new Element( 'div' ).update( t.responseText ).addClassName('openedText');
|
||||
$( Event.element(e) ).up('.helpRow').insert( { bottom: text } );
|
||||
Event.element(e).addClassName( 'isOpen' );
|
||||
ipb.help.loading = false;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
ipb.help.init();
|
||||
@@ -1,98 +1,54 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.forums.js - Forum view code */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Rikki Tissier */
|
||||
/************************************************/
|
||||
|
||||
var _hooks = window.IPBoard;
|
||||
|
||||
_hooks.prototype.hooks = {
|
||||
activeTab: 'forums',
|
||||
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.hooks.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
ipb.hooks.initEvents();
|
||||
});
|
||||
},
|
||||
|
||||
initEvents: function()
|
||||
{
|
||||
$$('.tab_toggle').each( function(elem){
|
||||
$(elem).observe('click', ipb.hooks.changeTabContent );
|
||||
});
|
||||
|
||||
if( $('more-watched-forums') )
|
||||
{
|
||||
$('more-watched-forums').observe('click', ipb.hooks.toggleWatchedForums );
|
||||
}
|
||||
|
||||
if( $('more-watched-topics') )
|
||||
{
|
||||
$('more-watched-topics').observe('click', ipb.hooks.toggleWatchedTopics );
|
||||
}
|
||||
},
|
||||
|
||||
toggleWatchedForums: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
$('more-watched-forums-container').toggle();
|
||||
},
|
||||
|
||||
toggleWatchedTopics: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
$('more-watched-topics-container').toggle();
|
||||
},
|
||||
|
||||
changeTabContent: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
elem = Event.findElement(e, 'li');
|
||||
if( !elem.hasClassName('tab_toggle') || !elem.id ){ return; }
|
||||
id = elem.id.replace('tab_link_', '');
|
||||
if( !id || id.blank() ){ return; }
|
||||
if( !$('tab_content_' + id ) ){ return; }
|
||||
|
||||
if( ipb.hooks.activeTab == id )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
oldTab = ipb.hooks.activeTab;
|
||||
ipb.hooks.activeTab = id;
|
||||
|
||||
// OK, we should have an ID. Does it exist already?
|
||||
|
||||
if( !$('tab_' + id ) )
|
||||
{
|
||||
$$('.tab_toggle_content').each( function(otherelem){
|
||||
$(otherelem).hide();
|
||||
});
|
||||
|
||||
$('tab_content_' + id ).show();
|
||||
}
|
||||
else
|
||||
{
|
||||
new Effect.Parallel( [
|
||||
new Effect.BlindUp( $('tab_content_' + oldTab), { sync: true } ),
|
||||
new Effect.BlindDown( $('tab_content_' + ipb.hooks.activeTab), { sync: true } )
|
||||
], { duration: 0.4 } );
|
||||
}
|
||||
|
||||
$$('.tab_toggle').each( function(otherelem){
|
||||
$(otherelem).removeClassName('active');
|
||||
});
|
||||
|
||||
$(elem).addClassName('active');
|
||||
|
||||
}
|
||||
}
|
||||
ipb.hooks.init();
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.forums.js - Forum view code */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Rikki Tissier */
|
||||
/************************************************/
|
||||
|
||||
var _hooks = window.IPBoard;
|
||||
|
||||
_hooks.prototype.hooks = {
|
||||
activeTab: 'forums',
|
||||
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.hooks.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
ipb.hooks.initEvents();
|
||||
});
|
||||
},
|
||||
|
||||
initEvents: function()
|
||||
{
|
||||
ipb.global.initTabs();
|
||||
|
||||
if( $('more-watched-forums') )
|
||||
{
|
||||
$('more-watched-forums').observe('click', ipb.hooks.toggleWatchedForums );
|
||||
}
|
||||
|
||||
if( $('more-watched-topics') )
|
||||
{
|
||||
$('more-watched-topics').observe('click', ipb.hooks.toggleWatchedTopics );
|
||||
}
|
||||
},
|
||||
|
||||
toggleWatchedForums: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
$('more-watched-forums-container').toggle();
|
||||
},
|
||||
|
||||
toggleWatchedTopics: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
$('more-watched-topics-container').toggle();
|
||||
}
|
||||
};
|
||||
|
||||
ipb.hooks.init();
|
||||
@@ -0,0 +1,479 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.hoverCard.js - Delayed pop-up menu */
|
||||
/* (c) IPS, Inc 2010 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Matt Mecham */
|
||||
/************************************************/
|
||||
|
||||
/* ===================================================================================================== */
|
||||
/* IPB3 Hover card manager */
|
||||
|
||||
IPBoard.prototype.hoverCardRegister = {
|
||||
|
||||
mainStore: $H(),
|
||||
|
||||
initialize: function( key, options )
|
||||
{
|
||||
var store = $H();
|
||||
|
||||
/* Insert into main store */
|
||||
if ( ! ipb.hoverCardRegister.mainStore.get( key ) )
|
||||
{
|
||||
ipb.hoverCardRegister.mainStore.set( key, options );
|
||||
}
|
||||
|
||||
$$('._hovertrigger').each( function( elem )
|
||||
{
|
||||
try
|
||||
{
|
||||
_key = $(elem).readAttribute( "hovercard-ref" );
|
||||
|
||||
if ( key == _key )
|
||||
{
|
||||
$(elem).addClassName( '___hover___' + key );
|
||||
store.set( 'key', key );
|
||||
|
||||
/* remove trigger class to prevent re-iteration later */
|
||||
$(elem).removeClassName('_hovertrigger');
|
||||
$(elem).addClassName('_hoversetup');
|
||||
}
|
||||
}
|
||||
catch( err )
|
||||
{
|
||||
Debug.error( err );
|
||||
}
|
||||
} );
|
||||
|
||||
/* Set up cards */
|
||||
store.each( function( elem )
|
||||
{
|
||||
new ipb.hoverCard( '___hover___' + elem.value, options );
|
||||
} );
|
||||
},
|
||||
|
||||
/* Post ajax update 'cos new content added via ajax won't be set up */
|
||||
postAjaxInit: function()
|
||||
{
|
||||
ipb.hoverCardRegister.mainStore.each( function( elem )
|
||||
{
|
||||
ipb.hoverCardRegister.initialize( elem.key, elem.value );
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
IPBoard.prototype.hoverCard = Class.create( {
|
||||
|
||||
/**
|
||||
* options.ajaxUrl: Pass a complete ajax URL in.
|
||||
* options.ajaxCacheExpire: Number of seconds to store the ajax cache. 0 to not cache
|
||||
* options.type : Balloon* or pane
|
||||
* options.position : Auto, topLeft, bottomLeft*, topRight, bottomRight
|
||||
*/
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
initialize: function( className, options )
|
||||
{
|
||||
this.id = className;
|
||||
this.timer = {},
|
||||
this.card = false,
|
||||
this.ajaxCache = {},
|
||||
this.popupActive = {},
|
||||
this.openId = false;
|
||||
this.curEvent = false;
|
||||
|
||||
this.options = Object.extend( {
|
||||
type: 'balloon',
|
||||
position: 'bottomLeft',
|
||||
w: '500px',
|
||||
openOnClick: false,
|
||||
ajaxUrl: false,
|
||||
delay: 800,
|
||||
ajaxCacheExpire: 0,
|
||||
black: false,
|
||||
getId: false,
|
||||
setIdParam: 'id',
|
||||
callback: false }, arguments[1] );
|
||||
this.init();
|
||||
},
|
||||
|
||||
init: function()
|
||||
{
|
||||
this.debugWrite( "hoverCard.init()" );
|
||||
|
||||
/* Scoping issues #ftl */
|
||||
var _hc = this;
|
||||
|
||||
document.observe( 'mousemove', _hc.mMove.bindAsEventListener( _hc ) );
|
||||
|
||||
/* Set up elements */
|
||||
$$('.' + this.id ).each( function( elem )
|
||||
{
|
||||
elem.identify();
|
||||
|
||||
try
|
||||
{
|
||||
Event.stopObserving( $( elem.id ), 'mouseout' );
|
||||
Event.stopObserving( $( elem.id ), 'mouseover' );
|
||||
|
||||
/* title attributes murder the pop-up effect */
|
||||
$( elem.id ).writeAttribute( 'title', '' );
|
||||
|
||||
if ( $( elem.id ).down('a') )
|
||||
{
|
||||
$( elem.id ).down('a').writeAttribute( 'title', '' );
|
||||
}
|
||||
|
||||
$( elem.id ).down('img').writeAttribute( 'title', '' );
|
||||
$( elem.id ).down('img').writeAttribute( 'alt', '' );
|
||||
}
|
||||
catch (aBall){}
|
||||
|
||||
$( elem.id ).observe( 'click' , _hc.mClick.bindAsEventListener( _hc, elem.id ) );
|
||||
$( elem.id ).observe( 'mouseover', _hc.mOver.bindAsEventListener( _hc, elem.id ) );
|
||||
$( elem.id ).observe( 'mouseout' , _hc.mOut.bindAsEventListener( _hc, elem.id ) );
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Mouse Move
|
||||
*/
|
||||
mMove: function(e)
|
||||
{
|
||||
this.curEvent = e;
|
||||
},
|
||||
|
||||
/**
|
||||
* ITEM CLICK
|
||||
*/
|
||||
mClick: function(e, id)
|
||||
{
|
||||
if ( ! this.options.openOnClick )
|
||||
{
|
||||
this.close(id);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* ITEM MOUSEOVER
|
||||
*/
|
||||
mOver: function(e, id)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( this.overPopUp(id) === true )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
this.debugWrite( "mover - setting time OVER " + id );
|
||||
|
||||
if ( ! Object.isUndefined( this.timer[id + '_out'] ) )
|
||||
{
|
||||
clearTimeout( this.timer[id + '_out'] );
|
||||
}
|
||||
|
||||
/* Set timer */
|
||||
this.timer[id + '_over'] = setTimeout( this.show.bind(this, id), this.options.delay );
|
||||
},
|
||||
|
||||
/*
|
||||
* ITEM MOUSEOUT
|
||||
*/
|
||||
mOut: function(e, id)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( this.overPopUp(id) === true )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Pop up class dominates the mouseover class */
|
||||
Event.stopObserving( $( id ), 'mouseover' );
|
||||
$( id ).observe( 'mouseover' , this.mOver.bindAsEventListener( this, id ) );
|
||||
|
||||
/* Clear any time out */
|
||||
if ( ! Object.isUndefined( this.timer[id + '_over'] ) )
|
||||
{
|
||||
clearTimeout( this.timer[id + '_over'] );
|
||||
}
|
||||
|
||||
/* Set timer */
|
||||
this.debugWrite( "Mout - setting time OUT " + id );
|
||||
this.timer[id + '_out'] = setTimeout( this.close.bind(this, id), 800 );
|
||||
},
|
||||
|
||||
/*
|
||||
* SHOW POP UP
|
||||
*/
|
||||
show: function(id)
|
||||
{
|
||||
var popup = 'pu__' + this.id + '_popup';
|
||||
|
||||
/* Clear any time out */
|
||||
if ( ! Object.isUndefined( this.timer[id + '_out'] ) )
|
||||
{
|
||||
clearTimeout( this.timer[id + '_out'] );
|
||||
}
|
||||
|
||||
if ( ! Object.isUndefined( this.card ) && this.card !== false )
|
||||
{
|
||||
this.card.kill();
|
||||
this.card = false;
|
||||
}
|
||||
|
||||
/* If we have an old popup from a previous class method, kill it 'cos this.card won't be populated */
|
||||
if ( $(popup) )
|
||||
{
|
||||
$(popup).remove();
|
||||
}
|
||||
|
||||
/* Set this as open */
|
||||
this.openId = id;
|
||||
|
||||
var content = false;
|
||||
|
||||
if ( this.options.ajaxUrl )
|
||||
{
|
||||
content = "<div class='general_box pad' style='height: 20px; text-align:center'><img src='" + ipb.vars['loading_img'] + "' alt='' /></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Run call back */
|
||||
if ( Object.isFunction( this.options.callback ) )
|
||||
{
|
||||
content = this.options.callback( this, id );
|
||||
|
||||
/* Did we decide to skip output? */
|
||||
if ( content === false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.error( "No AJAX or Callback specified. Whaddayagonnado?!" );
|
||||
}
|
||||
}
|
||||
|
||||
this.card = new ipb.Popup( 'pu__' + this.id, { type: 'balloon',
|
||||
initial: content,
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
hideClose: true,
|
||||
defer: false,
|
||||
black: this.options.black,
|
||||
attach: { target: $( id ), position: this.options.position },
|
||||
w: this.options.w } );
|
||||
|
||||
/* Pop up class dominates the mouseover class */
|
||||
Event.stopObserving( $( id ), 'mouseout' );
|
||||
|
||||
$( id ).observe( 'mouseout' , this.mOut.bindAsEventListener( this, id ) );
|
||||
|
||||
if ( this.options.ajaxUrl )
|
||||
{
|
||||
this.ajax( id );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* CLOSE POP-UP
|
||||
*/
|
||||
close: function(id)
|
||||
{
|
||||
/* Don't close if we brushed past another trigger and are now over a pop-up */
|
||||
if ( this.overPopUp(id) === true )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
this.debugWrite( "Close: " + id );
|
||||
|
||||
/* Clear all time outs */
|
||||
if ( ! Object.isUndefined( this.timer[id + '_out'] ) )
|
||||
{
|
||||
this.debugWrite( "-- Clearing: " + id + '_out' );
|
||||
clearTimeout( this.timer[id + '_out'] );
|
||||
}
|
||||
|
||||
if ( ! Object.isUndefined( this.timer[id + '_over'] ) )
|
||||
{
|
||||
this.debugWrite( "-- Clearing: " + id + '_over' );
|
||||
clearTimeout( this.timer[id + '_over'] );
|
||||
}
|
||||
|
||||
if ( ! Object.isUndefined( this.card ) && this.card !== false && id == this.openId )
|
||||
{
|
||||
/* Hide makes card fade nicely, we kill it in open */
|
||||
this.card.hide();
|
||||
this.card = false;
|
||||
|
||||
/* Set this as closed */
|
||||
this.openId = false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Load ajax URL
|
||||
*/
|
||||
ajax: function( id )
|
||||
{
|
||||
var now = this.unixtime();
|
||||
var url = false;
|
||||
var bDims = {};
|
||||
var aDims = {};
|
||||
|
||||
/* Before we load ajax, grab the top and height of item */
|
||||
var popup = 'pu__' + this.id + '_popup';
|
||||
//this.debugWrite( $(popup).innerHTML);
|
||||
bDims['height'] = $( popup ).getHeight();
|
||||
bDims['top'] = parseInt( $( popup ).style.top );
|
||||
|
||||
if ( ! Object.isUndefined( this.ajaxCache[ id ] ) )
|
||||
{
|
||||
if ( this.options.AjaxCacheExpire )
|
||||
{
|
||||
if ( now - parseInt( this.options.AjaxCacheExpire ) < this.ajaxCache[ id ]['time'] )
|
||||
{
|
||||
this.debugWrite( "Fetching from cache " + id );
|
||||
|
||||
/* Just update the card with the contents previously fetched */
|
||||
this.card.update( this.ajaxCache[ id ]['content'] );
|
||||
this.card.ready = true;
|
||||
|
||||
/* Now Check after and reposition if need be */
|
||||
this._rePos( bDims, popup, this.id );
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.debugWrite( "Fetching from cache " + id );
|
||||
|
||||
/* Just update the card with the contents previously fetched */
|
||||
this.card.update( this.ajaxCache[ id ]['content'] );
|
||||
this.card.ready = true;
|
||||
|
||||
/* Now Check after and reposition if need be */
|
||||
this._rePos( bDims, popup, this.id );
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fetching ID? */
|
||||
if ( this.options.getId )
|
||||
{
|
||||
var _id = $(id).readAttribute('hovercard-id');
|
||||
url = this.options.ajaxUrl + '&' + this.options.setIdParam + '=' + _id;
|
||||
}
|
||||
|
||||
this.debugWrite( "Ajax load " + id + " " + url );
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( t.responseText != 'error' )
|
||||
{
|
||||
if( t.responseText == 'nopermission' )
|
||||
{
|
||||
alert( ipb.lang['no_permission'] );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check for log out */
|
||||
if ( t.responseText.match( "__session__expired__log__out__" ) )
|
||||
{
|
||||
this.update('');
|
||||
alert( "Your session has expired, please refresh the page and log back in" );
|
||||
return false;
|
||||
}
|
||||
|
||||
this.debugWrite( "AJAX done!" );
|
||||
this.card.update( t.responseText );
|
||||
this.card.ready = true;
|
||||
|
||||
/* Now Check after and reposition if need be */
|
||||
this._rePos( bDims, popup, this.id );
|
||||
|
||||
this.ajaxCache[ id ] = { 'content': t.responseText, 'time': now };
|
||||
}
|
||||
else
|
||||
{
|
||||
this.debugWrite( t.responseText );
|
||||
return;
|
||||
}
|
||||
}.bind(this)
|
||||
});
|
||||
},
|
||||
|
||||
_rePos: function( bDims, popup, id )
|
||||
{
|
||||
//Debug.dir( bDims);
|
||||
//Debug.write('here'); //Debug.dir( aDims);
|
||||
//this.debugWrite(id)/;
|
||||
/* Now Check after and reposition if need be */
|
||||
aDims = {};
|
||||
aDims['height'] = $( popup ).getHeight();
|
||||
aDims['top'] = parseInt( $( popup ).getStyle( 'top' ) );
|
||||
|
||||
if ( $( 'pu__' + id + '_stem').className.match( /top/ ) && ( aDims['height'] != bDims['height'] ) )
|
||||
{
|
||||
var _nt = bDims['top'] - ( aDims['height'] - bDims['height'] );
|
||||
|
||||
$( popup ).setStyle( { 'top': _nt + 'px' } );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Fetch unixtime
|
||||
*
|
||||
*/
|
||||
unixtime: function()
|
||||
{
|
||||
var _time = new Date();
|
||||
return Date.parse( _time ) / 1000;
|
||||
},
|
||||
|
||||
/**
|
||||
* Hovering over a pop-up?
|
||||
*/
|
||||
overPopUp: function( id )
|
||||
{
|
||||
e = this.curEvent;
|
||||
|
||||
/* Moz chokes without try. */
|
||||
try
|
||||
{
|
||||
if ( Event.element(e) && Event.element(e).descendantOf( $('pu__' + this.id + '_popup') ) )
|
||||
{
|
||||
this.debugWrite( "*** Over Pop Up ***" );
|
||||
|
||||
/* Test close again */
|
||||
if ( this.openId !== false )
|
||||
{
|
||||
this.timer[id + '_out'] = setTimeout( this.close.bind(this, id), 800 );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch(err){}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Debug write. Allows me to turn this off quickly
|
||||
*/
|
||||
debugWrite: function( text )
|
||||
{
|
||||
Debug.write( text );
|
||||
}
|
||||
} );
|
||||
@@ -1,521 +0,0 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.topic.js - Topic view code */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Rikki Tissier */
|
||||
/************************************************/
|
||||
|
||||
var _comments = window.IPBoard;
|
||||
|
||||
_comments.prototype.idmcomments = {
|
||||
totalChecked: 0,
|
||||
postcache: [],
|
||||
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.idmcomments.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
$$('.multiquote', '.delete_post', '.edit_post', '.toggle_post').each( function(elem){
|
||||
if( elem.hasClassName('multiquote') ){
|
||||
elem.observe('click', ipb.idmcomments.toggleMultimod);
|
||||
}
|
||||
if( elem.hasClassName('delete_post') ){
|
||||
elem.observe('click', ipb.idmcomments.confirmSingleDelete);
|
||||
}
|
||||
if( elem.hasClassName('edit_post') ){
|
||||
elem.observe('click', ipb.idmcomments.ajaxEditShow);
|
||||
}
|
||||
if( elem.hasClassName('toggle_post') ){
|
||||
elem.observe('click', ipb.idmcomments.ajaxTogglePostApprove);
|
||||
}
|
||||
});
|
||||
|
||||
// Resize images
|
||||
$$('.post').each( function(elem){
|
||||
ipb.global.findImgs( $( elem ) );
|
||||
});
|
||||
|
||||
// Open rel='external' in a new window
|
||||
$$('a[rel~="external"]').each( function(elem){
|
||||
elem.observe('click', ipb.global.openNewWindow );
|
||||
});
|
||||
|
||||
// Checkboxes
|
||||
ipb.idmcomments.preCheckPosts();
|
||||
|
||||
$$('input.post_mod').each( function(elem){
|
||||
elem.observe('click', ipb.idmcomments.checkPost );
|
||||
});
|
||||
|
||||
$$('a[rel="bookmark"]').each( function(elem){
|
||||
elem.observe('click', ipb.idmcomments.showLinkToTopic );
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Event handler for moderating posts
|
||||
*
|
||||
* @param {event} e The event
|
||||
*/
|
||||
submitPostModeration: function(e)
|
||||
{
|
||||
if( $F('idmact') == 'delete' ){
|
||||
if( !confirm( ipb.lang['delete_confirm'] ) ){
|
||||
Event.stop(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* MATT
|
||||
* Toggle post approval thingy majigy
|
||||
*/
|
||||
ajaxTogglePostApprove: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
var elem = Event.element(e);
|
||||
var postid = elem.id.replace( new RegExp( /toggle(text)?_post_/ ), '' );
|
||||
if( !postid ){ return; }
|
||||
|
||||
var toApprove = ( $('comment_id_' + postid).hasClassName( 'moderated' ) ) ? 1 : 0;
|
||||
|
||||
var url = ipb.vars['base_url'] + 'app=downloads&module=post§ion=comments&do=appcomment&xml=1&cid=' + postid + '&approve=' + toApprove;
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'post',
|
||||
evalJSON: 'force',
|
||||
parameters: {
|
||||
secure_key: ipb.vars['secure_hash']
|
||||
},
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( t.responseJSON['error'] )
|
||||
{
|
||||
switch( t.responseJSON['error'] )
|
||||
{
|
||||
case 'nofile':
|
||||
alert( ipb.lang['idm_invalid_file'] );
|
||||
break;
|
||||
case 'nopermission':
|
||||
alert( ipb.lang['no_permission'] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( toApprove )
|
||||
{
|
||||
$('comment_id_' + postid).removeClassName( 'moderated' );
|
||||
$('toggletext_post_' + postid).update( "Unapprove" );
|
||||
}
|
||||
else
|
||||
{
|
||||
$('comment_id_' + postid).addClassName( 'moderated' );
|
||||
$('toggletext_post_' + postid).update( "Approve" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
/* END MATT */
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Shows the quick ajax edit box
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
ajaxEditShow: function(e)
|
||||
{
|
||||
// If user is holding ctrl or command, just submit since they
|
||||
// want to open a new tab (requested by Luke)
|
||||
if( e.ctrlKey == true || e.metaKey == true || e.keyCode == 91 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
var edit = [];
|
||||
|
||||
edit['button'] = ( !Event.element(e).hasClassName('post_edit') ) ? Event.element(e).up('.post_edit') : Event.element(e);
|
||||
if( !edit['button'] ){ return; }
|
||||
|
||||
edit['cid'] = edit['button'].id.replace('edit_post_', '');
|
||||
edit['post'] = $( 'comment_id_' + edit['cid'] ).down('.post');
|
||||
|
||||
// Find post content
|
||||
ipb.idmcomments.postcache[ edit['cid'] ] = edit['post'].innerHTML;
|
||||
|
||||
url = ipb.vars['base_url'] + 'app=downloads&module=ajax§ion=comments&do=commentEdit&cid=' + edit['cid'] + '&secure_key=' + ipb.vars['secure_hash'];
|
||||
|
||||
// DO TEH AJAX LOL
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'post',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( t.responseText == 'nopermission' )
|
||||
{
|
||||
alert( ipb.lang['no_permission'] );
|
||||
return;
|
||||
}
|
||||
if( t.responseText == 'error' )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
|
||||
// Put it in
|
||||
edit['post'].update( t.responseText );
|
||||
new Effect.ScrollTo( edit['post'], { offset: -50 } );
|
||||
|
||||
// Init the editor SKINNOTE: this needs to respect user preference
|
||||
ipb.editors[ edit['cid'] ] = new ipb.editor( edit['cid'], USE_RTE );
|
||||
|
||||
// Set up events
|
||||
if( $('edit_save_' + edit['cid'] ) ){
|
||||
$('edit_save_' + edit['cid'] ).observe('click', ipb.idmcomments.ajaxEditSave );
|
||||
}
|
||||
if( $('edit_switch_' + edit['cid'] ) ){
|
||||
$('edit_switch_' + edit['cid'] ).observe('click', ipb.idmcomments.ajaxEditSwitch );
|
||||
}
|
||||
if( $('edit_cancel_' + edit['cid'] ) ){
|
||||
$('edit_cancel_' + edit['cid'] ).observe('click', ipb.idmcomments.ajaxEditCancel );
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Debug.write( url );
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Switches from quick edit to full editor
|
||||
*/
|
||||
ajaxEditSwitch: function(e)
|
||||
{
|
||||
// Because all posts on a topic page are wrapped in a form tag for moderation
|
||||
// purposes, to switch editor we have to perform a bit of trickery by building
|
||||
// a new form at the bottom of the page, filling it with the right values,
|
||||
// and submitting it.
|
||||
|
||||
Event.stop(e);
|
||||
var elem = Event.element(e);
|
||||
var postid = elem.id.replace('edit_switch_', '');
|
||||
if( !postid ){ return; }
|
||||
var url = ipb.vars['base_url'] + 'app=downloads&module=post§ion=comments&do=fulledit&cid=' + postid + '&st=' + ipb.idmcomments.start_id + '&_from=quickedit';
|
||||
|
||||
try {
|
||||
// Need to update for submit manually in this case
|
||||
ipb.editors[ postid ].update_for_form_submit();
|
||||
var Post = $F( postid + '_textarea' );
|
||||
} catch(err) {
|
||||
Debug.error( err );
|
||||
return;
|
||||
}
|
||||
|
||||
form = new Element('form', { action: url, method: 'post' } );
|
||||
textarea = new Element('textarea', { name: 'Post' } );
|
||||
md5check = new Element('input', { type: 'hidden', name: 'auth_key', value: ipb.vars['secure_hash'] } );
|
||||
textarea.innerHTML = Post.replace( /&/g, '&' );
|
||||
|
||||
form.insert( md5check ).insert( textarea ).hide();
|
||||
$$('body')[0].insert( form );
|
||||
|
||||
form.submit();
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Saves the contents of quick edit
|
||||
*/
|
||||
ajaxEditSave: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
var elem = Event.element(e);
|
||||
var postid = elem.id.replace('edit_save_', '');
|
||||
if( !postid ){ return; }
|
||||
|
||||
try {
|
||||
// Need to update for submit manually in this case
|
||||
ipb.editors[ postid ].update_for_form_submit();
|
||||
var Post = $F( postid + '_textarea' );
|
||||
} catch(err) {
|
||||
Debug.error( err );
|
||||
Debug.dir( ipb.editors );
|
||||
return;
|
||||
}
|
||||
|
||||
if( Post.blank() )
|
||||
{
|
||||
alert( ipb.lang['idm_comment_empty'] );
|
||||
return;
|
||||
}
|
||||
|
||||
var url = ipb.vars['base_url'] + 'app=downloads&module=ajax§ion=comments&do=commentEditSave&cid=' + postid;
|
||||
|
||||
new Ajax.Request( url,
|
||||
{
|
||||
method: 'post',
|
||||
evalJSON: 'force',
|
||||
encoding: ipb.vars['charset'],
|
||||
parameters: {
|
||||
secure_key: ipb.vars['secure_hash'],
|
||||
Post: Post.encodeParam()
|
||||
},
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( t.responseJSON['error'] )
|
||||
{
|
||||
if( $('error_msg_' + postid) )
|
||||
{
|
||||
$('error_msg_' + postid).update( t.responseJSON['error'] );
|
||||
new Effect.BlindDown( $('error_msg_' + postid), { duration: 0.4 } );
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( t.responseJSON['error'] );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Update post; SKINNOTE: need to fix linked image sizes
|
||||
// SKINNOTE: also need to reapply "code" javascript
|
||||
$('comment_id_' + postid).down('.post').update( t.responseJSON['successString'] );
|
||||
|
||||
ipb.global.findImgs( $( 'comment_id_' + postid ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Cancel the quick edit
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
ajaxEditCancel: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
var elem = Event.element(e);
|
||||
var postid = elem.id.replace('edit_cancel_', '');
|
||||
if( !postid ){ return; }
|
||||
|
||||
if( ipb.idmcomments.postcache[ postid ] ){
|
||||
$('comment_id_' + postid).down('.post').update( ipb.idmcomments.postcache[ postid ] );
|
||||
ipb.editors[ postid ] = null;
|
||||
}
|
||||
|
||||
return;
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Reads the cookie and checks posts as necessary
|
||||
*/
|
||||
preCheckPosts: function()
|
||||
{
|
||||
// Get the cookie
|
||||
cookie = ipb.Cookie.get('idmmodpids');
|
||||
if( cookie == null ){ return; }
|
||||
pids = cookie.split(',');
|
||||
|
||||
if( pids )
|
||||
{
|
||||
pids.each( function(pid){
|
||||
if( !pid.blank() && $('checkbox_' + pid) )
|
||||
{
|
||||
$('checkbox_' + pid).checked = true;
|
||||
ipb.idmcomments.totalChecked++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ipb.idmcomments.updatePostModButton();
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Checks a post
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
checkPost: function(e)
|
||||
{
|
||||
check = Event.findElement(e, 'input');
|
||||
remove = $A();
|
||||
cookie = ipb.Cookie.get('idmmodpids');
|
||||
|
||||
if( cookie != null ){
|
||||
pids = cookie.split(',') || $A();
|
||||
} else {
|
||||
pids = $A();
|
||||
}
|
||||
|
||||
if( check.checked == true )
|
||||
{
|
||||
pids.push( check.id.replace('checkbox_', '') );
|
||||
ipb.idmcomments.totalChecked++;
|
||||
}
|
||||
else
|
||||
{
|
||||
remove.push( check.id.replace('checkbox_', '') );
|
||||
ipb.idmcomments.totalChecked--;
|
||||
}
|
||||
|
||||
pids = pids.uniq().without( remove ).join(',');
|
||||
ipb.Cookie.set('idmmodpids', pids, 0);
|
||||
ipb.idmcomments.updatePostModButton();
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Updates the text on the moderation submit button
|
||||
*/
|
||||
updatePostModButton: function()
|
||||
{
|
||||
if( $('mod_submit') )
|
||||
{
|
||||
if( ipb.idmcomments.totalChecked == 0 ){
|
||||
$('mod_submit').disabled = true;
|
||||
} else {
|
||||
$('mod_submit').disabled = false;
|
||||
}
|
||||
|
||||
$('mod_submit').value = ipb.lang['with_selected'].replace('{num}', ipb.idmcomments.totalChecked);
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Shows a prompt allowing user to copy the URL
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
showLinkToTopic: function(e)
|
||||
{
|
||||
if( $( Event.element(e) ).tagName != 'A' ){ return; }
|
||||
_t = prompt( ipb.lang['copy_topic_link'], $( Event.element(e) ).readAttribute('href') );
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Confirm they want to delete stuff
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
confirmSingleDelete: function(e)
|
||||
{
|
||||
if( !confirm( ipb.lang['delete_confirm'] ) )
|
||||
{
|
||||
Event.stop(e);
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Toggles the multimod buttons in posts
|
||||
*
|
||||
* @var {event} e The event
|
||||
*/
|
||||
toggleMultimod: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
elem = Event.element(e);
|
||||
if( !elem.hasClassName('multiquote') )
|
||||
{
|
||||
elem = $( Event.element(e) ).up('.multiquote');
|
||||
}
|
||||
|
||||
// Get list of already quoted posts
|
||||
try {
|
||||
quoted = ipb.Cookie.get('idm_pids').split(',').compact();
|
||||
} catch(err){
|
||||
quoted = $A();
|
||||
}
|
||||
|
||||
id = elem.id.replace('multiq_', '');
|
||||
|
||||
// Hokay, are we selecting/deselecting?
|
||||
if( elem.hasClassName('selected') )
|
||||
{
|
||||
elem.removeClassName('selected');
|
||||
quoted = quoted.uniq().without( id ).join(',');
|
||||
}
|
||||
else
|
||||
{
|
||||
elem.addClassName('selected');
|
||||
quoted.push( id );
|
||||
quoted = quoted.uniq().join(',');
|
||||
}
|
||||
|
||||
// Save cookie
|
||||
ipb.Cookie.set('idm_pids', quoted, 0);
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Sets the supplied post to hidden
|
||||
*
|
||||
* @var {int} id The ID of the post to hide
|
||||
*/
|
||||
setPostHidden: function(id)
|
||||
{
|
||||
if( $( 'comment_id_' + id ).select('.post_wrap')[0] )
|
||||
{
|
||||
$( 'comment_id_' + id ).select('.post_wrap')[0].hide();
|
||||
|
||||
if( $('unhide_post_' + id ) )
|
||||
{
|
||||
$('unhide_post_' + id).observe('click', ipb.idmcomments.showHiddenPost );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Unhides the supplied post
|
||||
*
|
||||
* @var {event} e The link event
|
||||
*/
|
||||
showHiddenPost: function(e)
|
||||
{
|
||||
link = Event.findElement(e, 'a');
|
||||
id = link.id.replace('unhide_post_', '');
|
||||
|
||||
if( $('comment_id_' + id ).select('.post_wrap')[0] )
|
||||
{
|
||||
elem = $('comment_id_' + id ).select('.post_wrap')[0];
|
||||
new Effect.Parallel( [
|
||||
new Effect.BlindDown( elem ),
|
||||
new Effect.Appear( elem )
|
||||
], { duration: 0.5 } );
|
||||
}
|
||||
|
||||
if( $('comment_id_' + id ).select('.post_ignore')[0] )
|
||||
{
|
||||
elem = $('comment_id_' + id ).select('.post_ignore')[0];
|
||||
/*new Effect.BlindUp( elem, {duration: 0.2} );*/
|
||||
elem.hide();
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
}
|
||||
ipb.idmcomments.init();
|
||||
@@ -0,0 +1,186 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.idmsubmit.js - File uploads */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/* Original Author: Rikki Tissier */
|
||||
/* Largely based on ips.idmsubmit.js */
|
||||
/************************************************/
|
||||
/* -TRUE- MULTIPLE ATTACHMENTS!!! */
|
||||
/* -------------------------------------------- */
|
||||
|
||||
var _idmportal = window.IPBoard;
|
||||
|
||||
_idmportal.prototype.idmportal = {
|
||||
|
||||
/*
|
||||
* Generic initialization function
|
||||
*/
|
||||
init: function()
|
||||
{
|
||||
Debug.write( "Initializing ips.idmportal.js" );
|
||||
|
||||
// Menu toggle
|
||||
ipb.delegate.register('.cat_toggle', ipb.idmportal.toggleCategory);
|
||||
},
|
||||
|
||||
toggleCategory: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var group = $( elem ).up('li');
|
||||
var subgroup = $( group ).down('.subforums');
|
||||
|
||||
if( !$( group ) || !$( subgroup ) )
|
||||
{
|
||||
Debug.write("Can't find parent or subforums");
|
||||
return;
|
||||
}
|
||||
|
||||
if( $( group ).hasClassName('closed') )
|
||||
{
|
||||
new Effect.BlindDown( $( subgroup ), { duration: 0.2 } );
|
||||
$( group ).removeClassName('closed').addClassName('open');
|
||||
}
|
||||
else
|
||||
{
|
||||
new Effect.BlindUp( $( subgroup ), { duration: 0.2 } );
|
||||
$( group ).removeClassName('open').addClassName('closed');
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
scroller: Class.create({
|
||||
|
||||
initialize: function( id, total )
|
||||
{
|
||||
this.id = id;
|
||||
this.total = total;
|
||||
this.effect = Effect.Transitions.sinoidal;
|
||||
this.current = 1;
|
||||
|
||||
// Check for required elements
|
||||
if( !$( this.id + '_wrap' ) || !$( this.id + '_l' ) || !$( this.id + '_r' ) )
|
||||
{
|
||||
Debug.error("Required element missing");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set panel height
|
||||
$( this.id + '_wrap' ).setStyle( 'height: ' + $( this.id + '_wrap' ).getHeight() + 'px' );
|
||||
|
||||
// Set columns
|
||||
var w = this.getPaneWidth();
|
||||
$( this.id + '_' + this.current ).setStyle('position: absolute; width: ' + w + 'px;');
|
||||
|
||||
if( w < 690 ){
|
||||
$( this.id + '_wrap' ).removeClassName('three_column').addClassName('two_column');
|
||||
} else {
|
||||
$( this.id + '_wrap' ).addClassName('three_column').removeClassName('two_column');
|
||||
}
|
||||
|
||||
// Turn on the buttons
|
||||
this.checkButtonDisable();
|
||||
|
||||
// Set events
|
||||
$( this.id + '_l' ).observe( 'click', this.scrollLeft.bindAsEventListener(this) );
|
||||
$( this.id + '_r' ).observe( 'click', this.scrollRight.bindAsEventListener(this) );
|
||||
Event.observe( window, 'resize', this.windowResize.bindAsEventListener(this) );
|
||||
},
|
||||
|
||||
scrollLeft: function(e)
|
||||
{
|
||||
if( this.current != 1 )
|
||||
{
|
||||
var prev = $( this.id + '_' + (this.current - 1) );
|
||||
var w = this.getPaneWidth();
|
||||
var _t = this.current;
|
||||
|
||||
$( prev ).setStyle('position: absolute; width: ' + w + 'px; left: ' + ( w * -1 ) + 'px;').show();
|
||||
$( this.id + '_' + this.current ).setStyle('position: absolute; width: ' + w + 'px');
|
||||
|
||||
new Effect.Parallel([
|
||||
new Effect.Move( $( prev ), { x: 0, y: 0, mode: 'absolute' } ),
|
||||
new Effect.Move( $( this.id + '_' + this.current ), { x: w, y: 0, mode: 'absolute' } )
|
||||
], { duration: 1, transition: this.effect, afterFinish: function(){
|
||||
$( this.id + '_' + _t ).hide();
|
||||
}.bind(this) } );
|
||||
|
||||
this.current = this.current - 1;
|
||||
}
|
||||
|
||||
this.checkButtonDisable();
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
scrollRight: function(e)
|
||||
{
|
||||
if( this.current != this.total )
|
||||
{
|
||||
var next = $( this.id + '_' + (this.current + 1) );
|
||||
var w = this.getPaneWidth();
|
||||
var _t = this.current;
|
||||
|
||||
$( next ).setStyle('position: absolute; width: ' + w + 'px; left: ' + w + 'px').show();
|
||||
$( this.id + '_' + this.current ).setStyle('position: absolute; width: ' + w + 'px;');
|
||||
|
||||
new Effect.Parallel([
|
||||
new Effect.Move( $( next ), { x: 0, y: 0, mode: 'absolute' } ),
|
||||
new Effect.Move( $( this.id + '_' + this.current ), { x: (w * -1), y: 0, mode: 'absolute' } )
|
||||
], { duration: 1, transition: this.effect, afterFinish: function(){
|
||||
$( this.id + '_' + _t ).hide();
|
||||
}.bind(this) } );
|
||||
|
||||
this.current = this.current + 1;
|
||||
}
|
||||
|
||||
this.checkButtonDisable();
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
windowResize: function(e)
|
||||
{
|
||||
var w = this.getPaneWidth();
|
||||
|
||||
if( w < 690 ){
|
||||
$( this.id + '_wrap' ).removeClassName('three_column').addClassName('two_column');
|
||||
} else {
|
||||
$( this.id + '_wrap' ).addClassName('three_column').removeClassName('two_column');
|
||||
}
|
||||
|
||||
$( this.id + '_' + this.current ).setStyle('width: ' + w + 'px');
|
||||
},
|
||||
|
||||
getPaneWidth: function(e)
|
||||
{
|
||||
return $( this.id + '_wrap' ).getWidth();
|
||||
},
|
||||
|
||||
checkButtonDisable: function()
|
||||
{
|
||||
if( this.current == 1 ){
|
||||
$( this.id + '_l' ).addClassName('disabled');
|
||||
|
||||
if( this.total > 1 ){
|
||||
$( this.id + '_r').removeClassName('disabled');
|
||||
}
|
||||
}
|
||||
else if( this.current == this.total ){
|
||||
$( this.id + '_r' ).addClassName('disabled');
|
||||
|
||||
if( this.total > 1 ){
|
||||
$( this.id + '_l').removeClassName('disabled');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$( this.id + '_r' ).removeClassName('disabled');
|
||||
$( this.id + '_l' ).removeClassName('disabled');
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
ipb.idmportal.init();
|
||||
@@ -1,933 +0,0 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.idmsubmit.js - File uploads */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/* Original Author: Rikki Tissier */
|
||||
/* Largely based on ips.idmsubmit.js */
|
||||
/************************************************/
|
||||
/* -TRUE- MULTIPLE ATTACHMENTS!!! */
|
||||
/* -------------------------------------------- */
|
||||
|
||||
var _uploader = window.IPBoard;
|
||||
|
||||
_uploader.prototype.uploader = {
|
||||
uploaders: [],
|
||||
template: '',
|
||||
|
||||
/*
|
||||
* Generic initialization function
|
||||
*/
|
||||
init: function()
|
||||
{
|
||||
Debug.write( "Initializing ips.idmsubmit.js" );
|
||||
},
|
||||
|
||||
/*
|
||||
* Registers an upload object
|
||||
*/
|
||||
registerUploader: function( id, type, wrapper, options )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Must have an id
|
||||
//-----------------------------------------
|
||||
|
||||
if( Object.isUndefined( id ) || id == null )
|
||||
{
|
||||
Debug.error( "ips.idmsubmit.js: Upload manager already has that ID" );
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already exists?
|
||||
//-----------------------------------------
|
||||
|
||||
if( ipb.uploader.uploaders[ id ] )
|
||||
{
|
||||
Debug.error( "ips.idmsubmit.js: This uploader has already been registered" );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Make object
|
||||
//-----------------------------------------
|
||||
|
||||
if( type == 'swf' )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Filesize is passed in as KB
|
||||
//-----------------------------------------
|
||||
|
||||
if( options.file_size_limit )
|
||||
{
|
||||
options.file_size_limit = options.file_size_limit + " KB";
|
||||
}
|
||||
|
||||
uploader = new ipb.uploadSWF( id, options, wrapper, ipb.uploader.template );
|
||||
}
|
||||
else
|
||||
{
|
||||
uploader = new ipb.uploadTraditional( id, options, wrapper, ipb.uploader.template );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Store reference and hide fallbacks
|
||||
//-----------------------------------------
|
||||
|
||||
if( uploader )
|
||||
{
|
||||
ipb.uploader.uploaders[ id ] = uploader;
|
||||
|
||||
if( $('old_school_' + id ) )
|
||||
{
|
||||
$('old_school_' + id ).hide();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Remove an uploaded file
|
||||
*/
|
||||
removeUpload: function(e)
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Get the element
|
||||
//-----------------------------------------
|
||||
|
||||
elem = Event.findElement( e, 'li' );
|
||||
elemid = elem.id.replace('cur_', '');
|
||||
elemid = elemid.match( /^ali_(.+?)_([0-9]+)$/ );
|
||||
|
||||
if( !elemid[1] ){ return; }
|
||||
|
||||
obj = ipb.uploader.uploaders[ elemid[1] ];
|
||||
attachid = elem.readAttribute('attachid').replace('cur_', '');
|
||||
|
||||
//-----------------------------------------
|
||||
// Send request to remove upload
|
||||
//-----------------------------------------
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=downloads&module=post§ion=files&do=remove&category=" + obj.options.category + "&post_key=" +
|
||||
obj.options['post_key'] + "&type=" + obj.id + "&record_id=" + attachid + '&secure_key=' + ipb.vars['secure_hash'],
|
||||
{
|
||||
method: 'post',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) ){ alert( ipb.lang['action_failed'] ); return; }
|
||||
|
||||
if( t.responseJSON.msg == 'attach_removed' )
|
||||
{
|
||||
ipb.uploader.uploaders[ elemid[1] ].removeUpload( elem.readAttribute('attachid'), elemid[2], t.responseJSON );
|
||||
}
|
||||
else
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
/*
|
||||
* Called when a file starts uploading
|
||||
*/
|
||||
startedUploading: function(handler)
|
||||
{
|
||||
},
|
||||
|
||||
/*
|
||||
* Called when a file finishes uploading
|
||||
*/
|
||||
finishedUploading: function( attachid, fileindex )
|
||||
{
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a reference to the uploader, or false if it doesn't exist
|
||||
*/
|
||||
getUploader: function( id )
|
||||
{
|
||||
if( ipb.uploader.uploaders[ id ] )
|
||||
{
|
||||
return ipb.uploader.uploaders[ id ];
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a human-readable string for errors
|
||||
*/
|
||||
_determineServerError: function( msg )
|
||||
{
|
||||
if( msg.blank() ){ return ipb.lang['silly_server']; }
|
||||
|
||||
if( !Object.isUndefined( ipb.lang[ msg ] ) )
|
||||
{
|
||||
return ipb.lang[ msg ];
|
||||
}
|
||||
else
|
||||
{
|
||||
return ipb.lang['silly_server'];
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Function to facilitate passing JSON to iframe
|
||||
*/
|
||||
_jsonPass: function( id, json )
|
||||
{
|
||||
ipb.uploader.uploaders[ id ].json = json;
|
||||
ipb.uploader.uploaders[ id ].isReady();
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: Got json back from iframe id " + id );
|
||||
},
|
||||
|
||||
/*
|
||||
* Builds boxes of attachments
|
||||
*/
|
||||
_buildBoxes: function( currentItems, obj )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Loop over each attachment
|
||||
//-----------------------------------------
|
||||
|
||||
for( var i in currentItems )
|
||||
{
|
||||
Debug.write( "Templating item: " + currentItems[i][1] );
|
||||
|
||||
id = i;
|
||||
index = 'cur_' + currentItems[i][0];
|
||||
name = currentItems[i][1];
|
||||
size = currentItems[i][2];
|
||||
temp = obj.template.gsub(/\[id\]/, obj.id + '_' + index).gsub(/\[name\]/, name);
|
||||
|
||||
//-----------------------------------------
|
||||
// Insert the list item
|
||||
//-----------------------------------------
|
||||
|
||||
$( obj.wrapper ).insert( temp );
|
||||
|
||||
$( 'ali_' + obj.id + '_' + index ).select('.info')[0].update( ipb.global.convertSize( size ) );
|
||||
$( 'ali_' + obj.id + '_' + index ).select('.progress_bar')[0].hide();
|
||||
|
||||
new Effect.Appear( $( 'ali_' + obj.id + '_' + index ), { duration: 0.3 } );
|
||||
|
||||
$( 'ali_' + obj.id + '_' + index ).writeAttribute( 'attachid', index );
|
||||
$( 'ali_' + obj.id + '_' + index ).select('.delete')[0].observe( 'click', ipb.uploader.removeUpload );
|
||||
|
||||
['complete', 'in_progress', 'error'].each( function( cName ){ $( 'ali_' + obj.id + '_' + index ).removeClassName( cName ); }.bind( obj ) );
|
||||
|
||||
$( 'ali_' + obj.id + '_' + index ).addClassName( 'complete' );
|
||||
|
||||
if( currentItems[ i ][ 3 ] == 1 )
|
||||
{
|
||||
tmp = currentItems[ i ];
|
||||
|
||||
var width = tmp[5];
|
||||
var height = tmp[6];
|
||||
|
||||
if( ( tmp[5] && tmp[5] > 30 ) )
|
||||
{
|
||||
width = 30;
|
||||
factor = ( 30 / tmp[5] );
|
||||
height = tmp[6] * factor;
|
||||
}
|
||||
|
||||
if( ( tmp[6] && tmp[6] > 30 ) )
|
||||
{
|
||||
height = 30;
|
||||
factor = ( 30 / tmp[5] );
|
||||
width = tmp[5] * factor;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Show thumbnail if it's an image
|
||||
//-----------------------------------------
|
||||
|
||||
thumb = new Element('img', { src: tmp[4].replace( /&/, '&' ), 'width': width, 'height': height, 'class': 'thumb_img' } ).hide();
|
||||
|
||||
$( 'ali_' + obj.id + '_' + index ).select('.img_holder')[0].insert( thumb );
|
||||
new Effect.Appear( $( thumb ), { duration: 0.4 } );
|
||||
}
|
||||
|
||||
obj.boxes[ index ] = 'ali_' + obj.id + '_' + index;
|
||||
|
||||
ipb.uploader.finishedUploading( obj.id, index );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ipb.uploader.init();
|
||||
|
||||
//==============================================================
|
||||
// Traditional (iframe) uploads
|
||||
//==============================================================
|
||||
|
||||
_uploader.prototype.uploadTraditional = Class.create({
|
||||
options : [],
|
||||
boxes : [],
|
||||
id : '',
|
||||
wrapper : '',
|
||||
template : '',
|
||||
|
||||
/*
|
||||
* Initialization function
|
||||
*/
|
||||
initialize: function( id, options, wrapper, template )
|
||||
{
|
||||
this.id = id;
|
||||
this.wrapper = wrapper;
|
||||
this.template = template;
|
||||
this.options = options;
|
||||
|
||||
//-----------------------------------------
|
||||
// Build the iframe
|
||||
//-----------------------------------------
|
||||
|
||||
this.iframe = new Element('iframe', { id: 'iframeAttach_' + this.id,
|
||||
name: 'iframeAttach_' + this.id,
|
||||
scrolling: 'no',
|
||||
frameBorder: 'no',
|
||||
border: '0',
|
||||
className: '',
|
||||
allowTransparency: true,
|
||||
src: this.options.upload_url,
|
||||
tabindex: '1'
|
||||
}).setStyle({
|
||||
width: '500px',
|
||||
height: '50px',
|
||||
overflow: 'hidden',
|
||||
backgroundColor: 'transparent'
|
||||
});
|
||||
|
||||
$( this.wrapper ).insert( { after: this.iframe } ).addClassName('traditional');
|
||||
|
||||
$('add_files_' + this.id ).observe('click', this.processUpload.bindAsEventListener( this ) );
|
||||
},
|
||||
|
||||
/*
|
||||
* Remove an uploaded file
|
||||
*/
|
||||
removeUpload: function( attachid, fileindex, fileinfo )
|
||||
{
|
||||
if( attachid.startsWith('cur_') )
|
||||
{
|
||||
fileindex = 'cur_' + fileindex;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove the box
|
||||
//-----------------------------------------
|
||||
|
||||
new Effect.Fade( $( this.boxes[ fileindex ] ), { duration: 0.4 } );
|
||||
|
||||
this.boxes[ fileindex ] = null;
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", removeUpload) Attach ID: " + attachid + ", File index: " + fileindex );
|
||||
},
|
||||
|
||||
/*
|
||||
* Processes upload
|
||||
*/
|
||||
processUpload: function( e )
|
||||
{
|
||||
$( this.id + '_error_box').hide();
|
||||
var iFrameBox = window.frames[ 'iframeAttach_' + this.id ].document.getElementById('iframeUploadBox_' + this.id );
|
||||
var iFrameForm = window.frames[ 'iframeAttach_' + this.id ].document.getElementById('iframeUploadForm_' + this.id );
|
||||
var box = $('attach_' + this.id );
|
||||
|
||||
iFrameForm.action = ipb.vars['base_url'] + "app=downloads&module=post§ion=files&do=iframeUpload&post_key=" +
|
||||
this.options['post_key'] + '&fetch_all=1&type=' + this.id + "&category=" + this.options.category;
|
||||
|
||||
iFrameForm.submit();
|
||||
},
|
||||
|
||||
/*
|
||||
* Function triggered when the iframe is ready to use
|
||||
*/
|
||||
isReady: function()
|
||||
{
|
||||
if ( this.json )
|
||||
{
|
||||
if ( this.json['is_error'] )
|
||||
{
|
||||
$( this.id + '_error_box').update( ipb.lang['error'] + " <strong>" + ipb.uploader._determineServerError( this.json['msg'] ) + "</strong>" );
|
||||
$( this.id + '_error_box').show();
|
||||
}
|
||||
|
||||
if ( this.json['current_items'] )
|
||||
{
|
||||
$( this.wrapper ).update();
|
||||
ipb.uploader._buildBoxes( this.json['current_items'], this );
|
||||
}
|
||||
}
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: iFrame is ready" );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//==============================================================
|
||||
// Flash uploader object
|
||||
//==============================================================
|
||||
|
||||
_uploader.prototype.uploadSWF = Class.create({
|
||||
options : [],
|
||||
boxes : [],
|
||||
id : '',
|
||||
template : '',
|
||||
wrapper : '',
|
||||
|
||||
/*
|
||||
* Initialization function
|
||||
*/
|
||||
initialize: function( id, options, wrapper, template )
|
||||
{
|
||||
this.id = id;
|
||||
this.wrapper = wrapper;
|
||||
this.template = template;
|
||||
|
||||
//-----------------------------------------
|
||||
// Combine defaults with specified optiosn
|
||||
//-----------------------------------------
|
||||
|
||||
this.options = Object.extend({
|
||||
upload_url: '',
|
||||
file_post_name: 'FILE_UPLOAD',
|
||||
file_types: '*.*',
|
||||
file_types_description: ipb.lang['att_select_files'],
|
||||
file_size_limit: "10 MB",
|
||||
file_upload_limit: 0,
|
||||
file_queue_limit: 10,
|
||||
flash_color: ipb.vars['swf_bgcolor'] || '#FFFFFF',
|
||||
custom_settings: {},
|
||||
post_params: { 's': ipb.vars['session_id'] }
|
||||
}, arguments[1] || {});
|
||||
|
||||
if( this.options.upload_url.blank() ){ Debug.error( "(ID " + id + ") No upload URL" ); return false; }
|
||||
|
||||
//-----------------------------------------
|
||||
// Update button text
|
||||
//-----------------------------------------
|
||||
|
||||
try {
|
||||
$('add_files_' + this.id ).value = ipb.lang['swf_attach_selected' + this.id ];
|
||||
} catch(err) {
|
||||
Debug.write( err );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Setup SWFObject
|
||||
//-----------------------------------------
|
||||
|
||||
try {
|
||||
var swfu;
|
||||
|
||||
var settings = {
|
||||
upload_url: this.options.upload_url,
|
||||
flash_url: ipb.vars['swfupload_swf'],
|
||||
file_post_name: this.options.file_post_name,
|
||||
file_types: this.options.file_types,
|
||||
file_types_description: this.options.file_types_description,
|
||||
file_size_limit: this.options.file_size_limit,
|
||||
file_upload_limit: this.options.file_upload_limit,
|
||||
file_queue_limit: this.options.file_queue_limit,
|
||||
custom_settings: this.options.custom_settings,
|
||||
post_params: this.options.post_params,
|
||||
debug: ipb.vars['swfupload_debug'],
|
||||
|
||||
// ---- BUTTON SETTINGS ----
|
||||
button_placeholder_id: this.id + '_buttonPlaceholder',
|
||||
button_width: $('add_files_' + this.id ).getWidth(),
|
||||
button_height: 30,
|
||||
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
|
||||
button_cursor: SWFUpload.CURSOR.HAND,
|
||||
|
||||
// ---- EVENTS ----
|
||||
upload_error_handler: this._uploadError.bind(this),
|
||||
upload_start_handler: this._uploadStart.bind(this),
|
||||
upload_success_handler: this._uploadSuccess.bind(this),
|
||||
upload_complete_handler: this._uploadComplete.bind(this),
|
||||
upload_progress_handler: this._uploadProgress.bind(this),
|
||||
file_dialog_complete_handler: this._fileDialogComplete.bind(this),
|
||||
file_queue_error_handler: this._fileQueueError.bind(this),
|
||||
queue_complete_handler: this._queueComplete.bind(this),
|
||||
file_queued_handler: this._fileQueued.bind(this)
|
||||
}
|
||||
|
||||
swfu = new SWFUpload( settings );
|
||||
|
||||
this.obj = swfu;
|
||||
|
||||
//-----------------------------------------
|
||||
// Get existing records
|
||||
//-----------------------------------------
|
||||
|
||||
var getExisting = ipb.vars['base_url'] + "app=downloads&module=post§ion=files&do=flash&category=" + this.options.category + "&post_key=" +
|
||||
options['post_key'] + '&secure_key=' + ipb.vars['secure_hash'] + '&fetch_all=1&type=' + this.id;
|
||||
|
||||
//-----------------------------------------
|
||||
// Send the AJAX request
|
||||
//-----------------------------------------
|
||||
|
||||
var bindref = this;
|
||||
|
||||
new Ajax.Request( getExisting,
|
||||
{
|
||||
method: 'get',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) ){ alert( ipb.lang['action_failed'] ); return; }
|
||||
|
||||
if( t.responseJSON.current_items )
|
||||
{
|
||||
ipb.uploader._buildBoxes( t.responseJSON.current_items, this );
|
||||
}
|
||||
}.bind(bindref)
|
||||
});
|
||||
|
||||
this.obj.onmouseover = $('SWFUpload_0').focus();
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ") Created uploader");
|
||||
return true;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
Debug.error( "ips.idmsubmit.js: (ID " + this.id + ") " + e );
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Removes an upload from the list (note: actual removing of file is done in the wrapper object
|
||||
*/
|
||||
removeUpload: function( attachid, fileindex, fileinfo )
|
||||
{
|
||||
if( attachid.startsWith('cur_') )
|
||||
{
|
||||
fileindex = 'cur_' + fileindex;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove box
|
||||
//-----------------------------------------
|
||||
|
||||
new Effect.Fade( $( this.boxes[ fileindex ] ), { duration: 0.4 } );
|
||||
|
||||
this.boxes[ fileindex ] = null;
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", removeUpload) Attach ID: " + attachid + ", File index: " + fileindex );
|
||||
},
|
||||
|
||||
/*
|
||||
* Sets a CSS class on the box depending on status
|
||||
*/
|
||||
_setStatus: function( file, type )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Remove any old statuses before setting new one
|
||||
//-----------------------------------------
|
||||
|
||||
['complete', 'in_progress', 'error'].each( function( cName ){ $( this.boxes[ file ] ).removeClassName( cName ); }.bind( this ) );
|
||||
|
||||
$( this.boxes[ file ] ).addClassName( type );
|
||||
},
|
||||
|
||||
/*
|
||||
* Updates the info string for an upload
|
||||
*/
|
||||
_updateInfo: function( file, msg )
|
||||
{
|
||||
$( this.boxes[ file ] ).select('.info')[0].update( msg );
|
||||
},
|
||||
|
||||
/*
|
||||
* Returns a human-readable string for errors
|
||||
*/
|
||||
_determineServerError: function( msg )
|
||||
{
|
||||
if( msg.blank() ){ return ipb.lang['silly_server']; }
|
||||
|
||||
if( !Object.isUndefined( ipb.lang[ msg ] ) )
|
||||
{
|
||||
return ipb.lang[ msg ];
|
||||
}
|
||||
else
|
||||
{
|
||||
return ipb.lang['silly_server'];
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Builds the list row for each upload
|
||||
*/
|
||||
_buildBox: function( file )
|
||||
{
|
||||
temp = this.template.gsub(/\[id\]/, this.id + '_' + file.index).gsub(/\[name\]/, file.name);
|
||||
this.boxes[ file.index ] = 'ali_' + this.id + '_' + file.index;
|
||||
|
||||
$( this.wrapper ).insert( temp );
|
||||
|
||||
new Effect.Appear( $( this.boxes[ file.index ] ), { duration: 0.3 } );
|
||||
this._updateInfo( file.index, ipb.global.convertSize( file.size ) + "bytes" );
|
||||
},
|
||||
|
||||
/*
|
||||
* The files in the queue finished uploading
|
||||
*/
|
||||
_queueComplete: function( numFiles )
|
||||
{
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", " + numFiles + " finished uploading");
|
||||
},
|
||||
|
||||
/*
|
||||
* A file has been added to the queue
|
||||
*/
|
||||
_fileQueued: function( file )
|
||||
{
|
||||
this._buildBox( file );
|
||||
$( this.boxes[ file.index ] ).addClassName('in_progress');
|
||||
this._updateInfo( file.index, ipb.lang['pending'] );
|
||||
},
|
||||
|
||||
/*
|
||||
* Event handler for fileQueueError
|
||||
*/
|
||||
_fileQueueError: function( file, errorCode, message )
|
||||
{
|
||||
var msg;
|
||||
|
||||
try {
|
||||
if( errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED )
|
||||
{
|
||||
alert( ipb.lang['upload_queue'] + message );
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (errorCode)
|
||||
{
|
||||
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
|
||||
msg = ipb.lang['upload_too_big'];
|
||||
break;
|
||||
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
|
||||
msg = ipb.lang['upload_no_file'];
|
||||
break;
|
||||
case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
|
||||
msg = ipb.lang['invalid_mime_type'];
|
||||
break;
|
||||
default:
|
||||
if( file !== null )
|
||||
{
|
||||
msg = ipb.lang['upload_failed'] + " " + errorCode;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
this._setStatus( file.index, 'error' );
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", fileQueueError) " + errorCode + ": " + message );
|
||||
}
|
||||
catch( err )
|
||||
{
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", fileQueueError) " + errorCode + ": " + message );
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Event handler for uploadError
|
||||
*/
|
||||
_uploadError: function( file, errorCode, message )
|
||||
{
|
||||
var msg;
|
||||
|
||||
switch( errorCode )
|
||||
{
|
||||
case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
|
||||
msg = ipb.lang['error'] + message;
|
||||
break;
|
||||
case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
|
||||
msg = message;
|
||||
break;
|
||||
case SWFUpload.UPLOAD_ERROR.IO_ERROR:
|
||||
msg = ipb.lang['error'] + " IO";
|
||||
break;
|
||||
case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
|
||||
msg = ipb.lang['error_security'];
|
||||
break;
|
||||
case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
|
||||
msg = ipb.lang['upload_limit_hit'];
|
||||
break;
|
||||
case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
|
||||
msg = ipb.lang['invalid_mime_type'];
|
||||
break;
|
||||
default:
|
||||
msg = ipb.lang['error'] + ": " + errorCode;
|
||||
break;
|
||||
}
|
||||
|
||||
this._setStatus( file.index, 'error' );
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", uploadError) " + errorCode + ": " + message );
|
||||
return false;
|
||||
},
|
||||
|
||||
/*
|
||||
* Event handler for uploadStart
|
||||
*/
|
||||
_uploadStart: function( file )
|
||||
{
|
||||
ipb.uploader.startedUploading( this.id );
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", uploadStart) " );
|
||||
},
|
||||
|
||||
/*
|
||||
* Event handler for uploadSuccess
|
||||
*/
|
||||
_uploadSuccess: function( file, serverData )
|
||||
{
|
||||
if( !serverData.isJSON() ){ this._setStatus( file.index, 'error' ); this._updateInfo( file.index, ipb.lang['silly_server'] ); }
|
||||
returnedObj = serverData.evalJSON();
|
||||
|
||||
if( Object.isUndefined( returnedObj ) ){ this._setStatus( file.index, 'error' ); this._updateInfo( file.index, ipb.lang['silly_server'] ); }
|
||||
|
||||
//-----------------------------------------
|
||||
// Was there an error?
|
||||
//-----------------------------------------
|
||||
|
||||
if( returnedObj.is_error == 1 )
|
||||
{
|
||||
msg = this._determineServerError( returnedObj.msg );
|
||||
this._setStatus( file.index, 'error' );
|
||||
this._updateInfo( file.index, msg );
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Thumbnails
|
||||
//-----------------------------------------
|
||||
|
||||
if( returnedObj.current_items[ returnedObj.insert_id ][ 3 ] == 1 )
|
||||
{
|
||||
tmp = returnedObj.current_items[ returnedObj.insert_id ];
|
||||
|
||||
var width = tmp[5];
|
||||
var height = tmp[6];
|
||||
|
||||
if( ( tmp[5] && tmp[5] > 30 ) )
|
||||
{
|
||||
width = 30;
|
||||
factor = ( 30 / tmp[5] );
|
||||
height = tmp[6] * factor;
|
||||
}
|
||||
|
||||
if( ( tmp[6] && tmp[6] > 30 ) )
|
||||
{
|
||||
height = 30;
|
||||
factor = ( 30 / tmp[5] );
|
||||
width = tmp[5] * factor;
|
||||
}
|
||||
|
||||
thumb = new Element('img', { src: tmp[4].replace( /&/, '&' ), 'width': width, 'height': height, 'class': 'thumb_img' } ).hide();
|
||||
|
||||
$( this.boxes[ file.index ] ).select('.img_holder')[0].insert( thumb );
|
||||
new Effect.Appear( $( thumb ), { duration: 0.4 } );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set status and size
|
||||
//-----------------------------------------
|
||||
|
||||
this._setStatus( file.index, 'complete' );
|
||||
this._updateInfo( file.index, ipb.lang['upload_done'].gsub( /\[total\]/, ipb.global.convertSize( file.size ) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Store attachid
|
||||
//-----------------------------------------
|
||||
|
||||
$( this.boxes[ file.index ] ).writeAttribute( 'attachid', returnedObj.insert_id );
|
||||
|
||||
//-----------------------------------------
|
||||
// Deletion event handler
|
||||
//-----------------------------------------
|
||||
|
||||
$( this.boxes[ file.index ] ).select('.delete')[0].observe( 'click', ipb.uploader.removeUpload );
|
||||
|
||||
//-----------------------------------------
|
||||
// Clean up
|
||||
//-----------------------------------------
|
||||
|
||||
ipb.uploader.finishedUploading( this.id, file.index );
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", uploadSuccess) " + serverData );
|
||||
},
|
||||
|
||||
/*
|
||||
* Event handler for uploadComplete
|
||||
*/
|
||||
_uploadComplete: function( file )
|
||||
{
|
||||
ipb.uploader.finishedUploading( this.id );
|
||||
|
||||
progress_bar = $( this.boxes[ file.index ] ).select('.progress_bar span')[0];
|
||||
progress_bar.setStyle( "width: 100%" );
|
||||
new Effect.Fade( $( this.boxes[ file.index ] ).select('.progress_bar')[0], { duration: 0.6 } );
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", uploadComplete)" );
|
||||
},
|
||||
|
||||
/*
|
||||
* Event handler for uploadProgress (build progress bar)
|
||||
*/
|
||||
_uploadProgress: function( file, bytesLoaded, bytesTotal)
|
||||
{
|
||||
var percent = Math.ceil((bytesLoaded / bytesTotal) * 100);
|
||||
|
||||
progress_bar = $( this.boxes[ file.index ] ).select('.progress_bar span')[0];
|
||||
progress_bar.setStyle( "width: " + percent + "%" ).update( percent + "%" );
|
||||
|
||||
this._setStatus( file.index, 'in_progress' );
|
||||
this._updateInfo( file.index, ipb.lang['upload_progress'].gsub( /\[done\]/, ipb.global.convertSize( bytesLoaded ) ).gsub( /\[total\]/, ipb.global.convertSize( bytesTotal ) ) )
|
||||
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", uploadProgress)" );
|
||||
},
|
||||
|
||||
/*
|
||||
* Event handler for fileDialogComplete (called when used finishes selecting files)
|
||||
*/
|
||||
_fileDialogComplete: function( number, queued )
|
||||
{
|
||||
Debug.write( "ips.idmsubmit.js: (ID " + this.id + ", fileDialogComplete) Number: " + number + ", Queued: " + queued );
|
||||
this.obj.startUpload();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//==============================================================
|
||||
// Flash detection script
|
||||
//==============================================================
|
||||
|
||||
/*
|
||||
Copyright (c) 2007, James Auldridge
|
||||
All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://www.jaaulde.com/license.txt
|
||||
|
||||
Version 1.0
|
||||
|
||||
Change Log:
|
||||
* 09 JAN 07 - Version 1.0 written
|
||||
|
||||
*/
|
||||
//Preparing namespace
|
||||
var jimAuld = window.jimAuld || {};
|
||||
jimAuld.utils = jimAuld.utils || {};
|
||||
jimAuld.utils.flashsniffer = {
|
||||
lastMajorRelease: 10,
|
||||
installed: false,
|
||||
version: null,
|
||||
detect: function()
|
||||
{
|
||||
var fp,fpd,fAX;
|
||||
if (navigator.plugins && navigator.plugins.length)
|
||||
{
|
||||
fp = navigator.plugins["Shockwave Flash"];
|
||||
if (fp)
|
||||
{
|
||||
jimAuld.utils.flashsniffer.installed = true;
|
||||
if (fp.description)
|
||||
{
|
||||
fpd = fp.description;
|
||||
jimAuld.utils.flashsniffer.version = fpd.substr( fpd.indexOf('.')-2, 2 ).strip();
|
||||
Debug.write( jimAuld.utils.flashsniffer.version );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jimAuld.utils.flashsniffer.installed = false;
|
||||
}
|
||||
if (navigator.plugins["Shockwave Flash 2.0"]){
|
||||
jimAuld.utils.flashsniffer.installed = true;
|
||||
jimAuld.utils.flashsniffer.version = 2;
|
||||
}
|
||||
}
|
||||
else if (navigator.mimeTypes && navigator.mimeTypes.length)
|
||||
{
|
||||
fp = navigator.mimeTypes['application/x-shockwave-flash'];
|
||||
if (fp && fp.enabledPlugin)
|
||||
{
|
||||
jimAuld.utils.flashsniffer.installed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
jimAuld.utils.flashsniffer.installed = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(var i=jimAuld.utils.flashsniffer.lastMajorRelease;i>=2;i--)
|
||||
{
|
||||
try
|
||||
{
|
||||
fAX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
|
||||
jimAuld.utils.flashsniffer.installed = true;
|
||||
jimAuld.utils.flashsniffer.version = i;
|
||||
break;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
if(jimAuld.utils.flashsniffer.installed == null){
|
||||
try
|
||||
{
|
||||
fAX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
||||
jimAuld.utils.flashsniffer.installed = true;
|
||||
jimAuld.utils.flashsniffer.version = 2;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
if(jimAuld.utils.flashsniffer.installed == null)
|
||||
{
|
||||
jimAuld.utils.flashsniffer.installed = false;
|
||||
}
|
||||
fAX = null;
|
||||
}
|
||||
|
||||
},
|
||||
isVersion: function(exactVersion)
|
||||
{
|
||||
return (jimAuld.utils.flashsniffer.version!=null && jimAuld.utils.flashsniffer.version==exactVersion);
|
||||
},
|
||||
isLatestVersion: function()
|
||||
{
|
||||
return (jimAuld.utils.flashsniffer.version!=null && jimAuld.utils.flashsniffer.version==jimAuld.utils.flashsniffer.lastMajorRelease);
|
||||
},
|
||||
meetsMinVersion: function(minVersion)
|
||||
{
|
||||
return (jimAuld.utils.flashsniffer.version!=null && jimAuld.utils.flashsniffer.version>=minVersion);
|
||||
}
|
||||
};
|
||||
jimAuld.utils.flashsniffer.detect();
|
||||
|
||||
@@ -58,13 +58,14 @@ _notes.prototype.imagenotes = Class.create({
|
||||
this.initImage.bind( this ).delay( .2 );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var imageDims = $( this.id ).getDimensions();
|
||||
|
||||
// Wrap the image
|
||||
this.imageWrap = new Element( 'div', { id: this.id + '_wrap' } );
|
||||
$( this.id ).wrap( this.imageWrap );
|
||||
this.imageWrap.setStyle( { width: imageDims['width'] + 'px', height: imageDims['height'] + 'px' } ).addClassName('image_view_wrap');
|
||||
this.imageWrap.setStyle( { background: "url(data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)" } );
|
||||
|
||||
// Build current notes
|
||||
this.buildNotes();
|
||||
@@ -83,8 +84,16 @@ _notes.prototype.imagenotes = Class.create({
|
||||
$( this.options.add_note ).observe('click', this.addNote.bindAsEventListener( this ));
|
||||
}
|
||||
|
||||
if ( $('notes_trigger') )
|
||||
{
|
||||
$('notes_trigger').setStyle( { cursor: 'pointer' } );
|
||||
$('notes_trigger').observe( 'mouseover', this.imageHover.bindAsEventListener( this ) );
|
||||
$('notes_trigger').observe( 'mouseout' , this.imageHoverOff.bindAsEventListener( this ) );
|
||||
}
|
||||
|
||||
// Set up body events
|
||||
Event.observe( document.body, 'click', this.bodyClick.bindAsEventListener( this ) );
|
||||
|
||||
},
|
||||
|
||||
/*------------------------------*/
|
||||
@@ -96,8 +105,13 @@ _notes.prototype.imagenotes = Class.create({
|
||||
return;
|
||||
}
|
||||
|
||||
ipb.menus.closeAll(e);
|
||||
|
||||
this.i++;
|
||||
|
||||
/* Cancel lightbox */
|
||||
this._cancelLightbox();
|
||||
|
||||
var wrapDims = $( this.imageWrap ).getDimensions();
|
||||
|
||||
this.buildNote( this.id + '_new_' + this.i, { content: '',
|
||||
@@ -107,10 +121,7 @@ _notes.prototype.imagenotes = Class.create({
|
||||
|
||||
// Show notes even if not mousing over
|
||||
this.imageHover( e, function(){
|
||||
this.noteSelect( null, this.id + '_new_' + this.i );
|
||||
/*new Effect.Pulsate( $( 'note_' + this.id + '_new_' + this.i ), { pulses: 2, duration: 0.5, afterFinish: function(){
|
||||
this.noteSelect( null, this.id + '_new_' + this.i );
|
||||
}.bind(this) } )*/
|
||||
this.noteSelect( e, this.id + '_new_' + this.i );
|
||||
}.bind(this) );
|
||||
|
||||
},
|
||||
@@ -273,7 +284,12 @@ _notes.prototype.imagenotes = Class.create({
|
||||
/*------------------------------*/
|
||||
/* Note select */
|
||||
noteSelect: function( e, id )
|
||||
{
|
||||
{
|
||||
Event.stop( e );
|
||||
|
||||
/* Cancel it */
|
||||
this._cancelLightbox();
|
||||
|
||||
if( this.dragging ){ return; }
|
||||
|
||||
$( 'note_' + id ).addClassName('selected');
|
||||
@@ -351,7 +367,7 @@ _notes.prototype.imagenotes = Class.create({
|
||||
'left': containerPos['left'],
|
||||
'width': boxSize['width'],
|
||||
'height': boxSize['height'],
|
||||
'note': content,
|
||||
'note': content.encodeParam(),
|
||||
'noteId': noteId
|
||||
},
|
||||
onSuccess: function(t)
|
||||
@@ -466,7 +482,7 @@ _notes.prototype.imagenotes = Class.create({
|
||||
alert( ipb.lang['required_data_missing'] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}.bind( this )
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -488,6 +504,9 @@ _notes.prototype.imagenotes = Class.create({
|
||||
$( 'note_form_' + id ).remove();
|
||||
$( 'note_' + id ).writeAttribute('editing', 'no').removeClassName('selected');
|
||||
this.currentEdit = null;
|
||||
|
||||
/* Restore lightbox */
|
||||
this._restoreLightbox();
|
||||
},
|
||||
|
||||
/*------------------------------*/
|
||||
@@ -531,6 +550,29 @@ _notes.prototype.imagenotes = Class.create({
|
||||
}
|
||||
});
|
||||
}
|
||||
,
|
||||
|
||||
/**
|
||||
* Cancel lightbox
|
||||
*/
|
||||
_cancelLightbox: function()
|
||||
{
|
||||
if ( $('ips_lightbox') )
|
||||
{
|
||||
$('ips_lightbox').writeAttribute('available', 'false');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Restore lightbox
|
||||
*/
|
||||
_restoreLightbox: function()
|
||||
{
|
||||
if ( $('ips_lightbox') )
|
||||
{
|
||||
$('ips_lightbox').writeAttribute('available', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.like.js - Like class */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Matt Mecham */
|
||||
/************************************************/
|
||||
|
||||
var _like = window.IPBoard;
|
||||
|
||||
_like.prototype.like = {
|
||||
/* Set up some defaults */
|
||||
relid : 0,
|
||||
app : '',
|
||||
aprea : '',
|
||||
isfave : 0,
|
||||
popped : undefined,
|
||||
wrap: undefined,
|
||||
uc: null,
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
init: function()
|
||||
{
|
||||
/* Delegate */
|
||||
document.observe("dom:loaded", function()
|
||||
{
|
||||
ipb.delegate.register('.ftoggle' , ipb.like.clicked );
|
||||
ipb.delegate.register('._fsubmit', ipb.like.save );
|
||||
ipb.delegate.register('._funset' , ipb.like.remove );
|
||||
ipb.delegate.register('._fmore' , ipb.like.more );
|
||||
|
||||
/* Make sure hcards work */
|
||||
ipb.like.resetEvents();
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Reset events
|
||||
*/
|
||||
resetEvents: function()
|
||||
{
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Hey, I clicked when we first met
|
||||
*/
|
||||
clicked: function( e, elem )
|
||||
{
|
||||
Event.stop(e);
|
||||
relem = elem.up('.ips_like');
|
||||
relem.identify();
|
||||
|
||||
ipb.like.wrap = relem;
|
||||
|
||||
try
|
||||
{
|
||||
ipb.like.relid = relem.readAttribute('data-relid');
|
||||
ipb.like.app = relem.readAttribute('data-app');
|
||||
ipb.like.area = relem.readAttribute('data-area');
|
||||
ipb.like.isfave = relem.readAttribute('data-isfave');
|
||||
}
|
||||
catch( e )
|
||||
{
|
||||
Debug.error(e);
|
||||
}
|
||||
|
||||
if ( ipb.like.relid && ipb.like.app && ipb.like.area )
|
||||
{
|
||||
/* GTG WING LEADER */
|
||||
if ( parseInt( ipb.like.isfave ) == 1 )
|
||||
{
|
||||
ipb.like.dialogueUnset(e, elem);
|
||||
}
|
||||
else
|
||||
{
|
||||
ipb.like.dialogueSet(e, elem);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Fetch 'more'pop-up
|
||||
*/
|
||||
more: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
relem = elem.up('.ips_like');
|
||||
relem.identify();
|
||||
|
||||
ipb.like.wrap = relem;
|
||||
|
||||
try
|
||||
{
|
||||
ipb.like.relid = relem.readAttribute('data-relid');
|
||||
ipb.like.app = relem.readAttribute('data-app');
|
||||
ipb.like.area = relem.readAttribute('data-area');
|
||||
ipb.like.isfave = relem.readAttribute('data-isfave');
|
||||
}
|
||||
catch( e )
|
||||
{
|
||||
Debug.error(e);
|
||||
}
|
||||
|
||||
if ( ! Object.isUndefined( ipb.like.popped ) )
|
||||
{
|
||||
ipb.like.popped.kill();
|
||||
}
|
||||
|
||||
var popid = 'setfave_' + ipb.like.relid;
|
||||
var _url = ipb.vars['base_url'] + '&app=core&module=ajax§ion=like&do=more&secure_key=' + ipb.vars['secure_hash'] + '&f_app=' + ipb.like.app + '&f_area=' + ipb.like.area + '&f_relid=' + ipb.like.relid;
|
||||
Debug.write( _url );
|
||||
|
||||
/* easy one this... */
|
||||
ipb.like.popped = new ipb.Popup( popid, { type: 'pane',
|
||||
ajaxURL: _url,
|
||||
stem: false,
|
||||
hideAtStart: false,
|
||||
h: '800px',
|
||||
w: '450px' });
|
||||
},
|
||||
|
||||
/**
|
||||
* Unset as favorite
|
||||
*/
|
||||
dialogueUnset: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( ! Object.isUndefined( ipb.like.popped ) )
|
||||
{
|
||||
ipb.like.popped.kill();
|
||||
}
|
||||
|
||||
var popid = 'setfave_' + ipb.like.relid;
|
||||
var _content = FAVE_TEMPLATE.evaluate();
|
||||
|
||||
/* easy one this... */
|
||||
ipb.like.popped = new ipb.Popup( popid, { type: 'balloon',
|
||||
initial: _content,
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
attach: { target: elem, position: 'auto' },
|
||||
w: '350px' });
|
||||
},
|
||||
|
||||
/**
|
||||
* Set as favorite
|
||||
*/
|
||||
dialogueSet: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( ! Object.isUndefined( ipb.like.popped ) )
|
||||
{
|
||||
ipb.like.popped.kill();
|
||||
}
|
||||
|
||||
var popid = 'setfave_' + ipb.like.relid;
|
||||
var _url = ipb.vars['base_url'] + '&app=core&module=ajax§ion=like&do=setDialogue&secure_key=' + ipb.vars['secure_hash'] + '&f_app=' + ipb.like.app + '&f_area=' + ipb.like.area + '&f_relid=' + ipb.like.relid;
|
||||
Debug.write( _url );
|
||||
|
||||
/* easy one this... */
|
||||
ipb.like.popped = new ipb.Popup( popid, { type: 'balloon',
|
||||
ajaxURL: _url,
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
attach: { target: elem, position: 'auto' },
|
||||
w: '350px' });
|
||||
},
|
||||
|
||||
/**
|
||||
* Save it for later
|
||||
*/
|
||||
save: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var like_notify = $('like_notify').checked ? 1 : 0;
|
||||
var like_freq = $F('like_freq');
|
||||
var like_anon = $('like_anon').checked ? 1 : 0;
|
||||
|
||||
ipb.like.popped.hide();
|
||||
|
||||
ipb.like.wrap.writeAttribute( 'data-isfave', 1 );
|
||||
ipb.like.isfave = 1;
|
||||
|
||||
var _url = ipb.vars['base_url'] + '&app=core&module=ajax§ion=like&do=save&secure_key=' + ipb.vars['secure_hash'] + '&f_app=' + ipb.like.app + '&f_area=' + ipb.like.area + '&f_relid=' + ipb.like.relid;
|
||||
Debug.write( _url );
|
||||
|
||||
new Ajax.Request( _url,
|
||||
{
|
||||
method: 'post',
|
||||
parameters: { 'like_notify': like_notify,
|
||||
'like_freq' : like_freq,
|
||||
'like_anon' : like_anon },
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/* No Permission */
|
||||
if( t.responseText == 'nopermission' )
|
||||
{
|
||||
alert( ipb.lang['no_permission'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
ipb.like.wrap.update( t.responseText );
|
||||
|
||||
/* Make sure hcards work */
|
||||
ipb.like.resetEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Save it for later
|
||||
*/
|
||||
remove: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
ipb.like.popped.hide();
|
||||
|
||||
ipb.like.wrap.writeAttribute( 'data-isfave', 0 );
|
||||
ipb.like.isfave = 0;
|
||||
|
||||
var _url = ipb.vars['base_url'] + '&app=core&module=ajax§ion=like&do=unset&secure_key=' + ipb.vars['secure_hash'] + '&f_app=' + ipb.like.app + '&f_area=' + ipb.like.area + '&f_relid=' + ipb.like.relid;
|
||||
Debug.write( _url );
|
||||
|
||||
new Ajax.Request( _url,
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/* No Permission */
|
||||
if( t.responseText == 'nopermission' )
|
||||
{
|
||||
alert( ipb.lang['no_permission'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
ipb.like.wrap.update( t.responseText );
|
||||
|
||||
/* Make sure hcards work */
|
||||
ipb.like.resetEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
ipb.like.init();
|
||||
@@ -56,5 +56,6 @@ _memberlist.prototype.mlist = {
|
||||
} } );
|
||||
Event.stop(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.mlist.init();
|
||||
@@ -78,6 +78,8 @@ _msg.prototype.messenger = {
|
||||
$('add_participants').observe('click', ipb.messenger.loadInvites);
|
||||
}
|
||||
|
||||
ipb.delegate.register('.email_convo', ipb.messenger.emailConversation);
|
||||
|
||||
// Delegate for delete post
|
||||
ipb.delegate.register('.delete_post', ipb.messenger.deleteReply);
|
||||
|
||||
@@ -87,6 +89,63 @@ _msg.prototype.messenger = {
|
||||
});
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Empty a conversation
|
||||
*
|
||||
* @param {event} e The event
|
||||
* @return {boolean}
|
||||
*/
|
||||
emailConversation: function(e, elem)
|
||||
{
|
||||
if( Object.isUndefined( elem ) ){ return; }
|
||||
Event.stop(e);
|
||||
|
||||
// Get id
|
||||
|
||||
id = elem.id.replace( 'email_convo_', '' );
|
||||
|
||||
Debug.write( "Sending topic ID: " + id );
|
||||
|
||||
if( ! id )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// OK, empty
|
||||
url = '&app=members&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=messenger&do=archiveConversation&memberID='+ipb.vars['member_id']+'&topicID=' + id;
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + url,
|
||||
{
|
||||
method: 'post',
|
||||
parameters: { method: 'all' },
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert("An error occurred");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( t.responseJSON['error'] )
|
||||
{
|
||||
alert( t.responseJSON['error'] );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( t.responseJSON['msg'] && $('email_convo_text_' + id ) )
|
||||
{
|
||||
$('email_convo_text_' + id ).update( t.responseJSON['msg'] );
|
||||
Effect.Pulsate( $('email_convo_text_' + id ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Shows the popup for adding more participants
|
||||
@@ -286,7 +345,7 @@ _msg.prototype.messenger = {
|
||||
/* SKINNOTE: let this function delete messages too */
|
||||
break;
|
||||
default:
|
||||
alert( t.responseJSON['error'] )
|
||||
alert( t.responseJSON['error'] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -317,6 +376,8 @@ _msg.prototype.messenger = {
|
||||
{
|
||||
if( ipb.messenger.editShown )
|
||||
{
|
||||
$('edit_folders').update( $('edit_folders').innerHTML.replace( /(.+?)> (.+?)<\/a>/i, "$1> " + ipb.lang['messenger_edit'] + "</a>" ) );
|
||||
|
||||
$('folder_list').select('.edit_folders').each( function(elem){
|
||||
new Effect.Fade( elem, { duration: 0.4 } );
|
||||
});
|
||||
@@ -345,7 +406,9 @@ _msg.prototype.messenger = {
|
||||
ipb.messenger.editShown = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
$('edit_folders').update( $('edit_folders').innerHTML.replace( /(.+?)> (.+?)<\/a>/i, "$1> " + ipb.lang['messenger_cancel'] + "</a>" ) );
|
||||
|
||||
$('folder_list').select('.total').each( function(elem){
|
||||
new Effect.Fade( elem, { duration: 0.4 } );
|
||||
});
|
||||
@@ -615,7 +678,7 @@ _msg.prototype.messenger = {
|
||||
{
|
||||
alert( ipb.lang['reached_max_folders'] );
|
||||
}
|
||||
else( t.responseJSON['error'] )
|
||||
else
|
||||
{
|
||||
alert( t.responseJSON['error'] );
|
||||
}
|
||||
@@ -644,5 +707,6 @@ _msg.prototype.messenger = {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.messenger.init();
|
||||
+150
-150
@@ -1,151 +1,151 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* easeter.js - Easter Eggs Shhhh */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
var _easter = window.IPBoard;
|
||||
var timer;
|
||||
var comet;
|
||||
|
||||
_easter.prototype.easter = {
|
||||
snowFlakesCount: 35,
|
||||
|
||||
snowFlakesColors: new Array("#AAAACC","#DDDDFF","#CCCCDD","#F3F3F3","#F0FFFF"),
|
||||
|
||||
snowFlakesTypes: new Array("Arial Black","Arial Narrow","Times","Comic Sans MS"),
|
||||
|
||||
snowFlakesMaxSize: 22,
|
||||
snowFlakesMinSize: 8,
|
||||
|
||||
cometColors: new Array('#ff0000','#00ff00','#ffffff','#ff00ff','#ffa500','#ffff00','#00ff00','#ffffff','ff00ff'),
|
||||
|
||||
/** No more config **/
|
||||
|
||||
snow: new Array(),
|
||||
coordinates: new Array(),
|
||||
positions: new Array(),
|
||||
movements: new Array(),
|
||||
browserWidth: document.viewport.getWidth(),
|
||||
browserHeight: document.viewport.getHeight(),
|
||||
mouseX: 0,
|
||||
mouseY: 0,
|
||||
|
||||
/** Random number generator **/
|
||||
getRandomNumber: function(range)
|
||||
{
|
||||
return Math.floor( range * Math.random() );
|
||||
},
|
||||
|
||||
/** Initialization **/
|
||||
init: function()
|
||||
{
|
||||
document.observe("dom:loaded", function(){
|
||||
/** Snowflakes **/
|
||||
var snowsizerange = ipb.easter.snowFlakesMaxSize - ipb.easter.snowFlakesMinSize;
|
||||
|
||||
for ( i=0; i<=ipb.easter.snowFlakesCount; i++ )
|
||||
{
|
||||
var blah = new Element( 'span', { id: "s" + i } ).update( '*' );
|
||||
blah.absolutize();
|
||||
$$('body')[0].insert( { top: blah } );
|
||||
|
||||
ipb.easter.coordinates[i] = 0;
|
||||
ipb.easter.positions[i] = Math.random()*15;
|
||||
ipb.easter.movements[i] = 0.03 + Math.random()/10;
|
||||
|
||||
$( "s" + i ).setStyle( { fontFamily: ipb.easter.snowFlakesTypes[ ipb.easter.getRandomNumber(ipb.easter.snowFlakesTypes.length) ] } );
|
||||
$( "s" + i ).size = ipb.easter.getRandomNumber(snowsizerange) + ipb.easter.snowFlakesMinSize;
|
||||
$( "s" + i ).setStyle( { fontSize: $( "s" + i ).size } );
|
||||
$( "s" + i ).setStyle( { color: ipb.easter.snowFlakesColors[ ipb.easter.getRandomNumber(ipb.easter.snowFlakesColors.length) ] } );
|
||||
$( "s" + i ).sink = .6 * $( "s" + i ).size/5;
|
||||
$( "s" + i ).posx = ipb.easter.getRandomNumber( ipb.easter.browserWidth - $( "s" + i ).size );
|
||||
$( "s" + i ).posy = ipb.easter.getRandomNumber( 2 * ipb.easter.browserHeight - ipb.easter.browserHeight - 2 * $( "s" + i ).size );
|
||||
$( "s" + i ).setStyle( { left: $( "s" + i ).posx + 'px' } );
|
||||
$( "s" + i ).setStyle( { top: $( "s" + i ).posy + 'px' } );
|
||||
}
|
||||
|
||||
ipb.easter.moveSnow();
|
||||
|
||||
/** Comet Trail **/
|
||||
for (i = 0; i < 10; i++ )
|
||||
{
|
||||
var blah = new Element( 'div', { id: "dots" + i } );
|
||||
blah.absolutize();
|
||||
blah.setStyle(
|
||||
{
|
||||
position: 'absolute',
|
||||
top: '0px',
|
||||
left: '0px',
|
||||
width: i/2 + 'px',
|
||||
height: i/2 + 'px',
|
||||
background: '#ff0000',
|
||||
fontSize: i/2
|
||||
}
|
||||
)
|
||||
|
||||
$$('body')[0].insert( { bottom: blah } );
|
||||
}
|
||||
|
||||
Event.observe( document, "mousemove", ipb.easter.captureMouse );
|
||||
ipb.easter.mouseTrail();
|
||||
|
||||
$('branding').update( "<img src='admin/skin_cp/images/const.gif'> <marquee width='70%'><blink><FONT size=9>В разработке</FONT></blink></marquee>" );
|
||||
});
|
||||
},
|
||||
|
||||
/** Move snow **/
|
||||
moveSnow: function()
|
||||
{
|
||||
for ( i=0; i <= ipb.easter.snowFlakesCount; i++ )
|
||||
{
|
||||
ipb.easter.coordinates[i] += ipb.easter.movements[i];
|
||||
$( "s" + i ).posy += $( "s" + i ).sink;
|
||||
|
||||
$( "s" + i ).setStyle( { left: Math.floor($( "s" + i ).posx + ipb.easter.positions[i] * Math.sin( ipb.easter.coordinates[i] )) + 'px' } );
|
||||
$( "s" + i ).setStyle( { top: Math.floor($( "s" + i ).posy) + 'px' } );
|
||||
|
||||
if ( $( "s" + i ).posy >= ipb.easter.browserHeight - 2 * $( "s" + i ).size ||
|
||||
parseInt($( "s" + i ).style.left) > ( ipb.easter.browserHeight - 3 * ipb.easter.positions[i] ) )
|
||||
{
|
||||
$( "s" + i ).posx = ipb.easter.getRandomNumber( ipb.easter.browserWidth - $( "s" + i ).size );
|
||||
$( "s" + i ).posy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
timer = setTimeout( "ipb.easter.moveSnow()", 50 );
|
||||
},
|
||||
|
||||
captureMouse: function(e)
|
||||
{
|
||||
ipb.easter.mouseX = Event.pointerX(e);
|
||||
ipb.easter.mouseY = Event.pointerY(e);
|
||||
},
|
||||
|
||||
mouseTrail: function()
|
||||
{
|
||||
for ( i = 0; i < 10; i++ )
|
||||
{
|
||||
var randcolours = ipb.easter.cometColors[ ipb.easter.getRandomNumber( ipb.easter.cometColors.length ) ];
|
||||
$( "dots" + i ).setStyle( { background: randcolours } );
|
||||
|
||||
if (i < 9)
|
||||
{
|
||||
$( "dots" + i ).setStyle( { top: parseInt($( "dots" + (i+1) ).getStyle('top') ) + 'px' } );
|
||||
$( "dots" + i ).setStyle( { left: parseInt($( "dots" + (i+1) ).getStyle('left') ) + 'px' } );
|
||||
}
|
||||
else
|
||||
{
|
||||
$( "dots" + i ).setStyle( { top: ipb.easter.mouseY + 'px' } );
|
||||
$( "dots" + i ).setStyle( { left: ipb.easter.mouseX + 'px' } );
|
||||
}
|
||||
}
|
||||
|
||||
comet = setTimeout( "ipb.easter.mouseTrail()", 10 );
|
||||
}
|
||||
};
|
||||
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* easeter.js - Easter Eggs Shhhh */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Brandon Farber */
|
||||
/************************************************/
|
||||
|
||||
var _easter = window.IPBoard;
|
||||
var timer;
|
||||
var comet;
|
||||
|
||||
_easter.prototype.easter = {
|
||||
snowFlakesCount: 35,
|
||||
|
||||
snowFlakesColors: new Array("#AAAACC","#DDDDFF","#CCCCDD","#F3F3F3","#F0FFFF"),
|
||||
|
||||
snowFlakesTypes: new Array("Arial Black","Arial Narrow","Times","Comic Sans MS"),
|
||||
|
||||
snowFlakesMaxSize: 22,
|
||||
snowFlakesMinSize: 8,
|
||||
|
||||
cometColors: new Array('#ff0000','#00ff00','#ffffff','#ff00ff','#ffa500','#ffff00','#00ff00','#ffffff','ff00ff'),
|
||||
|
||||
/** No more config **/
|
||||
|
||||
snow: new Array(),
|
||||
coordinates: new Array(),
|
||||
positions: new Array(),
|
||||
movements: new Array(),
|
||||
browserWidth: document.viewport.getWidth(),
|
||||
browserHeight: document.viewport.getHeight(),
|
||||
mouseX: 0,
|
||||
mouseY: 0,
|
||||
|
||||
/** Random number generator **/
|
||||
getRandomNumber: function(range)
|
||||
{
|
||||
return Math.floor( range * Math.random() );
|
||||
},
|
||||
|
||||
/** Initialization **/
|
||||
init: function()
|
||||
{
|
||||
document.observe("dom:loaded", function(){
|
||||
/** Snowflakes **/
|
||||
var snowsizerange = ipb.easter.snowFlakesMaxSize - ipb.easter.snowFlakesMinSize;
|
||||
|
||||
for ( i=0; i<=ipb.easter.snowFlakesCount; i++ )
|
||||
{
|
||||
var blah = new Element( 'span', { id: "s" + i } ).update( '*' );
|
||||
blah.absolutize();
|
||||
$$('body')[0].insert( { top: blah } );
|
||||
|
||||
ipb.easter.coordinates[i] = 0;
|
||||
ipb.easter.positions[i] = Math.random()*15;
|
||||
ipb.easter.movements[i] = 0.03 + Math.random()/10;
|
||||
|
||||
$( "s" + i ).setStyle( { fontFamily: ipb.easter.snowFlakesTypes[ ipb.easter.getRandomNumber(ipb.easter.snowFlakesTypes.length) ] } );
|
||||
$( "s" + i ).size = ipb.easter.getRandomNumber(snowsizerange) + ipb.easter.snowFlakesMinSize;
|
||||
$( "s" + i ).setStyle( { fontSize: $( "s" + i ).size } );
|
||||
$( "s" + i ).setStyle( { color: ipb.easter.snowFlakesColors[ ipb.easter.getRandomNumber(ipb.easter.snowFlakesColors.length) ] } );
|
||||
$( "s" + i ).sink = .6 * $( "s" + i ).size/5;
|
||||
$( "s" + i ).posx = ipb.easter.getRandomNumber( ipb.easter.browserWidth - $( "s" + i ).size );
|
||||
$( "s" + i ).posy = ipb.easter.getRandomNumber( 2 * ipb.easter.browserHeight - ipb.easter.browserHeight - 2 * $( "s" + i ).size );
|
||||
$( "s" + i ).setStyle( { left: $( "s" + i ).posx + 'px' } );
|
||||
$( "s" + i ).setStyle( { top: $( "s" + i ).posy + 'px' } );
|
||||
}
|
||||
|
||||
ipb.easter.moveSnow();
|
||||
|
||||
/** Comet Trail **/
|
||||
for (i = 0; i < 10; i++ )
|
||||
{
|
||||
var blah = new Element( 'div', { id: "dots" + i } );
|
||||
blah.absolutize();
|
||||
blah.setStyle(
|
||||
{
|
||||
position: 'absolute',
|
||||
top: '0px',
|
||||
left: '0px',
|
||||
width: i/2 + 'px',
|
||||
height: i/2 + 'px',
|
||||
background: '#ff0000',
|
||||
fontSize: i/2
|
||||
}
|
||||
);
|
||||
|
||||
$$('body')[0].insert( { bottom: blah } );
|
||||
}
|
||||
|
||||
Event.observe( document, "mousemove", ipb.easter.captureMouse );
|
||||
ipb.easter.mouseTrail();
|
||||
|
||||
$('branding').update( "<img src='admin/skin_cp/images/const.gif'> <marquee width='70%'><blink><FONT size=9>В разработке</FONT></blink></marquee>" );
|
||||
});
|
||||
},
|
||||
|
||||
/** Move snow **/
|
||||
moveSnow: function()
|
||||
{
|
||||
for ( i=0; i <= ipb.easter.snowFlakesCount; i++ )
|
||||
{
|
||||
ipb.easter.coordinates[i] += ipb.easter.movements[i];
|
||||
$( "s" + i ).posy += $( "s" + i ).sink;
|
||||
|
||||
$( "s" + i ).setStyle( { left: Math.floor($( "s" + i ).posx + ipb.easter.positions[i] * Math.sin( ipb.easter.coordinates[i] )) + 'px' } );
|
||||
$( "s" + i ).setStyle( { top: Math.floor($( "s" + i ).posy) + 'px' } );
|
||||
|
||||
if ( $( "s" + i ).posy >= ipb.easter.browserHeight - 2 * $( "s" + i ).size ||
|
||||
parseInt($( "s" + i ).style.left) > ( ipb.easter.browserHeight - 3 * ipb.easter.positions[i] ) )
|
||||
{
|
||||
$( "s" + i ).posx = ipb.easter.getRandomNumber( ipb.easter.browserWidth - $( "s" + i ).size );
|
||||
$( "s" + i ).posy = 0;
|
||||
}
|
||||
}
|
||||
|
||||
timer = setTimeout( "ipb.easter.moveSnow()", 50 );
|
||||
},
|
||||
|
||||
captureMouse: function(e)
|
||||
{
|
||||
ipb.easter.mouseX = Event.pointerX(e);
|
||||
ipb.easter.mouseY = Event.pointerY(e);
|
||||
},
|
||||
|
||||
mouseTrail: function()
|
||||
{
|
||||
for ( i = 0; i < 10; i++ )
|
||||
{
|
||||
var randcolours = ipb.easter.cometColors[ ipb.easter.getRandomNumber( ipb.easter.cometColors.length ) ];
|
||||
$( "dots" + i ).setStyle( { background: randcolours } );
|
||||
|
||||
if (i < 9)
|
||||
{
|
||||
$( "dots" + i ).setStyle( { top: parseInt($( "dots" + (i+1) ).getStyle('top') ) + 'px' } );
|
||||
$( "dots" + i ).setStyle( { left: parseInt($( "dots" + (i+1) ).getStyle('left') ) + 'px' } );
|
||||
}
|
||||
else
|
||||
{
|
||||
$( "dots" + i ).setStyle( { top: ipb.easter.mouseY + 'px' } );
|
||||
$( "dots" + i ).setStyle( { left: ipb.easter.mouseX + 'px' } );
|
||||
}
|
||||
}
|
||||
|
||||
comet = setTimeout( "ipb.easter.mouseTrail()", 10 );
|
||||
}
|
||||
};
|
||||
|
||||
ipb.easter.init();
|
||||
@@ -1,31 +1,32 @@
|
||||
var _moderate = window.IPBoard;
|
||||
|
||||
_moderate.prototype.moderate = {
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.moderate.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
$$('.cancel').each( function cancelMod(elem) {
|
||||
elem.observe('click', ipb.moderate.resetCookie);
|
||||
} );
|
||||
});
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Reset the cookie so topic page works properly
|
||||
*
|
||||
* @param {event} e The event
|
||||
*/
|
||||
resetCookie: function(e)
|
||||
{
|
||||
link = Event.findElement(e, 'a');
|
||||
href = link.getAttribute('href');
|
||||
pids = href.replace( new RegExp( /.+?\/selectedpids[\/=]([0-9,]+)(\/|$)/ ), '$1' );
|
||||
|
||||
ipb.Cookie.set('modpids', pids, 0);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
ipb.moderate.init();
|
||||
var _moderate = window.IPBoard;
|
||||
|
||||
_moderate.prototype.moderate = {
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.moderate.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
$$('.cancel').each( function cancelMod(elem) {
|
||||
elem.observe('click', ipb.moderate.resetCookie);
|
||||
} );
|
||||
});
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Reset the cookie so topic page works properly
|
||||
*
|
||||
* @param {event} e The event
|
||||
*/
|
||||
resetCookie: function(e)
|
||||
{
|
||||
link = Event.findElement(e, 'a');
|
||||
href = link.getAttribute('href');
|
||||
pids = href.replace( new RegExp( /.+?\/selectedpids[\/=]([0-9,]+)(\/|$)/ ), '$1' );
|
||||
|
||||
ipb.Cookie.set('modpids', pids, 0);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
ipb.moderate.init();
|
||||
@@ -0,0 +1,59 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.nexus.js - Javascript for nexus frontend */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Rikki Tissier */
|
||||
/************************************************/
|
||||
var _nexus = window.IPBoard;
|
||||
|
||||
_nexus.prototype.nexus = {
|
||||
currentTab: '',
|
||||
|
||||
init: function()
|
||||
{
|
||||
document.observe("dom:loaded", function(){
|
||||
ipb.delegate.register(".tab", ipb.nexus.toggleTab);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
toggleTab: function( e, elem )
|
||||
{
|
||||
Event.stop(e);
|
||||
var id = $( elem ).id.replace('t_', '');
|
||||
Debug.write( id );
|
||||
if( ipb.nexus.currentTab == id || !$('t_pane_' + id) ){ return; }
|
||||
|
||||
$('t_pane_' + ipb.nexus.currentTab).hide();
|
||||
$('t_pane_' + id).show();
|
||||
|
||||
$( 't_' + ipb.nexus.currentTab ).removeClassName('active');
|
||||
$( 't_' + id ).addClassName('active');
|
||||
|
||||
ipb.nexus.currentTab = id;
|
||||
},
|
||||
|
||||
setUpAltContacts: function()
|
||||
{
|
||||
// Autocomplete
|
||||
new ipb.Autocomplete( $('name'), { multibox: false, url: ipb.vars['base_url'] + 'app=core&module=ajax§ion=findnames&do=get-member-names&secure_key=' + ipb.vars['secure_hash'] + '&name=', templates: { wrap: ipb.templates['autocomplete_wrap'], item: ipb.templates['autocomplete_item'] } } );
|
||||
|
||||
$('add_new_contact').hide();
|
||||
|
||||
$('add_new_toggle').observe('click', function(e){
|
||||
Event.stop(e);
|
||||
new Effect.BlindDown( $('add_new_contact'), { duration: 0.3 } );
|
||||
$('add_new_toggle').hide();
|
||||
});
|
||||
},
|
||||
|
||||
setUpReferrals: function()
|
||||
{
|
||||
$('refer_code_html').observe('focus', function(){ this.select(); });
|
||||
$('refer_code_bbcode').observe('focus', function(){ this.select(); });
|
||||
}
|
||||
};
|
||||
|
||||
ipb.nexus.init();
|
||||
@@ -130,7 +130,7 @@ _poll.prototype.poll = {
|
||||
$('add_poll').show();
|
||||
}
|
||||
|
||||
$('add_poll').observe('click', ipb.poll.toggleForm);
|
||||
$('add_poll').down('li').observe('click', ipb.poll.toggleForm);
|
||||
$('close_poll').observe('click', ipb.poll.toggleForm);
|
||||
|
||||
// We need to hook an event onto the form for this poll,
|
||||
@@ -320,7 +320,7 @@ _poll.prototype.poll = {
|
||||
Event.stop(e);
|
||||
|
||||
if( ipb.poll._choices.size() >= ipb.poll.maxQuestions ){
|
||||
alert( ipb.lang['poll_no_more_q'] )
|
||||
alert( ipb.lang['poll_no_more_q'] );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -442,6 +442,6 @@ _poll.prototype.poll = {
|
||||
Debug.write( max );
|
||||
return max;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
ipb.poll.init();
|
||||
@@ -127,5 +127,6 @@ _post.prototype.post = {
|
||||
$('post_options_options').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.post.init();
|
||||
@@ -12,6 +12,7 @@ var _profile = window.IPBoard;
|
||||
_profile.prototype.profile = {
|
||||
activeTab: '',
|
||||
viewingProfile: 0,
|
||||
customization: 0,
|
||||
|
||||
init: function()
|
||||
{
|
||||
@@ -19,6 +20,12 @@ _profile.prototype.profile = {
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
ipb.profile.initEvents();
|
||||
|
||||
/* Profile pics */
|
||||
if ( ipb.profile.customization )
|
||||
{
|
||||
ipb.profile.updateBgImage();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -48,13 +55,6 @@ _profile.prototype.profile = {
|
||||
$('dname_history').observe('click', ipb.profile.showDNameHistory );
|
||||
}
|
||||
|
||||
if( $('update_status_form') )
|
||||
{
|
||||
$('update_status_form').hide();
|
||||
$('status_box').insert( { bottom: "<a href='#' id='update_status' title='" + ipb.lang['prof_update_tooltip'] + "'>" + ipb.lang['prof_update_button'] + "</a>" } );
|
||||
$('update_status').observe('click', ipb.profile.initStatusEdit );
|
||||
}
|
||||
|
||||
if( $('view-all-friends') )
|
||||
{
|
||||
$('view-all-friends').observe('click', ipb.profile.retrieveFriends );
|
||||
@@ -64,6 +64,17 @@ _profile.prototype.profile = {
|
||||
/*ipb.delegate.register('.bbc_spoiler_show', ipb.global.toggleSpoiler);*/
|
||||
},
|
||||
|
||||
/**
|
||||
* Resize and set BG image
|
||||
*/
|
||||
updateBgImage: function()
|
||||
{
|
||||
var main = $('main_profile_body');
|
||||
|
||||
$('userBg').setStyle( { 'height': main.getHeight() + 'px' } );
|
||||
|
||||
},
|
||||
|
||||
deleteComment: function(e, elem)
|
||||
{
|
||||
if( !confirm( ipb.lang['delete_confirm'] ) )
|
||||
@@ -91,35 +102,15 @@ _profile.prototype.profile = {
|
||||
onSuccess: function(t)
|
||||
{
|
||||
$('friend_list').innerHTML = t.responseText;
|
||||
Debug.write( t.responseText);
|
||||
/* if we have an opaque bg, make it fit */
|
||||
$('userBg').setStyle( { 'height': $('main_profile_body').getHeight() + 'px' } );
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Shows the text box for updating the users status
|
||||
*
|
||||
* @param {event} e The event
|
||||
*/
|
||||
initStatusEdit: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if( !$('status_holder') ){ return; }
|
||||
|
||||
var old_status = $('status_holder').innerHTML;
|
||||
$('status_holder').insert( { before: ipb.templates['edit_status'] } ).hide();
|
||||
|
||||
$('updated_status').value = old_status.unescapeHTML();
|
||||
$('update_status').hide();
|
||||
|
||||
$('cancel_status').observe('click', ipb.profile.cancelStatus);
|
||||
$('save_status').observe('click', ipb.profile.saveStatus);
|
||||
$('updated_status').observe('keypress', ipb.profile.watchForKeypress);
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Responds to Enter and Esc keys
|
||||
@@ -136,57 +127,7 @@ _profile.prototype.profile = {
|
||||
ipb.profile.cancelStatus( e );
|
||||
}
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Saves a users status
|
||||
*
|
||||
* @param {event} e The event
|
||||
*/
|
||||
saveStatus: function(e)
|
||||
{
|
||||
var new_status = $('updated_status').value
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&md5check=" + ipb.vars['secure_hash'],
|
||||
{
|
||||
method: 'post',
|
||||
evalJSON: 'force',
|
||||
parameters: {
|
||||
new_status: new_status.encodeParam()
|
||||
},
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( t.responseJSON['error'] )
|
||||
{
|
||||
alert( t.responseJSON['error'] );
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('edit_status').remove();
|
||||
$('status_holder').innerHTML = t.responseJSON['new_status'];
|
||||
$('status_holder').show();
|
||||
$('update_status').show();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Cancels a status edit and puts back the old one
|
||||
*
|
||||
* @param {event} e The event
|
||||
*/
|
||||
cancelStatus: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
$('edit_status').remove();
|
||||
|
||||
$('status_holder').show();
|
||||
$('update_status').show();
|
||||
},
|
||||
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
@@ -261,6 +202,11 @@ _profile.prototype.profile = {
|
||||
|
||||
saveComment: function(e)
|
||||
{
|
||||
if( DISABLE_AJAX )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( !$('comment_text') ){ Event.stop(e); return; }
|
||||
|
||||
// Check for comment
|
||||
@@ -336,7 +282,6 @@ _profile.prototype.profile = {
|
||||
|
||||
changeTabContent: function(e)
|
||||
{
|
||||
|
||||
Event.stop(e);
|
||||
elem = Event.findElement(e, 'li');
|
||||
if( !elem.hasClassName('tab_toggle') || !elem.id ){ return; }
|
||||
@@ -370,6 +315,8 @@ _profile.prototype.profile = {
|
||||
if( t.responseText != 'error' )
|
||||
{
|
||||
newdiv = new Element('div', { 'id': 'tab_' + id } ).hide();
|
||||
newdiv.addClassName( 'tab_' + id.replace( ':', '_' ) );
|
||||
|
||||
newdiv.update( t.responseText );
|
||||
|
||||
$('tab_content').insert( newdiv );
|
||||
@@ -379,8 +326,6 @@ _profile.prototype.profile = {
|
||||
new Effect.BlindDown( $('tab_' + ipb.profile.activeTab), { sync: true } )
|
||||
], { duration: 0.4, afterFinish: function(){ // Re-execute JS for various things in posts
|
||||
ipb.profile.executeJavascript( $( newdiv ) ); } } );
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -392,10 +337,12 @@ _profile.prototype.profile = {
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.write( "Just showing " + ipb.profile.activeTab );
|
||||
new Effect.Parallel( [
|
||||
new Effect.BlindUp( $('tab_' + oldTab), { sync: true } ),
|
||||
new Effect.BlindDown( $('tab_' + ipb.profile.activeTab), { sync: true } )
|
||||
], { duration: 0.4 } );
|
||||
], { duration: 0.4, afterFinish: function(){ // Re-execute JS for various things in posts
|
||||
ipb.profile.executeJavascript( $( 'tab_' + id ) ); } } );
|
||||
}
|
||||
|
||||
$$('.tab_toggle').each( function(otherelem){
|
||||
@@ -403,7 +350,6 @@ _profile.prototype.profile = {
|
||||
});
|
||||
|
||||
$(elem).addClassName('active');
|
||||
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
@@ -416,11 +362,14 @@ _profile.prototype.profile = {
|
||||
{
|
||||
// Image resize
|
||||
ipb.global.findImgs( wrapper );
|
||||
|
||||
|
||||
//Code highlighting
|
||||
//dp.SyntaxHighlighter.HighlightAll('bbcode_code');
|
||||
prettyPrint();
|
||||
|
||||
/* if we have an opaque bg, make it fit */
|
||||
$('userBg').setStyle( { 'height': $('main_profile_body').getHeight() + 'px' } );
|
||||
|
||||
},
|
||||
|
||||
checkCommentLength: function(e)
|
||||
@@ -435,5 +384,6 @@ _profile.prototype.profile = {
|
||||
|
||||
$('char_remain').update( newTotal );
|
||||
}
|
||||
}
|
||||
ipb.profile.init();
|
||||
};
|
||||
|
||||
ipb.profile.init();
|
||||
@@ -27,6 +27,17 @@ _quickpm.prototype.quickpm = {
|
||||
},
|
||||
launchPMform: function(e, target)
|
||||
{
|
||||
if( DISABLE_AJAX ){
|
||||
return false;
|
||||
}
|
||||
|
||||
// If user is holding ctrl or command, just submit since they
|
||||
// want to open a new tab (requested by Luke)
|
||||
if( e.ctrlKey == true || e.metaKey == true || e.keyCode == 91 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Debug.write("Launching PM form");
|
||||
pmInfo = target.id.match( /pm_([0-9a-z]+)_([0-9]+)/ );
|
||||
|
||||
@@ -95,8 +106,9 @@ _quickpm.prototype.quickpm = {
|
||||
popup.show();
|
||||
|
||||
// Time to attach events
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].observe('click', ipb.quickpm.doSend) }
|
||||
if( $( popup.getObj() ).select('.cancel')[0] ){ $( popup.getObj() ).select('.cancel')[0].observe('click', ipb.quickpm.cancelForm) }
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].observe('click', ipb.quickpm.doSend); }
|
||||
if( $( popup.getObj() ).select('.use_full')[0] ){ $( popup.getObj() ).select('.use_full')[0].observe('click', ipb.quickpm.useFull); }
|
||||
if( $( popup.getObj() ).select('.cancel')[0] ){ $( popup.getObj() ).select('.cancel')[0].observe('click', ipb.quickpm.cancelForm); }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -113,6 +125,32 @@ _quickpm.prototype.quickpm = {
|
||||
|
||||
Event.stop(e);
|
||||
},
|
||||
useFull: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
// Build a new form
|
||||
var form = new Element('form', {
|
||||
'method': 'post',
|
||||
'action': ipb.vars['base_url'] + '&app=members&module=messaging§ion=send&do=form&preview=1&_from=quickPM&fromMemberID=' + ipb.quickpm.sendingToUser
|
||||
});
|
||||
var post = new Element('textarea', {
|
||||
'name': 'Post'
|
||||
});
|
||||
var subject = new Element('input', {
|
||||
'type': 'text',
|
||||
'value': $F('pm_subject_' + ipb.quickpm.sendingToUser),
|
||||
'name': 'msg_title'
|
||||
});
|
||||
|
||||
var val = $F('pm_textarea_' + ipb.quickpm.sendingToUser).replace( /<script/ig, '< script' ).replace( /<\/script/ig, '< /script' );
|
||||
|
||||
$( form ).insert( post ).insert( subject ).setStyle('position: absolute; left: -500px; top: 0');
|
||||
$( post ).update( val );
|
||||
$$('body')[0].insert( form );
|
||||
$( form ).submit();
|
||||
|
||||
},
|
||||
doSend: function(e)
|
||||
{
|
||||
Debug.write( "Sending" );
|
||||
@@ -133,7 +171,7 @@ _quickpm.prototype.quickpm = {
|
||||
|
||||
// Disable submit
|
||||
var popup = ipb.quickpm.popupObj;
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].disabled = true };
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].disabled = true; };
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + '&app=members&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=messenger&do=PMSend&toMemberID=' + ipb.quickpm.sendingToUser,
|
||||
{
|
||||
@@ -169,7 +207,7 @@ _quickpm.prototype.quickpm = {
|
||||
else if ( t.responseJSON['inlineError'] )
|
||||
{
|
||||
ipb.quickpm.showError( t.responseJSON['inlineError'] );
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].disabled = false };
|
||||
if( $( popup.getObj() ).select('.input_submit')[0] ){ $( popup.getObj() ).select('.input_submit')[0].disabled = false; };
|
||||
return;
|
||||
}
|
||||
else if( t.responseJSON['status'] )
|
||||
@@ -207,7 +245,7 @@ _quickpm.prototype.quickpm = {
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
ipb.quickpm.init();
|
||||
}
|
||||
};
|
||||
|
||||
ipb.quickpm.init();
|
||||
@@ -11,6 +11,7 @@ var _register = window.IPBoard;
|
||||
|
||||
_register.prototype.register = {
|
||||
inSection: '',
|
||||
memberPartial: 0,
|
||||
allowed_chars: [ ],
|
||||
|
||||
|
||||
@@ -23,9 +24,26 @@ _register.prototype.register = {
|
||||
{
|
||||
ipb.register.initFormEvents();
|
||||
}
|
||||
|
||||
if( ipb.register.inSection == 'completeReg' )
|
||||
{
|
||||
ipb.register.initCompleteRegFormEvents();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
initCompleteRegFormEvents: function()
|
||||
{
|
||||
if( $('display_name') ){
|
||||
$('display_name').observe('blur', ipb.register.checkLoginName);
|
||||
}
|
||||
if( $('email_1') && $('email_2') )
|
||||
{
|
||||
$('email_1').observe('blur', ipb.register.checkEmailValid);
|
||||
$('email_2').observe('blur', ipb.register.checkEmailMatch);
|
||||
}
|
||||
},
|
||||
|
||||
initFormEvents: function()
|
||||
{
|
||||
if( $('login_name') ){
|
||||
@@ -162,7 +180,7 @@ _register.prototype.register = {
|
||||
// Check for availability
|
||||
name = name.replace("+", "+");
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=core&module=ajax§ion=register&do=" + ajax,
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=core&module=ajax§ion=register&do=" + ajax + '&mpid=' + ipb.register.memberPartial,
|
||||
{
|
||||
method: 'post',
|
||||
parameters: {
|
||||
@@ -235,7 +253,7 @@ _register.prototype.register = {
|
||||
}
|
||||
|
||||
$(elem).removeClassName( 'error' ).removeClassName('accept');
|
||||
}
|
||||
|
||||
}
|
||||
ipb.register.init();
|
||||
}
|
||||
};
|
||||
|
||||
ipb.register.init();
|
||||
@@ -116,6 +116,6 @@ _report.prototype.reports = {
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.reports.init();
|
||||
@@ -11,6 +11,7 @@ var _search = window.IPBoard;
|
||||
|
||||
_search.prototype.search = {
|
||||
checks: [],
|
||||
curApp: null,
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
@@ -19,6 +20,9 @@ _search.prototype.search = {
|
||||
Debug.write("Initializing ips.search.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
|
||||
if( $('query') ){ $('query').focus(); }
|
||||
|
||||
// set up calendars
|
||||
if( $('date_start') && $('date_start_icon') )
|
||||
{
|
||||
@@ -33,81 +37,63 @@ _search.prototype.search = {
|
||||
ipb.search.calendar_start = new CalendarDateSelect( $('date_end'), { year_range: 6, time: true, close_on_click: true } );
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
initSearchForm: function()
|
||||
{
|
||||
// Get all checkboxes
|
||||
$$('input.filter').each( function(check){
|
||||
appID = check.identify().match('select_app_(.*)')[1];
|
||||
if( appID && appID != 'all' )
|
||||
{
|
||||
if( $('app_filter_' + appID) )
|
||||
{
|
||||
$('app_filter_' + appID ).wrap('div', { id: 'app_filter_' + appID + '_wrap' } ).hide(); //Wrap it in a div because scriptaculous is funky with fieldsets
|
||||
}
|
||||
ipb.search.checks.push( appID );
|
||||
}
|
||||
$( check ).observe('click', ipb.search.doFilters );
|
||||
});
|
||||
|
||||
if( $('author') )
|
||||
{
|
||||
// Autocomplete stuff
|
||||
document.observe("dom:loaded", function(){
|
||||
var url = ipb.vars['base_url'] + 'secure_key=' + ipb.vars['secure_hash'] + '&app=core&module=ajax§ion=findnames&do=get-member-names&name=';
|
||||
var ac = new ipb.Autocomplete( $('author'), { multibox: false, url: url, templates: { wrap: ipb.templates['autocomplete_wrap'], item: ipb.templates['autocomplete_item'] } } );
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
doFilters: function(e)
|
||||
{
|
||||
elem = Event.element(e);
|
||||
appid = elem.id.replace('select_app_', '');
|
||||
|
||||
//if( !ipb.search.checks.length ){ return; }
|
||||
|
||||
if( $( elem ) && $( elem ).id == 'select_app_all' )
|
||||
{
|
||||
if( $('select_app_all').checked )
|
||||
{
|
||||
ipb.search.checks.each( function(check){
|
||||
if( $('select_app_' + check) ){
|
||||
$('select_app_' + check).checked = false;
|
||||
|
||||
// Set up app selector
|
||||
if( $('sapps') ){
|
||||
$('sapps').select('input').each( function(elem){
|
||||
var id = $(elem).id.replace('radio_', '');
|
||||
var _d = false;
|
||||
|
||||
if( $(elem).checked ){
|
||||
$(elem).up().addClassName('active');
|
||||
ipb.search.curApp = id;
|
||||
}
|
||||
if( $('app_filter_' + check + '_wrap') )
|
||||
{
|
||||
new Effect.BlindUp( $('app_filter_' + check + '_wrap' ), { duration: 0.3 } );
|
||||
|
||||
if( $('app_filter_' + id) ){
|
||||
$('app_filter_' + id ).wrap('div', { id: 'app_filter_' + id + '_wrap' } ).addClassName('extra_filter').hide();
|
||||
$('app_filter_' + id ).show();
|
||||
if( id == ipb.search.curApp ){
|
||||
$('app_filter_' + id + '_wrap').show();
|
||||
}
|
||||
}
|
||||
|
||||
$(elem).observe('click', ipb.search.selectApp);
|
||||
});
|
||||
}
|
||||
else
|
||||
|
||||
if( $('author') )
|
||||
{
|
||||
// No change
|
||||
// Autocomplete stuff
|
||||
document.observe("dom:loaded", function(){
|
||||
var url = ipb.vars['base_url'] + 'secure_key=' + ipb.vars['secure_hash'] + '&app=core&module=ajax§ion=findnames&do=get-member-names&name=';
|
||||
var ac = new ipb.Autocomplete( $('author'), { multibox: false, url: url, templates: { wrap: ipb.templates['autocomplete_wrap'], item: ipb.templates['autocomplete_item'] } } );
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
selectApp: function(e)
|
||||
{
|
||||
var elem = Event.element(e);
|
||||
var id = $(elem).id.replace('radio_', '');
|
||||
if( !id || id == ipb.search.curApp ){ return; }
|
||||
|
||||
if( ipb.search.curApp ){
|
||||
$('sapp_' + ipb.search.curApp).removeClassName('active');
|
||||
}
|
||||
else if( $( elem ) )
|
||||
{
|
||||
if( $(elem).checked )
|
||||
{
|
||||
// Uncheck everything
|
||||
$('select_app_all').checked = false;
|
||||
|
||||
if( $('app_filter_' + appid + '_wrap' ) && !$('app_filter_' + appid + '_wrap').visible() )
|
||||
{
|
||||
new Effect.BlindDown( $('app_filter_' + appid + '_wrap' ), { duration: 0.3 } );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( $('app_filter_' + appid + '_wrap' ) && $('app_filter_' + appid + '_wrap' ).visible() )
|
||||
{
|
||||
new Effect.BlindUp( $('app_filter_' + appid + '_wrap' ), { duration: 0.3 } );
|
||||
}
|
||||
}
|
||||
$('sapp_' + id).addClassName('active');
|
||||
|
||||
if( $('app_filter_' + ipb.search.curApp) && ( $('app_filter_' + id) ) ){
|
||||
new Effect.BlindUp( $('app_filter_' + ipb.search.curApp + '_wrap'), { duration: 0.3, afterFinish: function(){
|
||||
new Effect.BlindDown( $('app_filter_' + id + '_wrap'), { duration: 0.3 } );
|
||||
}});
|
||||
} else if( $('app_filter_' + ipb.search.curApp) ){
|
||||
new Effect.BlindUp( $('app_filter_' + ipb.search.curApp + '_wrap'), { duration: 0.3 } );
|
||||
} else if( $('app_filter_' + id) ){
|
||||
new Effect.BlindDown( $('app_filter_' + id + '_wrap'), { duration: 0.3 } );
|
||||
}
|
||||
|
||||
ipb.search.curApp = id;
|
||||
}
|
||||
}
|
||||
};
|
||||
ipb.search.init();
|
||||
@@ -0,0 +1,234 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.profile.js - Forum view code */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Rikki Tissier */
|
||||
/************************************************/
|
||||
|
||||
var _sharelinks = window.IPBoard;
|
||||
|
||||
_sharelinks.prototype.sharelinks = {
|
||||
popups: null,
|
||||
bname: null,
|
||||
url: null,
|
||||
title: null,
|
||||
maxTwitterLen: 115,
|
||||
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.sharelinks.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
ipb.sharelinks.initEvents();
|
||||
});
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Initialize events
|
||||
*/
|
||||
initEvents: function()
|
||||
{
|
||||
ipb.delegate.register('._slink', ipb.sharelinks.sharePop);
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Twitter pop innit
|
||||
*
|
||||
* @param {event} e The event
|
||||
*/
|
||||
sharePop: function(e, elem)
|
||||
{
|
||||
var shareKey = elem.id.replace( /slink_/, '' );
|
||||
var ok = false;
|
||||
var callback = null;
|
||||
|
||||
if ( shareKey == 'twitter' )
|
||||
{
|
||||
if ( ipb.vars['member_id'] && ipb.vars['twitter_id'] )
|
||||
{
|
||||
callback = ipb.sharelinks.twitterPostPop;
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
else if ( shareKey == 'facebook' )
|
||||
{
|
||||
if ( ipb.vars['member_id'] && ipb.vars['fb_uid'] )
|
||||
{
|
||||
callback = ipb.sharelinks.facebookPostPop;
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ok === false || DISABLE_AJAX )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Still here? */
|
||||
Event.stop(e);
|
||||
|
||||
var _url = ipb.vars['base_url'] + '&app=core&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=sharelinks&do=' + shareKey + 'Form';
|
||||
|
||||
var x = new ipb.Popup( 'shareKeyPop_' + Math.random(), { type: 'balloon',
|
||||
ajaxURL: _url,
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
attach: { target: $('slink_' + shareKey), position: 'auto' },
|
||||
w: '400px' }, { 'afterAjax': callback, 'beforeAjax': ipb.sharelinks.resetPop } );
|
||||
},
|
||||
|
||||
/**
|
||||
* Post process twitter pop-up
|
||||
*/
|
||||
facebookPostPop: function( e )
|
||||
{
|
||||
$('fContent').update('');
|
||||
$('fSubmit').observe('click', ipb.sharelinks.goFacebook);
|
||||
},
|
||||
|
||||
/**
|
||||
* Post process twitter pop-up
|
||||
*/
|
||||
twitterPostPop: function( e )
|
||||
{
|
||||
/* clean up title */
|
||||
ipb.sharelinks.title = ipb.sharelinks.title.replace(/"/g , '"');
|
||||
ipb.sharelinks.title = ipb.sharelinks.title.replace(/!/g , "!");
|
||||
ipb.sharelinks.title = ipb.sharelinks.title.replace(/"/g, '"');
|
||||
ipb.sharelinks.title = ipb.sharelinks.title.replace(/"/g, '"');
|
||||
|
||||
/* Clean up board name */
|
||||
ipb.sharelinks.bname = ipb.sharelinks.bname.replace(/"/g , '"');
|
||||
ipb.sharelinks.bname = ipb.sharelinks.bname.replace(/!/g , "!");
|
||||
ipb.sharelinks.bname = ipb.sharelinks.bname.replace(/'/g , "'");
|
||||
ipb.sharelinks.bname = ipb.sharelinks.bname.replace(/"/g, '"');
|
||||
|
||||
$('tContent').value = ipb.sharelinks.bname + ': ' + ipb.sharelinks.title;
|
||||
$('tContent').observe('keyup', ipb.sharelinks.checkTwitterLength);
|
||||
$('tSubmit').observe('click', ipb.sharelinks.goTwitter);
|
||||
|
||||
ipb.sharelinks.checkTwitterLength(e);
|
||||
},
|
||||
|
||||
/**
|
||||
* Reset pop-up
|
||||
*/
|
||||
resetPop: function(e)
|
||||
{
|
||||
if ( $('tContent') )
|
||||
{
|
||||
$('tContent').stopObserving();
|
||||
$('tContent').remove();
|
||||
$('tSubmit').stopObserving();
|
||||
$('tWrap').remove();
|
||||
}
|
||||
|
||||
if ( $('cLeft') )
|
||||
{
|
||||
$('cLeft').remove();
|
||||
}
|
||||
|
||||
if ( $('fContent') )
|
||||
{
|
||||
$('fContent').remove();
|
||||
$('fSubmit').stopObserving();
|
||||
$('fWrap').remove();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Post a comment to twitter
|
||||
*/
|
||||
goTwitter: function(e)
|
||||
{
|
||||
if( DISABLE_AJAX )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
|
||||
if ( ! $('tContent') || $F('tContent').blank() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + '&app=core&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=sharelinks&do=twitterGo',
|
||||
{
|
||||
method: 'post',
|
||||
parameters: {
|
||||
'tweet': $F('tContent').encodeParam(),
|
||||
'title': ipb.sharelinks.title.encodeParam(),
|
||||
'url': ipb.sharelinks.url.encodeParam()
|
||||
},
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/* Check */
|
||||
if( t.responseText == 'failwhale' )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('tWrap').update( t.responseText );
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Post a comment to Facebook
|
||||
*/
|
||||
goFacebook: function(e)
|
||||
{
|
||||
if( DISABLE_AJAX )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + '&app=core&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=sharelinks&do=facebookGo',
|
||||
{
|
||||
method: 'post',
|
||||
parameters: {
|
||||
'comment': $F('fContent').encodeParam(),
|
||||
'title': ipb.sharelinks.title.encodeParam(),
|
||||
'url': ipb.sharelinks.url.encodeParam()
|
||||
},
|
||||
onSuccess: function(t)
|
||||
{
|
||||
/* Check */
|
||||
if( t.responseText == 'finchersaysno' )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('fWrap').update( t.responseText );
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
checkTwitterLength: function(e)
|
||||
{
|
||||
newTotal = parseInt( ipb.sharelinks.maxTwitterLen ) - parseInt( $F('tContent').length );
|
||||
|
||||
if( newTotal < 0 )
|
||||
{
|
||||
$('tContent').value = $F('tContent').truncate( ipb.sharelinks.maxTwitterLen, '' );
|
||||
newTotal = 0;
|
||||
}
|
||||
|
||||
$('cLeft').update( newTotal );
|
||||
}
|
||||
};
|
||||
|
||||
ipb.sharelinks.init();
|
||||
@@ -1,4 +1,4 @@
|
||||
var _signin = window.IPBoard;
|
||||
var _signin = window.IPBoard;
|
||||
|
||||
_signin.prototype.signin = {
|
||||
init: function()
|
||||
@@ -90,22 +90,22 @@ _signin.prototype.signin = {
|
||||
{
|
||||
if( !ipb.signin.isFilled( $('username') ) )
|
||||
{
|
||||
alert("Имя пользователя не введено.");
|
||||
alert( ipb.lang['signin_nosigninname'] );
|
||||
Event.stop(e);
|
||||
return;
|
||||
}
|
||||
if( !ipb.signin.isFilled( $('password') ) )
|
||||
{
|
||||
alert("Пароль не введен.");
|
||||
alert( ipb.lang['signin_nopassword'] );
|
||||
Event.stop(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !ipb.signin.isValidUrl( $F('openid') ) )
|
||||
if( !ipb.signin.isValidUrl( $F('openid').strip() ) )
|
||||
{
|
||||
alert("Предоставленный OpenID url не корректен.");
|
||||
alert( ipb.lang['signin_badopenid'] );
|
||||
Event.stop(e);
|
||||
return;
|
||||
}
|
||||
@@ -152,5 +152,6 @@ _signin.prototype.signin = {
|
||||
|
||||
return regexp.test( value );
|
||||
}
|
||||
}
|
||||
ipb.signin.init();
|
||||
};
|
||||
|
||||
ipb.signin.init();
|
||||
@@ -82,7 +82,7 @@ _ss.prototype.slideshow = {
|
||||
moveX = barLeft - 30;
|
||||
}
|
||||
|
||||
new Effect.Move( $('thumbnail_wrap'), { x: moveX, y: 0, duration: 0.2, mode: 'relative', afterFinish: function(){ ipb.slideshow.recalculateThumbnailButtons() } } );
|
||||
new Effect.Move( $('thumbnail_wrap'), { x: moveX, y: 0, duration: 0.2, mode: 'relative', afterFinish: function(){ ipb.slideshow.recalculateThumbnailButtons(); } } );
|
||||
|
||||
// Wait for more user input
|
||||
ipb.slideshow.stopAutoScroll = true;
|
||||
@@ -98,7 +98,7 @@ _ss.prototype.slideshow = {
|
||||
return;
|
||||
}
|
||||
|
||||
new Effect.Move( $('thumbnail_wrap'), { x: ( -1 * ipb.slideshow.thumbSize ), y: 0, duration: 0.2, mode: 'relative', afterFinish: function(){ ipb.slideshow.recalculateThumbnailButtons() } } );
|
||||
new Effect.Move( $('thumbnail_wrap'), { x: ( -1 * ipb.slideshow.thumbSize ), y: 0, duration: 0.2, mode: 'relative', afterFinish: function(){ ipb.slideshow.recalculateThumbnailButtons(); } } );
|
||||
|
||||
// Wait for more user input
|
||||
ipb.slideshow.stopAutoScroll = true;
|
||||
@@ -146,7 +146,7 @@ _ss.prototype.slideshow = {
|
||||
|
||||
// Continue slideshow
|
||||
ipb.slideshow.mainLoop = setTimeout( mainLoop, ( ipb.slideshow.speed * 1000 ) );
|
||||
}
|
||||
};
|
||||
|
||||
mainLoop();
|
||||
},
|
||||
@@ -328,7 +328,7 @@ _ss.prototype.slideshow = {
|
||||
var afterFinish = function()
|
||||
{
|
||||
ipb.slideshow.recalculateThumbnailButtons();
|
||||
}
|
||||
};
|
||||
|
||||
// Is the thumbnail off to the left?
|
||||
if( thumbPosition['left'] < 30 )
|
||||
@@ -524,6 +524,6 @@ _ss.prototype.slideshow = {
|
||||
ipb.slideshow.holderSize = $('image_holder').getDimensions();
|
||||
ipb.slideshow.recalculateThumbnailButtons();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.slideshow.init();
|
||||
@@ -0,0 +1,475 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.status.js - Status management code */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Matt Mecham */
|
||||
/************************************************/
|
||||
|
||||
var _status = window.IPBoard;
|
||||
|
||||
_status.prototype.status = {
|
||||
_updateClicked: false,
|
||||
maxReplies: 0,
|
||||
smallSpace: 0,
|
||||
myLatest: 0,
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.status.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
ipb.status.initEvents();
|
||||
});
|
||||
},
|
||||
|
||||
/*!! initEvents */
|
||||
initEvents: function()
|
||||
{
|
||||
Debug.write( 'Status init' );
|
||||
/* Show all comments link */
|
||||
ipb.delegate.register(".__showAll", ipb.status.showAllComments);
|
||||
|
||||
/* Links for showing reply box */
|
||||
ipb.delegate.register(".__showform", ipb.status.showForm);
|
||||
|
||||
/* Submit button for replies */
|
||||
$$('.__submit').each( function(suBo)
|
||||
{
|
||||
id = suBo.identify();
|
||||
|
||||
$(id).observe( 'click', ipb.status.addReply.bindAsEventListener( this, id.replace( 'statusSubmit-', '' ) ) );
|
||||
});
|
||||
|
||||
/* Delete comment link */
|
||||
ipb.delegate.register(".__sDR", ipb.status.deleteReply);
|
||||
|
||||
/* Delete status link */
|
||||
ipb.delegate.register(".__sD", ipb.status.deleteStatus);
|
||||
|
||||
/* Lock status link */
|
||||
ipb.delegate.register(".__sL", ipb.status.lockStatus);
|
||||
|
||||
/* Unlock status link */
|
||||
ipb.delegate.register(".__sU", ipb.status.unlockStatus);
|
||||
|
||||
/* Delete status link */
|
||||
ipb.delegate.register(".__sT", ipb.status.showFeedback);
|
||||
|
||||
/* Delete status link */
|
||||
ipb.delegate.register(".__sTO", ipb.status.hideFeedback);
|
||||
|
||||
/* Can we update our status? */
|
||||
if ( $('statusUpdate') )
|
||||
{
|
||||
ipb.status._updateClicked = false;
|
||||
|
||||
$('statusUpdate').stopObserving( 'click' );
|
||||
$('statusUpdate').stopObserving( 'keypress' );
|
||||
$('statusSubmit').stopObserving( 'click' );
|
||||
|
||||
$('statusUpdate').value = ipb.lang['prof_update_default'];
|
||||
|
||||
$('statusUpdate').addClassName('status_inactive');
|
||||
|
||||
if ( ! ipb.status.smallSpace )
|
||||
{
|
||||
$('statusSubmit').value = ipb.lang['prof_update_button'];
|
||||
$('statusSubmit').addClassName('status_smallspace');
|
||||
}
|
||||
|
||||
$('statusUpdate').observe( 'click', ipb.status.updateUpdateText.bindAsEventListener( this ) );
|
||||
$('statusUpdate').observe( 'keypress', ipb.global.checkForEnter.bindAsEventListener( this, ipb.status.updateSubmit ) );
|
||||
$('statusSubmit').observe( 'click', ipb.status.updateSubmit.bindAsEventListener( this ) );
|
||||
}
|
||||
},
|
||||
|
||||
showForm: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var id = $( elem ).id.replace('statusReplyFormShow-', '');
|
||||
if( Object.isUndefined( id ) || !$('statusReplyForm-' + id) ){ return; }
|
||||
|
||||
$(elem).hide();
|
||||
$('statusReplyForm-' + id).show();
|
||||
$('statusText-' + id).focus();
|
||||
},
|
||||
|
||||
/*!! deleteStatus */
|
||||
/* result of clicking "delete" on a status */
|
||||
updateUpdateText: function(e)
|
||||
{
|
||||
if ( ipb.status._updateClicked )
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ipb.status._updateClicked = true;
|
||||
$('statusUpdate').value = '';
|
||||
$('statusUpdate').removeClassName('status_inactive');
|
||||
}
|
||||
},
|
||||
|
||||
/*!! updateSubmit */
|
||||
/* Add a sexy ajax status" */
|
||||
updateSubmit: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( $('statusUpdate' ).value.length < 2 || $('statusUpdate').value == ipb.lang['prof_update_default'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var su_Twitter = $('su_Twitter') && $('su_Twitter').checked ? 1 : 0;
|
||||
var su_Facebook = $('su_Facebook') && $('su_Facebook').checked ? 1 : 0;
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&do=new&md5check=" + ipb.vars['secure_hash'] + '&smallSpace=' + ipb.status.smallSpace,
|
||||
{
|
||||
method: 'post',
|
||||
evalJSON: 'force',
|
||||
parameters: {
|
||||
content: $('statusUpdate' ).value.encodeParam(),
|
||||
su_Twitter: su_Twitter,
|
||||
su_Facebook: su_Facebook
|
||||
},
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
|
||||
if( t.responseJSON['error'] )
|
||||
{
|
||||
alert( t.responseJSON['error'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
$('status_wrapper').innerHTML = t.responseJSON['html'] + $('status_wrapper').innerHTML;
|
||||
|
||||
/* Showing latest only? */
|
||||
if ( ipb.status.myLatest )
|
||||
{
|
||||
if ( $('statusWrap-' + ipb.status.myLatest ) )
|
||||
{
|
||||
$('statusWrap-' + ipb.status.myLatest ).hide();
|
||||
}
|
||||
}
|
||||
|
||||
/* Need to blur out of field
|
||||
@link http://community.invisionpower.com/tracker/issue-21358-small-input-field-behavior-issue-after-updating-status/
|
||||
*/
|
||||
$('statusUpdate' ).blur();
|
||||
|
||||
/* Re-init events */
|
||||
ipb.status.initEvents();
|
||||
}
|
||||
catch(err)
|
||||
{
|
||||
Debug.error( 'Logging error: ' + err );
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*!! deleteStatus */
|
||||
/* result of clicking "delete" on a status */
|
||||
deleteStatus: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( ! confirm( ipb.lang['delete_confirm'] ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var status = $( elem ).className.match('__d([0-9]+)');
|
||||
if( status == null || Object.isUndefined( status[1] ) ){ Debug.error("Error showing all comments"); return; }
|
||||
var status_id = status[1];
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&do=deleteStatus&status_id=" + status_id + "&md5check=" + ipb.vars['secure_hash'],
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) || t.responseJSON.error )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('statusWrap-' + status_id ).remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*!! showFeedback */
|
||||
/* result of clicking "lock" on a status */
|
||||
showFeedback: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var status = $( elem ).className.match('__t([0-9]+)');
|
||||
if( status == null || Object.isUndefined( status[1] ) ){ Debug.error("Error"); return; }
|
||||
var status_id = status[1];
|
||||
|
||||
//$('statusWrap-' + status_id ).addClassName('rowdark');
|
||||
if( $('statusReplyFormShow-' + status_id ) )
|
||||
{
|
||||
$('statusReplyFormShow-' + status_id ).hide();
|
||||
}
|
||||
|
||||
if( $('statusReplyForm-' + status_id ) )
|
||||
{
|
||||
$('statusReplyForm-' + status_id ).show();
|
||||
}
|
||||
|
||||
$('statusFeedback-' + status_id ).show();
|
||||
$('statusToggle-' + status_id ).hide();
|
||||
$('statusToggleOff-' + status_id ).show();
|
||||
|
||||
if( $('statusText-' + status_id ) )
|
||||
{
|
||||
$('statusText-' + status_id ).focus();
|
||||
}
|
||||
},
|
||||
|
||||
/*!! hideFeedback */
|
||||
/* result of clicking "lock" on a status */
|
||||
hideFeedback: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var status = $( elem ).className.match('__to([0-9]+)');
|
||||
if( status == null || Object.isUndefined( status[1] ) ){ Debug.error("Error"); return; }
|
||||
var status_id = status[1];
|
||||
|
||||
//$('statusWrap-' + status_id ).removeClassName('rowdark');
|
||||
$('statusFeedback-' + status_id ).hide();
|
||||
$('statusToggle-' + status_id ).show();
|
||||
$('statusToggleOff-' + status_id ).hide();
|
||||
},
|
||||
|
||||
|
||||
/*!! lockStatus */
|
||||
/* result of clicking "lock" on a status */
|
||||
lockStatus: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( ! confirm( ipb.lang['delete_confirm'] ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var status = $( elem ).className.match('__l([0-9]+)');
|
||||
if( status == null || Object.isUndefined( status[1] ) ){ Debug.error("Error"); return; }
|
||||
var status_id = status[1];
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&do=lockStatus&status_id=" + status_id + "&md5check=" + ipb.vars['secure_hash'],
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) || t.responseJSON.error )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('statusUnlock-' + status_id ).show();
|
||||
$('statusLock-' + status_id ).hide();
|
||||
$('statusLockImg-' + status_id ).show();
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*!! unlockStatus */
|
||||
/* result of clicking "unlock" on a status */
|
||||
unlockStatus: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( ! confirm( ipb.lang['delete_confirm'] ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var status = $( elem ).className.match('__u([0-9]+)');
|
||||
if( status == null || Object.isUndefined( status[1] ) ){ Debug.error("Error"); return; }
|
||||
var status_id = status[1];
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&do=unlockStatus&status_id=" + status_id + "&md5check=" + ipb.vars['secure_hash'],
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) || t.responseJSON.error )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('statusUnlock-' + status_id ).hide();
|
||||
$('statusLock-' + status_id ).show();
|
||||
$('statusLockImg-' + status_id ).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*!! deleteReply */
|
||||
/* result of clicking "delete" on a comment */
|
||||
deleteReply: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( ! confirm( ipb.lang['delete_confirm'] ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var status = $( elem ).className.match('__dr([0-9]+)-([0-9]+)');
|
||||
if( status == null || Object.isUndefined( status[1] ) ){ Debug.error("Error showing all comments"); return; }
|
||||
var status_id = status[1];
|
||||
var reply_id = status[2];
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&do=deleteReply&status_id=" + status_id + "&reply_id=" + reply_id + "&md5check=" + ipb.vars['secure_hash'],
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) || t.responseJSON.error )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('statusReply-' + reply_id ).remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/*!! showAllComments */
|
||||
/* result of clicking "show all X comments" */
|
||||
showAllComments: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var status = $( elem ).className.match('__x([0-9]+)');
|
||||
if( status == null || Object.isUndefined( status[1] ) ){ Debug.error("Error showing all comments"); return; }
|
||||
var status_id = status[1];
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&do=showall&status_id=" + status_id + "&md5check=" + ipb.vars['secure_hash'],
|
||||
{
|
||||
method: 'get',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( t.responseJSON['error'] )
|
||||
{
|
||||
alert( t.responseJSON['error'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
$('statusMoreWrap-' + status_id ).hide();
|
||||
$('statusReplies-' + status_id ).update( t.responseJSON['html'] );
|
||||
|
||||
if ( t.responseJSON['status_replies'] > 20 )
|
||||
{
|
||||
$('statusReplies-' + status_id ).addClassName('status_replies_many');
|
||||
}
|
||||
}
|
||||
catch(err)
|
||||
{
|
||||
Debug.error( err );
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*!! addReply */
|
||||
/* Add a sexy ajax reply" */
|
||||
addReply: function(e, status_id)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( $('statusText-' + status_id ).value.length < 2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
new Ajax.Request( ipb.vars['base_url'] + "app=members§ion=status&module=ajax&do=reply&status_id=" + status_id + "&md5check=" + ipb.vars['secure_hash'],
|
||||
{
|
||||
method: 'post',
|
||||
evalJSON: 'force',
|
||||
parameters: {
|
||||
content: $('statusText-' + status_id ).value.encodeParam()
|
||||
},
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( t.responseJSON['error'] )
|
||||
{
|
||||
alert( t.responseJSON['error'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
/* Already have replies, add them there so the overflow block looks correct */
|
||||
if ( $('statusReplies-' + status_id ) )
|
||||
{
|
||||
$('statusReplies-' + status_id ).innerHTML += t.responseJSON['html'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$( 'statusReplyBlank-' + status_id ).innerHTML += t.responseJSON['html'];
|
||||
}
|
||||
|
||||
$('statusText-' + status_id ).value = '';
|
||||
|
||||
if ( t.responseJSON['status_replies'] && ipb.status.maxReplies && t.responseJSON['status_replies'] >= ipb.status.maxReplies )
|
||||
{
|
||||
$('statusMaxWrap-' + status_id ).show();
|
||||
$('statusReply-' + status_id).hide();
|
||||
}
|
||||
|
||||
}
|
||||
catch(err)
|
||||
{
|
||||
Debug.error( err );
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
ipb.status.init();
|
||||
@@ -59,6 +59,6 @@ _subscriptions.prototype.subscriptions = {
|
||||
$('register').submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
ipb.subscriptions.init();
|
||||
@@ -15,12 +15,16 @@ _topic.prototype.topic = {
|
||||
postcache: [],
|
||||
poll: [],
|
||||
pollPopups: [],
|
||||
deletePerms: {},
|
||||
deleteUrls: {},
|
||||
deletePopUps: [],
|
||||
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.topic.js");
|
||||
|
||||
document.observe("dom:loaded", function(){
|
||||
|
||||
if( ipb.topic.inSection == 'topicview' )
|
||||
{
|
||||
if( $('show_filters') )
|
||||
@@ -33,11 +37,25 @@ _topic.prototype.topic = {
|
||||
|
||||
// Set up delegates
|
||||
ipb.delegate.register('.multiquote', ipb.topic.toggleMultimod);
|
||||
ipb.delegate.register('.delete_post', ipb.topic.confirmSingleDelete);
|
||||
|
||||
ipb.delegate.register('.edit_post', ipb.topic.ajaxEditShow);
|
||||
ipb.delegate.register('.delete_post', ipb.topic.deletePopUp);
|
||||
ipb.delegate.register('.toggle_post', ipb.topic.ajaxTogglePostApprove);
|
||||
ipb.delegate.register('.sd_content', ipb.topic.sDeletePostShow);
|
||||
ipb.delegate.register('.sd_remove', ipb.topic.confirmSingleDelete);
|
||||
ipb.delegate.register('input.post_mod', ipb.topic.checkPost);
|
||||
ipb.delegate.register('a[rel="bookmark"]', ipb.topic.showLinkToTopic );
|
||||
|
||||
if( $('showforumJump') )
|
||||
{
|
||||
$('showforumJump').observe( "change", ipb.topic.jumpToForum );
|
||||
$('forum_jump_submit').hide();
|
||||
}
|
||||
}
|
||||
else if( ipb.topic.inSection == 'searchview' )
|
||||
{
|
||||
ipb.delegate.register('input.post_mod', ipb.topic.checkPost);
|
||||
ipb.delegate.register('.sd_content', ipb.topic.sDeletePostShow);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -47,7 +65,16 @@ _topic.prototype.topic = {
|
||||
ipb.global.findImgs( $( elem ) );
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
jumpToForum: function(e)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
$('forum_jump').submit();
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
@@ -79,6 +106,71 @@ _topic.prototype.topic = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Show a pop-up for soft delete / delete or just redirect if no hard link
|
||||
*/
|
||||
deletePopUp: function(e, elem)
|
||||
{
|
||||
var postid = elem.up().id.replace( /del_post_/, '' );
|
||||
if( !postid ){ return; }
|
||||
|
||||
/* First off, fix URLs */
|
||||
var _url_delete = ipb.topic.deleteUrls['hardDelete'].evaluate( { 'pid': postid } ).replace(/&/g, '&') + '&nr=1';
|
||||
var _url_soft = ipb.topic.deleteUrls['softDelete'].evaluate( { 'pid': postid } ).replace(/&/g, '&') + '&nr=1';
|
||||
var _permaShow = '';
|
||||
|
||||
/* If we can't soft delete posts, then just offload to normal function */
|
||||
if ( ! ipb.topic.deletePerms[ postid ]['canSoftDelete'] )
|
||||
{
|
||||
return ipb.topic.confirmSingleDelete(e, elem);
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
|
||||
/* Can we hard delete? */
|
||||
if ( ! ipb.topic.deletePerms[ postid ]['canDelete'] )
|
||||
{
|
||||
_permaShow = 'display:none;';
|
||||
}
|
||||
|
||||
/* Create the pop-up */
|
||||
var popid = 'pop__delete_popup_' + postid;
|
||||
var content = new Template( $('delPopUp').innerHTML ).evaluate( { removeUrl: _url_soft, permaDelete: _permaShow, permaUrl: _url_delete } );
|
||||
|
||||
ipb.topic.deletePopUps = new ipb.Popup( popid, { type: 'balloon',
|
||||
initial: content,
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
attach: { target: $('del_post_' + postid ), position: 'auto', 'event': 'click' },
|
||||
w: '450px' });
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Show's the content of soft deleted post
|
||||
*/
|
||||
sDeletePostShow: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var postid = elem.id.replace( /seeContent_/, '' );
|
||||
if( !postid ){ return; }
|
||||
|
||||
if ( ! $('postsDelete_' + postid )._showing )
|
||||
{
|
||||
$('postsDelete_' + postid ).hide();
|
||||
$('postsDeleteShow_' + postid).show();
|
||||
$('postsDelete_' + postid )._showing = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('postsDelete_' + postid ).show();
|
||||
$('postsDeleteShow_' + postid).hide();
|
||||
$('postsDelete_' + postid )._showing = 0;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* MATT
|
||||
* Toggle post approval thingy majigy
|
||||
@@ -121,11 +213,19 @@ _topic.prototype.topic = {
|
||||
{
|
||||
$('post_id_' + postid).removeClassName( 'moderated' );
|
||||
$('toggletext_post_' + postid).update( ipb.lang['unapprove'] );
|
||||
|
||||
$$('#toggle_post_' + postid + " a img").each( function(elem){
|
||||
$(elem).src = $(elem).src.replace( /accept/, 'delete' );
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('post_id_' + postid).addClassName( 'moderated' );
|
||||
$('toggletext_post_' + postid).update( ipb.lang['approve'] );
|
||||
|
||||
$$('#toggle_post_' + postid + " a img").each( function(elem){
|
||||
$(elem).src = $(elem).src.replace( /delete/, 'accept' );
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -142,6 +242,11 @@ _topic.prototype.topic = {
|
||||
*/
|
||||
ajaxEditShow: function(e, elem)
|
||||
{
|
||||
if( DISABLE_AJAX )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// If user is holding ctrl or command, just submit since they
|
||||
// want to open a new tab (requested by Luke)
|
||||
if( e.ctrlKey == true || e.metaKey == true || e.keyCode == 91 )
|
||||
@@ -189,7 +294,7 @@ _topic.prototype.topic = {
|
||||
},
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( t.responseText == 'nopermission' || t.responseText == 'NO_POST_FORUM' || t.responseText == 'NO_EDIT_PERMS' )
|
||||
if( t.responseText == 'nopermission' || t.responseText == 'NO_POST_FORUM' || t.responseText == 'NO_EDIT_PERMS' || t.responseText == 'NO_POSTING_PPD' )
|
||||
{
|
||||
alert(ipb.lang['no_permission']);
|
||||
return;
|
||||
@@ -392,7 +497,7 @@ _topic.prototype.topic = {
|
||||
*/
|
||||
preCheckPosts: function()
|
||||
{
|
||||
if( !$('selectedpidsJS') ){ return; }
|
||||
if( ! $('selectedpidsJS' ) || !$F('selectedpidsJS') ){ return true; }
|
||||
|
||||
// Get the cookie
|
||||
pids = $F('selectedpidsJS').split(',');
|
||||
@@ -448,7 +553,7 @@ _topic.prototype.topic = {
|
||||
|
||||
pids = pids.uniq().without( remove ).join(',');
|
||||
ipb.Cookie.set('modpids', pids, 0);
|
||||
$F('selectedpidsJS').value = pids;
|
||||
$('selectedpidsJS').value = pids;
|
||||
ipb.topic.updatePostModButton();
|
||||
},
|
||||
|
||||
@@ -477,7 +582,7 @@ _topic.prototype.topic = {
|
||||
* @var {event} e The event
|
||||
*/
|
||||
showLinkToTopic: function(e, elem)
|
||||
{
|
||||
{
|
||||
_t = prompt( ipb.lang['copy_topic_link'], $( elem ).readAttribute('href') );
|
||||
Event.stop(e);
|
||||
},
|
||||
@@ -490,10 +595,13 @@ _topic.prototype.topic = {
|
||||
*/
|
||||
confirmSingleDelete: function(e, elem)
|
||||
{
|
||||
if( !confirm( ipb.lang['delete_post_confirm'] ) )
|
||||
if ( ! confirm( ipb.lang['delete_post_confirm'] ) )
|
||||
{
|
||||
Event.stop(e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
/* ------------------------------ */
|
||||
@@ -634,7 +742,25 @@ _topic.prototype.topic = {
|
||||
w: '500px'
|
||||
});
|
||||
//}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
/* ------------------------------ */
|
||||
/**
|
||||
* Reputation Popup Balloon
|
||||
*/
|
||||
repPopUp: function( e, postID )
|
||||
{
|
||||
var _url = ipb.vars['base_url'] + '&app=forums&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=topics&do=reputation&post=' + postID;
|
||||
new ipb.Popup('rep_' + postID, {
|
||||
type: 'balloon',
|
||||
stem: true,
|
||||
attach: { target: e, position: 'auto' },
|
||||
hideAtStart: false,
|
||||
ajaxURL: _url,
|
||||
w: '300px',
|
||||
h: '400px'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
ipb.topic.init();
|
||||
@@ -0,0 +1,41 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.twitter.js - Twitter Connect code */
|
||||
/* (c) IPS, Inc 2010 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Matt Mecham, Rikki Tissier */
|
||||
/************************************************/
|
||||
|
||||
var _tw = window.IPBoard;
|
||||
|
||||
_tw.prototype.twitter = {
|
||||
_popUp: null,
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.twitter.js");
|
||||
|
||||
//document.observe("dom:loaded", function(){
|
||||
|
||||
//});
|
||||
},
|
||||
|
||||
initUserCP: function()
|
||||
{
|
||||
$('tc_remove').observe( 'click', ipb.twitter.usercp_remove );
|
||||
},
|
||||
|
||||
/**
|
||||
* Loads the URL to remove the app
|
||||
*
|
||||
*/
|
||||
usercp_remove: function()
|
||||
{
|
||||
window.location = ipb.vars['base_url'] + 'app=core&module=usercp&tab=members&area=twitterRemove&do=custom&secure_key=' + ipb.vars['secure_hash'];
|
||||
}
|
||||
};
|
||||
|
||||
ipb.twitter.init();
|
||||
@@ -7,6 +7,7 @@
|
||||
/* Author: Rikki Tissier */
|
||||
/************************************************/
|
||||
|
||||
|
||||
var _ucp = window.IPBoard;
|
||||
|
||||
_ucp.prototype.ucp = {
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
/************************************************/
|
||||
/* IPB3 Javascript */
|
||||
/* -------------------------------------------- */
|
||||
/* ips.facebook.js - Facebook Connect code */
|
||||
/* (c) IPS, Inc 2008 */
|
||||
/* -------------------------------------------- */
|
||||
/* Author: Matt Mecham, Rikki Tissier */
|
||||
/************************************************/
|
||||
|
||||
var _vk = window.IPBoard;
|
||||
|
||||
_vk.prototype.vkontakte = {
|
||||
|
||||
linkedMember: {},
|
||||
vkMemberInfo: {},
|
||||
|
||||
/*------------------------------*/
|
||||
/* Constructor */
|
||||
init: function()
|
||||
{
|
||||
Debug.write("Initializing ips.vkontakte.js");
|
||||
|
||||
},
|
||||
|
||||
show_loginButton: function()
|
||||
{
|
||||
var content = $('vk-template-button').innerHTML;
|
||||
$('vkUserBox').update( content );
|
||||
|
||||
$('vk_login').observe( 'click', function() {
|
||||
$('vk_frame').contentWindow.doLogin();
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Updates the log in box
|
||||
*
|
||||
*/
|
||||
login_updateBox: function()
|
||||
{
|
||||
|
||||
/* INIT */
|
||||
var content = $('vk-template-main').innerHTML;
|
||||
|
||||
content = content + $('vk-template-linked').innerHTML;
|
||||
$('vkUserBox').update( content );
|
||||
|
||||
$('openapi_user').innerHTML = ipb.vkontakte.vkMemberInfo.name;
|
||||
$('vk_linkForm').action = $('vk_linkForm').action + '?key=' + ipb.vkontakte.linkedMember['key'];
|
||||
$('openapi_userlink').href = 'http://vkontakte.ru/id' + ipb.vkontakte.vkMemberInfo.id;
|
||||
$('openapi_userphoto').src = ipb.vkontakte.vkMemberInfo.photo;
|
||||
|
||||
/* Set up handlers */
|
||||
if ( $('vk_link') )
|
||||
{
|
||||
$('vk_link').observe('click', ipb.vkontakte.login_linkAcc );
|
||||
}
|
||||
|
||||
if ( $('vk_complete') )
|
||||
{
|
||||
$('vk_complete').observe('click', ipb.vkontakte.login_complete );
|
||||
}
|
||||
|
||||
if ( $('vk_logout') )
|
||||
{
|
||||
$('vk_logout').observe( 'click', function() {
|
||||
$('vk_frame').contentWindow.doLogout();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
initUserCP: function()
|
||||
{
|
||||
$('tc_remove').observe( 'click', ipb.vkontakte.usercp_remove );
|
||||
},
|
||||
|
||||
/**
|
||||
* Loads the URL to remove the app
|
||||
*
|
||||
*/
|
||||
usercp_remove: function()
|
||||
{
|
||||
window.location = ipb.vars['base_url'] + 'app=core&module=usercp&tab=members&area=vkRemove&do=custom&secure_key=' + ipb.vars['secure_hash'];
|
||||
},
|
||||
|
||||
/**
|
||||
* Simply submits our form so PHP can do the final checks
|
||||
*
|
||||
*/
|
||||
login_complete: function()
|
||||
{
|
||||
$('vk_linkForm').submit();
|
||||
},
|
||||
|
||||
/**
|
||||
* Check, via AJAX for an existing account
|
||||
*
|
||||
*/
|
||||
login_linkAcc: function()
|
||||
{
|
||||
window.location = ipb.vars['base_url'] + 'app=core&module=usercp&tab=members&area=vkLink&do=custom&secure_key=' + ipb.vars['secure_hash'];
|
||||
},
|
||||
|
||||
/**
|
||||
* Check to see if the facebook user is linked to an IPB account
|
||||
*/
|
||||
loadUser: function(data)
|
||||
{
|
||||
/* Already been here? */
|
||||
if ( typeof( ipb.vkontakte.linkedMember['member_id'] ) != 'undefined' )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Fetch FB ID */
|
||||
vkUserId = data.id;
|
||||
ipb.vkontakte.vkMemberInfo = data;
|
||||
|
||||
/* Got a linked member? */
|
||||
new Ajax.Request( ipb.vars['base_url'] + '&app=core&module=ajax&secure_key=' + ipb.vars['secure_hash'] + '§ion=vkontakte&do=getUserByVkId',
|
||||
{
|
||||
method: 'post',
|
||||
parameters: data,
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
ipb.vkontakte.linkedMember = t.responseJSON;
|
||||
ipb.vkontakte.login_updateBox();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ipb.vkontakte.init();
|
||||
@@ -0,0 +1,104 @@
|
||||
document.observe("dom:loaded", function()
|
||||
{
|
||||
$$("#user_navigation a").each( function(e) { e.setStyle( { 'display' : 'block', 'font-size': '1.4em' } ); } );
|
||||
$$("#secondary_navigation a").each( function(e) { Event.observe(e, "click", loadUrl ); } );
|
||||
$$(".touch-row").each(function(e) { Event.observe(e, "click", touchRowClick); addArrow(e); });
|
||||
$$(".post").each(function(e) { Event.observe(e, "click", postClick); });
|
||||
Event.observe($('options-button'), "click", openNavigation);
|
||||
if($('filter-option')) {Event.observe($('filter-option'), "click", openFilter);}
|
||||
$('options-button').setStyle({'display': 'block'});
|
||||
|
||||
/* Set this here to 'toggle' works later */
|
||||
$('shade').setStyle({'display': 'none'});
|
||||
|
||||
if ( $('filter-letters') )
|
||||
{
|
||||
$('filter-letters').toggleClassName('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Add the touch arrow */
|
||||
function addArrow(e)
|
||||
{
|
||||
d = e.getDimensions();
|
||||
t = ( d.height / 2 ) - 12;
|
||||
|
||||
if ( ! e.inspect().match( '<h2' ) )
|
||||
{
|
||||
e.insert( { 'top' : new Element( 'div', { 'class': 'touch-row-arrow', 'style': 'margin-top:' + t + 'px !important' } ) } );
|
||||
}
|
||||
}
|
||||
|
||||
function touchRowClick()
|
||||
{
|
||||
$$('#' + this.id + ' a.title').each(function(e) { loadUrl( e ); });
|
||||
}
|
||||
|
||||
function loadUrl( e )
|
||||
{
|
||||
/* Show loading box */
|
||||
var content = LOADING_TEMPLATE.evaluate();
|
||||
|
||||
$('ipbwrapper').insert( { 'after' : content } );
|
||||
positionCenter( $('loadingBox') );
|
||||
|
||||
window.location = e.href;
|
||||
}
|
||||
|
||||
function postClick()
|
||||
{
|
||||
$(this.id + '-controls').toggleClassName('visible');
|
||||
}
|
||||
|
||||
function openNavigation()
|
||||
{
|
||||
vp = document.viewport.getDimensions();
|
||||
|
||||
$('user_navigation').toggle();
|
||||
$('user_navigation').setStyle( { 'position': 'absolute', 'width': ( vp.width - 20 ) + 'px' } );
|
||||
$('options-button').update($('user_navigation').visible() ? '«' : '»');
|
||||
$('shade').toggle();
|
||||
}
|
||||
|
||||
function openFilter()
|
||||
{
|
||||
if ( $('filter-letters') )
|
||||
{
|
||||
$('filter-letters').toggleClassName('hidden');
|
||||
}
|
||||
|
||||
$('filter-option').setStyle({'display': 'none'});
|
||||
}
|
||||
|
||||
function positionCenter( elem, dir )
|
||||
{
|
||||
if( !$(elem) ){ return; }
|
||||
elem_s = $(elem).getDimensions();
|
||||
window_s = document.viewport.getDimensions();
|
||||
window_offsets = document.viewport.getScrollOffsets();
|
||||
|
||||
center = { left: ((window_s['width'] - elem_s['width']) / 2),
|
||||
top: ((window_s['height'] - elem_s['height']) / 2)
|
||||
};
|
||||
|
||||
if ( window_offsets['top'] )
|
||||
{
|
||||
center['top'] += window_offsets['top'];
|
||||
}
|
||||
|
||||
if( typeof(dir) == 'undefined' || ( dir != 'h' && dir != 'v' ) )
|
||||
{
|
||||
$(elem).setStyle('top: ' + center['top'] + 'px; left: ' + center['left'] + 'px');
|
||||
}
|
||||
else if( dir == 'h' )
|
||||
{
|
||||
$(elem).setStyle('left: ' + center['left'] + 'px');
|
||||
}
|
||||
else if( dir == 'v' )
|
||||
{
|
||||
$(elem).setStyle('top: ' + center['top'] + 'px');
|
||||
}
|
||||
|
||||
$(elem).setStyle('position: fixed');
|
||||
}
|
||||
Reference in new issue
Block a user