/* * Date Format 1.2.3 * (c) 2007-2009 Steven Levithan * MIT license * * Includes enhancements by Scott Trenda * and Kris Kowal * * Accepts a date, a mask, or a date and a mask. * Returns a formatted version of the given date. * The date defaults to the current date/time. * The mask defaults to dateFormat.masks.default. */ var dateFormat = function () { var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, timezoneClip = /[^-+\dA-Z]/g, pad = function (val, len) { val = String(val); len = len || 2; while (val.length < len) val = "0" + val; return val; }; // Regexes and supporting functions are cached through closure return function (date, mask, utc) { var dF = dateFormat; // You can't provide utc if you skip other args (use the "UTC:" mask prefix) if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) { mask = date; date = undefined; } // Passing date through Date applies Date.parse, if necessary date = date ? new Date(date) : new Date; if (isNaN(date)) throw SyntaxError("invalid date"); mask = String(dF.masks[mask] || mask || dF.masks["default"]); // Allow setting the utc argument via the mask if (mask.slice(0, 4) == "UTC:") { mask = mask.slice(4); utc = true; } var _ = utc ? "getUTC" : "get", d = date[_ + "Date"](), D = date[_ + "Day"](), m = date[_ + "Month"](), y = date[_ + "FullYear"](), H = date[_ + "Hours"](), M = date[_ + "Minutes"](), s = date[_ + "Seconds"](), L = date[_ + "Milliseconds"](), o = utc ? 0 : date.getTimezoneOffset(), flags = { d: d, dd: pad(d), ddd: dF.i18n.dayNames[D], dddd: dF.i18n.dayNames[D + 7], m: m + 1, mm: pad(m + 1), mmm: dF.i18n.monthNames[m], mmmm: dF.i18n.monthNames[m + 12], yy: String(y).slice(2), yyyy: y, h: H % 12 || 12, hh: pad(H % 12 || 12), H: H, HH: pad(H), M: M, MM: pad(M), s: s, ss: pad(s), l: pad(L, 3), L: pad(L > 99 ? Math.round(L / 10) : L), t: H < 12 ? "a" : "p", tt: H < 12 ? "am" : "pm", T: H < 12 ? "A" : "P", TT: H < 12 ? "AM" : "PM", Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10] }; return mask.replace(token, function ($0) { return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); }); }; }(); // Some common format strings dateFormat.masks = { "default": "ddd mmm dd yyyy HH:MM:ss", shortDate: "m/d/yy", mediumDate: "mmm d, yyyy", longDate: "mmmm d, yyyy", fullDate: "dddd, mmmm d, yyyy", shortTime: "h:MM TT", mediumTime: "h:MM:ss TT", longTime: "h:MM:ss TT Z", isoDate: "yyyy-mm-dd", isoTime: "HH:MM:ss", isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" }; // Internationalization strings dateFormat.i18n = { dayNames: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], monthNames: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] }; // For convenience... Date.prototype.format = function (mask, utc) { return dateFormat(this, mask, utc); }; //add Xobor scpecific Masks dateFormat.masks.now1 = 'vor einer Minute'; dateFormat.masks.now = 'vor %minutes Minuten'; dateFormat.masks.today = '"Heute" HH:MM'; dateFormat.masks.yesterday = '"Gestern" HH:MM'; dateFormat.masks.norm = 'dd.mm.yyyy HH:MM'; dateFormat.masks.never = '-'; /* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ var CryptoJS=CryptoJS||function(a,m){var r={},f=r.lib={},g=function(){},l=f.Base={extend:function(a){g.prototype=this;var b=new g;a&&b.mixIn(a);b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)});b.init.prototype=b;b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}, p=f.WordArray=l.extend({init:function(a,b){a=this.words=a||[];this.sigBytes=b!=m?b:4*a.length},toString:function(a){return(a||q).stringify(this)},concat:function(a){var b=this.words,d=a.words,c=this.sigBytes;a=a.sigBytes;this.clamp();if(c%4)for(var j=0;j>>2]|=(d[j>>>2]>>>24-8*(j%4)&255)<<24-8*((c+j)%4);else if(65535>>2]=d[j>>>2];else b.push.apply(b,d);this.sigBytes+=a;return this},clamp:function(){var n=this.words,b=this.sigBytes;n[b>>>2]&=4294967295<< 32-8*(b%4);n.length=a.ceil(b/4)},clone:function(){var a=l.clone.call(this);a.words=this.words.slice(0);return a},random:function(n){for(var b=[],d=0;d>>2]>>>24-8*(c%4)&255;d.push((j>>>4).toString(16));d.push((j&15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>3]|=parseInt(a.substr(c, 2),16)<<24-4*(c%8);return new p.init(d,b/2)}},G=y.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c>>2]>>>24-8*(c%4)&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return new p.init(d,b)}},fa=y.Utf8={stringify:function(a){try{return decodeURIComponent(escape(G.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return G.parse(unescape(encodeURIComponent(a)))}}, h=f.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new p.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=fa.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(n){var b=this._data,d=b.words,c=b.sigBytes,j=this.blockSize,l=c/(4*j),l=n?a.ceil(l):a.max((l|0)-this._minBufferSize,0);n=l*j;c=a.min(4*n,c);if(n){for(var h=0;hq;q++)y[q]=a();f=f.SHA512=r.extend({_doReset:function(){this._hash=new l.init([new g.init(1779033703,4089235720),new g.init(3144134277,2227873595),new g.init(1013904242,4271175723),new g.init(2773480762,1595750129),new g.init(1359893119,2917565137),new g.init(2600822924,725511199),new g.init(528734635,4215389547),new g.init(1541459225,327033209)])},_doProcessBlock:function(a,f){for(var h=this._hash.words, g=h[0],n=h[1],b=h[2],d=h[3],c=h[4],j=h[5],l=h[6],h=h[7],q=g.high,m=g.low,r=n.high,N=n.low,Z=b.high,O=b.low,$=d.high,P=d.low,aa=c.high,Q=c.low,ba=j.high,R=j.low,ca=l.high,S=l.low,da=h.high,T=h.low,v=q,s=m,H=r,E=N,I=Z,F=O,W=$,J=P,w=aa,t=Q,U=ba,K=R,V=ca,L=S,X=da,M=T,x=0;80>x;x++){var B=y[x];if(16>x)var u=B.high=a[f+2*x]|0,e=B.low=a[f+2*x+1]|0;else{var u=y[x-15],e=u.high,z=u.low,u=(e>>>1|z<<31)^(e>>>8|z<<24)^e>>>7,z=(z>>>1|e<<31)^(z>>>8|e<<24)^(z>>>7|e<<25),D=y[x-2],e=D.high,k=D.low,D=(e>>>19|k<<13)^ (e<<3|k>>>29)^e>>>6,k=(k>>>19|e<<13)^(k<<3|e>>>29)^(k>>>6|e<<26),e=y[x-7],Y=e.high,C=y[x-16],A=C.high,C=C.low,e=z+e.low,u=u+Y+(e>>>0>>0?1:0),e=e+k,u=u+D+(e>>>0>>0?1:0),e=e+C,u=u+A+(e>>>0>>0?1:0);B.high=u;B.low=e}var Y=w&U^~w&V,C=t&K^~t&L,B=v&H^v&I^H&I,ha=s&E^s&F^E&F,z=(v>>>28|s<<4)^(v<<30|s>>>2)^(v<<25|s>>>7),D=(s>>>28|v<<4)^(s<<30|v>>>2)^(s<<25|v>>>7),k=p[x],ia=k.high,ea=k.low,k=M+((t>>>14|w<<18)^(t>>>18|w<<14)^(t<<23|w>>>9)),A=X+((w>>>14|t<<18)^(w>>>18|t<<14)^(w<<23|t>>>9))+(k>>>0>> 0?1:0),k=k+C,A=A+Y+(k>>>0>>0?1:0),k=k+ea,A=A+ia+(k>>>0>>0?1:0),k=k+e,A=A+u+(k>>>0>>0?1:0),e=D+ha,B=z+B+(e>>>0>>0?1:0),X=V,M=L,V=U,L=K,U=w,K=t,t=J+k|0,w=W+A+(t>>>0>>0?1:0)|0,W=I,J=F,I=H,F=E,H=v,E=s,s=k+e|0,v=A+B+(s>>>0>>0?1:0)|0}m=g.low=m+s;g.high=q+v+(m>>>0>>0?1:0);N=n.low=N+E;n.high=r+H+(N>>>0>>0?1:0);O=b.low=O+F;b.high=Z+I+(O>>>0>>0?1:0);P=d.low=P+J;d.high=$+W+(P>>>0>>0?1:0);Q=c.low=Q+t;c.high=aa+w+(Q>>>0>>0?1:0);R=j.low=R+K;j.high=ba+U+(R>>>0>>0?1:0);S=l.low= S+L;l.high=ca+V+(S>>>0>>0?1:0);T=h.low=T+M;h.high=da+X+(T>>>0>>0?1:0)},_doFinalize:function(){var a=this._data,f=a.words,h=8*this._nDataBytes,g=8*a.sigBytes;f[g>>>5]|=128<<24-g%32;f[(g+128>>>10<<5)+30]=Math.floor(h/4294967296);f[(g+128>>>10<<5)+31]=h;a.sigBytes=4*f.length;this._process();return this._hash.toX32()},clone:function(){var a=r.clone.call(this);a._hash=this._hash.clone();return a},blockSize:32});m.SHA512=r._createHelper(f);m.HmacSHA512=r._createHmacHelper(f)})(); /* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ var CryptoJS=CryptoJS||function(s,p){var m={},l=m.lib={},n=function(){},r=l.Base={extend:function(b){n.prototype=this;var h=new n;b&&h.mixIn(b);h.hasOwnProperty("init")||(h.init=function(){h.$super.init.apply(this,arguments)});h.init.prototype=h;h.$super=this;return h},create:function(){var b=this.extend();b.init.apply(b,arguments);return b},init:function(){},mixIn:function(b){for(var h in b)b.hasOwnProperty(h)&&(this[h]=b[h]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.init.prototype.extend(this)}}, q=l.WordArray=r.extend({init:function(b,h){b=this.words=b||[];this.sigBytes=h!=p?h:4*b.length},toString:function(b){return(b||t).stringify(this)},concat:function(b){var h=this.words,a=b.words,j=this.sigBytes;b=b.sigBytes;this.clamp();if(j%4)for(var g=0;g>>2]|=(a[g>>>2]>>>24-8*(g%4)&255)<<24-8*((j+g)%4);else if(65535>>2]=a[g>>>2];else h.push.apply(h,a);this.sigBytes+=b;return this},clamp:function(){var b=this.words,h=this.sigBytes;b[h>>>2]&=4294967295<< 32-8*(h%4);b.length=s.ceil(h/4)},clone:function(){var b=r.clone.call(this);b.words=this.words.slice(0);return b},random:function(b){for(var h=[],a=0;a>>2]>>>24-8*(j%4)&255;g.push((k>>>4).toString(16));g.push((k&15).toString(16))}return g.join("")},parse:function(b){for(var a=b.length,g=[],j=0;j>>3]|=parseInt(b.substr(j, 2),16)<<24-4*(j%8);return new q.init(g,a/2)}},a=v.Latin1={stringify:function(b){var a=b.words;b=b.sigBytes;for(var g=[],j=0;j>>2]>>>24-8*(j%4)&255));return g.join("")},parse:function(b){for(var a=b.length,g=[],j=0;j>>2]|=(b.charCodeAt(j)&255)<<24-8*(j%4);return new q.init(g,a)}},u=v.Utf8={stringify:function(b){try{return decodeURIComponent(escape(a.stringify(b)))}catch(g){throw Error("Malformed UTF-8 data");}},parse:function(b){return a.parse(unescape(encodeURIComponent(b)))}}, g=l.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new q.init;this._nDataBytes=0},_append:function(b){"string"==typeof b&&(b=u.parse(b));this._data.concat(b);this._nDataBytes+=b.sigBytes},_process:function(b){var a=this._data,g=a.words,j=a.sigBytes,k=this.blockSize,m=j/(4*k),m=b?s.ceil(m):s.max((m|0)-this._minBufferSize,0);b=m*k;j=s.min(4*b,j);if(b){for(var l=0;l>>32-j)+k}function m(a,k,b,h,l,j,m){a=a+(k&h|b&~h)+l+m;return(a<>>32-j)+k}function l(a,k,b,h,l,j,m){a=a+(k^b^h)+l+m;return(a<>>32-j)+k}function n(a,k,b,h,l,j,m){a=a+(b^(k|~h))+l+m;return(a<>>32-j)+k}for(var r=CryptoJS,q=r.lib,v=q.WordArray,t=q.Hasher,q=r.algo,a=[],u=0;64>u;u++)a[u]=4294967296*s.abs(s.sin(u+1))|0;q=q.MD5=t.extend({_doReset:function(){this._hash=new v.init([1732584193,4023233417,2562383102,271733878])}, _doProcessBlock:function(g,k){for(var b=0;16>b;b++){var h=k+b,w=g[h];g[h]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var b=this._hash.words,h=g[k+0],w=g[k+1],j=g[k+2],q=g[k+3],r=g[k+4],s=g[k+5],t=g[k+6],u=g[k+7],v=g[k+8],x=g[k+9],y=g[k+10],z=g[k+11],A=g[k+12],B=g[k+13],C=g[k+14],D=g[k+15],c=b[0],d=b[1],e=b[2],f=b[3],c=p(c,d,e,f,h,7,a[0]),f=p(f,c,d,e,w,12,a[1]),e=p(e,f,c,d,j,17,a[2]),d=p(d,e,f,c,q,22,a[3]),c=p(c,d,e,f,r,7,a[4]),f=p(f,c,d,e,s,12,a[5]),e=p(e,f,c,d,t,17,a[6]),d=p(d,e,f,c,u,22,a[7]), c=p(c,d,e,f,v,7,a[8]),f=p(f,c,d,e,x,12,a[9]),e=p(e,f,c,d,y,17,a[10]),d=p(d,e,f,c,z,22,a[11]),c=p(c,d,e,f,A,7,a[12]),f=p(f,c,d,e,B,12,a[13]),e=p(e,f,c,d,C,17,a[14]),d=p(d,e,f,c,D,22,a[15]),c=m(c,d,e,f,w,5,a[16]),f=m(f,c,d,e,t,9,a[17]),e=m(e,f,c,d,z,14,a[18]),d=m(d,e,f,c,h,20,a[19]),c=m(c,d,e,f,s,5,a[20]),f=m(f,c,d,e,y,9,a[21]),e=m(e,f,c,d,D,14,a[22]),d=m(d,e,f,c,r,20,a[23]),c=m(c,d,e,f,x,5,a[24]),f=m(f,c,d,e,C,9,a[25]),e=m(e,f,c,d,q,14,a[26]),d=m(d,e,f,c,v,20,a[27]),c=m(c,d,e,f,B,5,a[28]),f=m(f,c, d,e,j,9,a[29]),e=m(e,f,c,d,u,14,a[30]),d=m(d,e,f,c,A,20,a[31]),c=l(c,d,e,f,s,4,a[32]),f=l(f,c,d,e,v,11,a[33]),e=l(e,f,c,d,z,16,a[34]),d=l(d,e,f,c,C,23,a[35]),c=l(c,d,e,f,w,4,a[36]),f=l(f,c,d,e,r,11,a[37]),e=l(e,f,c,d,u,16,a[38]),d=l(d,e,f,c,y,23,a[39]),c=l(c,d,e,f,B,4,a[40]),f=l(f,c,d,e,h,11,a[41]),e=l(e,f,c,d,q,16,a[42]),d=l(d,e,f,c,t,23,a[43]),c=l(c,d,e,f,x,4,a[44]),f=l(f,c,d,e,A,11,a[45]),e=l(e,f,c,d,D,16,a[46]),d=l(d,e,f,c,j,23,a[47]),c=n(c,d,e,f,h,6,a[48]),f=n(f,c,d,e,u,10,a[49]),e=n(e,f,c,d, C,15,a[50]),d=n(d,e,f,c,s,21,a[51]),c=n(c,d,e,f,A,6,a[52]),f=n(f,c,d,e,q,10,a[53]),e=n(e,f,c,d,y,15,a[54]),d=n(d,e,f,c,w,21,a[55]),c=n(c,d,e,f,v,6,a[56]),f=n(f,c,d,e,D,10,a[57]),e=n(e,f,c,d,t,15,a[58]),d=n(d,e,f,c,B,21,a[59]),c=n(c,d,e,f,r,6,a[60]),f=n(f,c,d,e,z,10,a[61]),e=n(e,f,c,d,j,15,a[62]),d=n(d,e,f,c,x,21,a[63]);b[0]=b[0]+c|0;b[1]=b[1]+d|0;b[2]=b[2]+e|0;b[3]=b[3]+f|0},_doFinalize:function(){var a=this._data,k=a.words,b=8*this._nDataBytes,h=8*a.sigBytes;k[h>>>5]|=128<<24-h%32;var l=s.floor(b/ 4294967296);k[(h+64>>>9<<4)+15]=(l<<8|l>>>24)&16711935|(l<<24|l>>>8)&4278255360;k[(h+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360;a.sigBytes=4*(k.length+1);this._process();a=this._hash;k=a.words;for(b=0;4>b;b++)h=k[b],k[b]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;return a},clone:function(){var a=t.clone.call(this);a._hash=this._hash.clone();return a}});r.MD5=t._createHelper(q);r.HmacMD5=t._createHmacHelper(q)})(Math); /* CryptoJS v3.1.2 code.google.com/p/crypto-js (c) 2009-2013 by Jeff Mott. All rights reserved. code.google.com/p/crypto-js/wiki/License */ (function(){var h=CryptoJS,j=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();b=[];for(var a=0;a>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));for(var c=[],a=0,d=0;d< e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return j.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); var md5 = function(string) { var hash = CryptoJS.MD5(string); return hash.toString(CryptoJS.enc.Hex); } var SHA512 = function(string) { var hash = CryptoJS.SHA512(string); return hash.toString(CryptoJS.enc.Hex); } function exec_body_scripts(body_el) { // Finds and executes scripts in a newly added element's body. // Needed since innerHTML does not run scripts. // // Argument body_el is an element in the dom. function nodeName(elem, name) { return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); }; function evalScript(elem) { var data = (elem.text || elem.textContent || elem.innerHTML || "" ), head = document.getElementsByTagName("head")[0] || document.documentElement, script = document.createElement("script"); script.type = "text/javascript"; try { // doesn't work on ie... script.appendChild(document.createTextNode(data)); } catch(e) { // IE has funky script nodes script.text = data; } head.insertBefore(script, head.firstChild); head.removeChild(script); }; // main section of function var scripts = [], script, children_nodes = body_el.childNodes, child, i; for (i = 0; children_nodes[i]; i++) { child = children_nodes[i]; if (nodeName(child, "script" ) && (!child.type || child.type.toLowerCase() === "text/javascript")) { scripts.push(child); } } for (i = 0; scripts[i]; i++) { script = scripts[i]; if (script.parentNode) {script.parentNode.removeChild(script);} evalScript(scripts[i]); } }; /** * * Base64 encode / decode * http://www.webtoolkit.info/ * **/ var Base64 = { // private property _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", // public method for encoding encode : function (input) { var output = ""; var chr1, chr2, chr3, enc1, enc2, enc3, enc4; var i = 0; input = Base64._utf8_encode(input); while (i < input.length) { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); } return output; }, // public method for decoding decode : function (input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) { enc1 = this._keyStr.indexOf(input.charAt(i++)); enc2 = this._keyStr.indexOf(input.charAt(i++)); enc3 = this._keyStr.indexOf(input.charAt(i++)); enc4 = this._keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } output = Base64._utf8_decode(output); return output; }, // private method for UTF-8 encoding _utf8_encode : function (string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }, // private method for UTF-8 decoding _utf8_decode : function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } } var window_tabActive = true; window.onfocus = function() {window_tabActive = true;} window.onblur = function() {window_tabActive = false;} var desktopNotification = { config: { ttl: 60000, iconCover: 'http://img.homepagemodules.de/ds/static/iconset/basic/128/basic2-225_audio_news_megaphone.png', onlyOnBlur: true, linkNewWindow: false }, activeNotifications: [], // nur bei "onclick" events!!!!! requestPermission: function(callbackfn) { if (typeof Notification !== 'undefined') { if (Notification.permission == 'default') { Notification.requestPermission(function(a){ if (typeof callbackfn === 'function') { callbackfn(a); } return Notification.permission; }); } else { return Notification.permission; } } else { return 'notificationUndefined'; } }, createNew: function(title, text, link) { var access = false; if (desktopNotification.config.onlyOnBlur) { if (!window_tabActive) { access = true; } } else { access = true; } if (access) { if (typeof Notification !== 'undefined') { if (Notification.permission == 'granted') { desktopNotification.activeNotifications.push(new Notification(title, { dir: "auto", lang: "", body: text, icon: desktopNotification.config.iconCover })); if (typeof link !== 'undefined') { desktopNotification.activeNotifications[desktopNotification.activeNotifications.length - 1].addEventListener('click', function() { if (desktopNotification.config.linkNewWindow) { window.open(link); } else { window.location = link; } }); } // autoclose window.setTimeout(function(){ if (typeof desktopNotification.activeNotifications[0] !== 'undefined') { desktopNotification.activeNotifications[0].close(); desktopNotification.activeNotifications.splice(0,1); } },desktopNotification.config.ttl); } else { // notifications not granted! return 'noPermission'; } } else { // ie su.... return 'notificationUndefined'; } } } }; var _x = { getVars: {}, strGET: document.location.search.substr(1,document.location.search.length), fillGetArray: function() { if(this.strGET!='' && Object.keys(this.getVars).length == 0){ var gArr = this.strGET.split('&'); for(i=0;i1){ v=vArr[1]; } this.getVars[unescape(vArr[0])]=unescape(v); } } }, GET: function(key) { this.fillGetArray(); if(!this.getVars[key]){ return false; } else { return this.getVars[key]; } } };; /* multiple onload events */ window.addOnloadEvent = function(addToOnload) {var oldOnload;if (window.onload) {oldOnload = window.onload;window.onload = function(){oldOnload();addToOnload();};} else {window.onload = addToOnload;}} function hpm_toggle_ban_form(){ subject = document.getElementById('ban_subject'); mail = document.getElementById('ban_reason'); div = document.getElementById('ban_email_div'); check = document.getElementById('notifyUser'); if(mail.disabled == true){mail.disabled = false;subject.disabled = false;div.style.opacity='1';check.checked=true;} else{mail.disabled = true;subject.disabled = true;div.style.opacity='0.5';check.checked=false;} } function hpm_spoiler(obj) { /* Sicherstellen, dass wir die richtige Div öffnen... */ var testclass = ' ' + obj.className + ' '; if(testclass.indexOf(' ' + "hpm_spoiler"+ ' ')==-1){ try{obj = $(obj).closest('.hpm_spoiler')[0];}catch(e){/*no jquery*/}} var st = obj.getElementsByTagName('div')[2].style; st.display = (st.display == 'none' || st.display == '') ? 'block' : 'none'; /*var stb = obj.getElementsByTagName('div')[0].style; stb.borderWidth = (stb.borderWidth == '1px 1px 1px 1px' || stb.borderWidth == '') ? '1px 1px 0px 1px' : '1px 1px 1px 1px';*/ var sti = obj.getElementsByTagName('input')[0].getAttribute("class"); if(sti==null){ /*this means we are using the IE which doesn't know getAttribute("class")*/ sti = obj.getElementsByTagName('input')[0].getAttribute("className"); if(sti == 'hpm_spoiler_headinput hpm_spoiler_open') {obj.getElementsByTagName('input')[0].setAttribute("className", "hpm_spoiler_headinput hpm_spoiler_closed");}; if(sti == 'hpm_spoiler_headinput hpm_spoiler_closed') {obj.getElementsByTagName('input')[0].setAttribute("className", "hpm_spoiler_headinput hpm_spoiler_open");}; } else{ if(sti == 'hpm_spoiler_headinput hpm_spoiler_open') {obj.getElementsByTagName('input')[0].setAttribute("class", "hpm_spoiler_headinput hpm_spoiler_closed");}; if(sti == 'hpm_spoiler_headinput hpm_spoiler_closed') {obj.getElementsByTagName('input')[0].setAttribute("class", "hpm_spoiler_headinput hpm_spoiler_open");}; } } var miranus_iconbar_textarea = new Array(); function miranus_add_iconbar_textarea(textid) { miranus_iconbar_textarea.push(textid); } function togSub(element,link) { try { var timer; var pagewidth = document.getElementById('pagewidth').offsetWidth; var navheight = document.getElementById(element).offsetHeight; var listleft = document.getElementById(element).offsetLeft; var allEl = document.getElementById(element).getElementsByTagName("ul"); var el = document.getElementById(element); if (allEl.length > 0) { var actEl = allEl[0]; if(actEl.className=='nav_open') { actEl.className='nav_close'; el.onclick = "window.location='"+link+"'; return false;"; } else { actEl.className='nav_open'; el.onclick = ""; var actElWidth = actEl.offsetWidth; var topstring = parseInt(navheight)+'px'; actEl.style.top = topstring; actEl.style.zIndex = '99999'; if (listleft + actElWidth >= pagewidth) { actEl.style.right = '-1px'; } else { actEl.style.left = '-1px';} } } } catch(err) {} } function insertVideoTag(){ vid = prompt('Geben Sie die Url für das Video an. z.B \nMyVideo:\n\"http://www.myvideo.de/watch/6446450/Ball_Platzer_lol\" \n oder Youtube\n\"http://www.youtube.com/watch?v=-3hWIplHVeE\"', "http://www."); return returnTag('[Video]'+vid+'[/Video]');} function miranus_current_iconbar_textarea() { for(var i=0; i < miranus_iconbar_textarea.length; i++) { if(document.getElementById(miranus_iconbar_textarea[i])) { return document.getElementById(miranus_iconbar_textarea[i]); } } return false; } function returnTag(inTag) { insert(inTag,''); } function insert(aTag, eTag) { var input = miranus_current_iconbar_textarea(); if(input==false) { alert('No Textarea defined. Use this Javascript: miranus_add_iconbar_textarea(\'textarea_id\'); '); return false; } var scrollTop = input.scrollTop; var scrollLeft = input.scrollLeft; input.focus(); if(typeof document.selection != 'undefined') { var range = document.selection.createRange(); var insText = range.text; range.text = aTag + insText + eTag; range = document.selection.createRange(); if (insText.length == 0) { range.move('character', -eTag.length); } else { range.moveStart('character', aTag.length + insText.length + eTag.length); } range.select(); } else if(typeof input.selectionStart != 'undefined') { var start = input.selectionStart; var end = input.selectionEnd; var insText = input.value.substring(start, end); input.value = input.value.substr(0, start) + aTag + insText + eTag + input.value.substr(end); var pos; if (insText.length == 0) { pos = start + aTag.length; } else { pos = start + aTag.length + insText.length + eTag.length; } input.selectionStart = pos; input.selectionEnd = pos; } else { input.value = input.value + aTag + eTag; input.focus(); } input.scrollTop = scrollTop; input.scrollLeft = scrollLeft; } var hpm_loaded_js = new Array(); function miranus_load_js(jsuri, infooter) { /* Dynamisch weitere Javascript-Dateien zur Laufzeit nachladen */ if(!hpm_loaded_js[jsuri]) { if(infooter) { var appendto = document.getElementsByTagName("body")[0]; } else { var appendto = document.getElementsByTagName("head")[0]; } script = document.createElement('script'); script.type = 'text/javascript'; script.src = jsuri; appendto.appendChild(script); //alert(jsuri + ' wird jetzt geladen'); } hpm_loaded_js[jsuri] = true; return true; } function miranus_add_js(node,m_name) { /* Dynamisch Javascript zu einem Node hinzufügen */ var nodeid = node.getAttribute('id'); if( typeof nodeid != "string" || nodeid=="" ) { nodeid = parseInt(Math.random()*10000); node.setAttribute('id',nodeid); } //alert('node: ' + nodeid + ' mit funktion ' + m_name); if(m_name=='search_username') { if(miranus_load_js('/script_user.js')) { setTimeout('miranus_add_js_search_username(\'' + nodeid + '\')', 100) } } else return false; } function hpm_newDialog(url,width,height, formName){ if(width.indexOf('px')==-1 && width.indexOf('%')==-1){width= width+'px';} hpm_dialogwidth = width; return hpm_openDialog(url, formName); } function hpm_handleResponse() { /** Ajax Dialog anzeigen **/ if(hpm_request.readyState == 4){ /** disable page scrolling **/ if(document.documentElement && document.documentElement.scrollTop){ var oTop = document.documentElement.scrollTop; document.documentElement.scroll = "no"; document.documentElement.style.overflow = "hidden"; document.documentElement.scrollTop = oTop; } else if(document.body){ var oTop = document.body.scrollTop; document.body.scroll = "no"; document.body.style.overflow = "hidden"; document.body.scrollTop = oTop; } /** Get & Show Response **/ var response = hpm_request.responseText; var hpm_dialogDiv = document.createElement("div"); hpm_dialogDiv.setAttribute('id','hpm_dialog_div'); document.body.appendChild(hpm_dialogDiv); window.scrollTo(0, 0) hpm_dialogDiv.innerHTML = response; if((""+hpm_dialogwidth).indexOf('%') != -1){if(parseInt(hpm_dialogwidth) > 60){hpm_dialogwidth='60%';}} document.getElementById('hpm_pagebody').style.width= hpm_dialogwidth; if (navigator.appName != 'Microsoft Internet Explorer' && navigator.appName != 'Netscape') { document.getElementById('hpm_pagebody').style.maxHeight= getHeightMargin()+"px"; } else{ document.getElementById('hpm_pagebody').style.height= "auto"; } document.getElementById('hpm_pagebody').style.overflow= "auto"; exec_body_scripts(document.getElementById('hpm_pagebody')); /* If Trigger some javascript - no active javascript in ajax-dialog */ if(document.getElementById('miranus_loadGMapScript')) { setTimeout("miranus_loadGMapScript(document.getElementById('miranus_loadGMapScript').value, document.getElementById('miranus_loadGMapScript_api').value, document.getElementById('miranus_loadGMapScript_startX').value, document.getElementById('miranus_loadGMapScript_startY').value, parseInt(document.getElementById('miranus_loadGMapScript_startZoom').value) )",100); } } } function hpm_openDialog(url, formName) { /* Laden von url innerhalb eines Ajax Dialogs */ var params = ''; if(formName && document.forms[formName].elements) { var formdata = miranus_getFormFields(formName); params = '&' + miranus_js2post(formdata); } var params = 'openDialogRequest=true&last_location= ' + encodeURIComponent(location.href) + '&next_location=' + encodeURIComponent(url) + params; hpm_closeDialog(); hpm_request.open('POST', url); hpm_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); hpm_request.setRequestHeader("Content-length", params.length); hpm_request.setRequestHeader("Connection", "close"); hpm_request.onreadystatechange = hpm_handleResponse; hpm_request.send(params); if(navigator.appName == "Microsoft Internet Explorer"){ event.returnValue = false } return false; } function hpm_closeDialog() { if(document.getElementById('hpm_dialog_div')) { document.body.removeChild(document.getElementById('hpm_dialog_div')); } /** Enable scrolling **/ if(document.documentElement) { /* && document.documentElement.scrollTop){ */ document.documentElement.scroll = ""; document.documentElement.style.overflow = ""; } if(document.body){ document.body.scroll = ""; document.body.style.overflow = ""; } } //new progress function function checkNginxProgress(uuid){ var bar = $('#progressbar'); var percent = $('#upload_percent'); url = "/progress" + "?X-Progress-ID=" + uuid; success = function(upload) { upload = eval(upload); switch(upload.state){ case "starting": setTimeout("checkNginxProgress('"+uuid+"')",600); break; case "done": break; case "error": break; case "uploading": upload.percents = Math.floor((upload.received / upload.size)*1000)/10; bar.css({width: upload.percents+'%'}); if(percent){percent.html("("+upload.percents+"%)");} setTimeout("checkNginxProgress('"+uuid+"')",600); break; default: setTimeout("checkNginxProgress('"+uuid+"')",1000); } } $.get(url,success); } var callback_flag = false; var callback_function = ''; var hpm_upload_progress_link = ''; var hpm_upload_progress_show_elem = ''; var hpm_upload_http; function hpm_upload_start_progress(progress_link, show_elem,callback) { /* alert('init progress'); */ try{if(show_gallery){gallery_flag = true;}}catch(e){} try{if(callback){callback_flag = true;callback_function=callback;}}catch(e){} hpm_upload_progress_link = progress_link; hpm_upload_progress_show_elem = show_elem; hpm_upload_refresh_progress(); } function hpm_upload_refresh_progress() { /* gpm_request = null; */ /* hpm_request = hpm_createHttpRequestObject(); */ hpm_request.open('get', hpm_upload_progress_link); hpm_request.onreadystatechange = hpm_upload_handle_progress_response; hpm_request.send(null); /* alert('request send: ' + hpm_upload_progress_link); */ } function hpm_upload_handle_progress_response() { if(hpm_request==null) { alert('hpm_request = null'); return; } if(hpm_request.readyState == 4) { var response = hpm_request.responseText; if(response.length>0) { upload = eval(response); switch(upload.state){ case "starting": window.setTimeout("hpm_upload_refresh_progress()",600); case "done": break; case "error": break; case "uploading": var bar = document.getElementById('progressbar'); var percent = document.getElementById('upload_percent'); upload.percents = Math.floor((upload.received / upload.size)*1000)/10; bar.style.width = upload.percents+'%'; if(percent){percent.innerHTML = "("+upload.percents+"%)";} window.setTimeout("hpm_upload_refresh_progress()",600); break; default: break; } /* if(response.length>0) { var resp = eval('(' + response + ')'); var current = parseInt(resp['current']/1024) ; var total = parseInt(resp['total']/1024); var cur_percent = 100 * current / total; if(total>0 && current>0) { if(callback_flag){eval(callback_function+'('+cur_percent+');');} else{document.getElementById(hpm_upload_progress_show_elem).innerHTML = '
Status: ' + current + ' von ' + total + ' KByte hochgeladen';} } if(total>20480){ document.getElementById(hpm_upload_progress_show_elem).innerHTML = document.getElementById(hpm_upload_progress_show_elem).innerHTML + '


Achtung: Sie haben zu viele oder zu große Bilder ausgewählt.
Dies wird dazu führen, dass der Upload-Vorgang nicht ordnungsgemäß abgeschlossen werden kann.

Upload neu starten';} } window.setTimeout("hpm_upload_refresh_progress()",600);*/ }else{window.setTimeout("hpm_upload_refresh_progress()",600);} } } function getHeightMargin(){ if(window.innerHeight){ h = window.innerHeight; b = (h - (h*0.2)) } else if(document.body || navigator.appName == 'Microsoft Internet Explorer'){ h = document.body.clientHeight b = (h -(h*0.3)) } else { h = document.documentElement.clientHeight; b = (h - (h*0.2)) } return parseInt(b); } function miranus_getFormFields(formName) { /* Alle Formularfelder im Formular formName in ein Javascript Array holen */ var val = new Array(); var el = document.forms[formName].elements; for(i=0;i 0 ? '[' + path.join('][') + ']' : '') + '=' + encodeURI(obj)); path.unshift(base); } path.pop(); return post_str.join('&'); } */ function hpm_createHttpRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; } var hpm_request = hpm_createHttpRequestObject(); var hpm_dialogwidth = 800; //var hpm_dialogheight = getHeightMargin(); function miranus_delete_integration(i_id,target_id,confirmed){ miranus_load_js('/js/jquery.js'); var jq_loaded = false; if(!confirmed){ var ich_will = window.confirm("Wollen Sie diese Verlinkung wirklich loeschen?");} try{$('test'); jq_loaded=true;}catch(e){setTimeout("miranus_delete_integration('"+i_id+"','"+target_id+"',true)",200)} if((ich_will || confirmed) && jq_loaded) { if(i_id > 0){ if(typeof(target_id) == 'undefined') { var target_id = false; } $.ajax({ type: "POST", url: '../integration_select.php', data: {del:true,target_id:target_id,i_id:i_id}, success: function(result){ window.location.reload(); } }); } else { alert('Cannot delete the Element with '+i_id); } } } function miranus_confirm_tag(name,redirect){ var c = window.confirm(name+" an dieser Stelle verlinken ?"); if(c){ document.UserForm.submit(); } else { document.UserForm.onsubmit() = false; } } function chkName(name){ if(name==""){ $("#UserError").html("Bitte Name eingeben"); return false; } else { $.ajax({ type:"POST", url: "../listUser.php", data: {chkUser:true,uname:name}, success: function(resp){ var user = eval('(' + resp + ')'); if(user['userid']>0){ return true; erg = true; //window.location.reload(); } else { $("#UserError").html("Name "+name+" nicht gefunden"); return false; } } }); } } function showDivById(id){ document.getElementById(id).style.display='block'; } function hideDivById(id){ document.getElementById(id).style.display='none'; } function ValideEmail(email){ var lookup = "^[a-zA-Z0-9_\.\-]+@([a-zA-Z0-9\.\-]+)\.[a-z]{2,4}$"; var regexp = new RegExp(lookup); return (regexp.test(email)); } function conf_ban(){ var ok = window.confirm("Dieses Rudelmitglied wirklich sperren?"); return ok; } function FitToContent(id, maxHeight) { var text = id && id.style ? id : document.getElementById(id); if ( !text ) return; var adjustedHeight = text.clientHeight; if ( !maxHeight || maxHeight > adjustedHeight ) { adjustedHeight = Math.max(text.scrollHeight, adjustedHeight); if ( maxHeight ) adjustedHeight = Math.min(maxHeight, adjustedHeight); if ( adjustedHeight > text.clientHeight ) text.style.height = adjustedHeight + "px"; } } function xSetCookie(name,val,days){ var mydate = new Date(); d = days ? days : 3; mydate.setTime(mydate.getTime()+(d*24*60*60*1000)); var expires = "; expires="+mydate.toGMTString(); document.cookie = name+"="+val+expires+"; path=/"; } function xGetCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } var rating_request,activity_request,warning_request; /*Rating Functions*/ var ratingHandler = "/ajax/ratings_api.php"; var already_rated = "Sie haben diesen Inhalt bereits bewertet"; function xRatingAction(id,what){ var r_type, c_type,c_id,re,xor_id; var action = what ? what : 'giveRating'; r_type = document.getElementById(id+'_rtype').innerHTML; c_type = document.getElementById(id+'_ctype').innerHTML; c_id = document.getElementById(id+'_cid').innerHTML; i_id = document.getElementById(id+'_iid').innerHTML; re = 1; try{xor_id = document.getElementById(id+'_xor_id').innerHTML;}catch(e){/*no xor*/ xor_id = 0;} var param_string = "action="+action+"&r_type="+r_type+"&c_type="+c_type+"&c_id="+c_id+"&re="+re+"&i_id="+i_id+"&xor_id="+xor_id; rating_request = hpm_createHttpRequestObject(); rating_request.open("POST",ratingHandler,true); rating_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); rating_request.setRequestHeader("Content-length", param_string.length); rating_request.setRequestHeader("Connection", "close"); rating_request.onreadystatechange=ratingdone; rating_request.send(param_string); } function ratingdone(){ if(rating_request.readyState == 4){ try{rdata=JSON.parse(rating_request.responseText);} catch(e){try{console.log("Error: "+ e + " Response was:"+ rating_request.responseText)}catch(e){}} if(rdata.success){location.reload();} else{if(rdata.errormsg){if(rdata.errormsg == 'own content'){alert('Sie können ihre eigenen Inhalte nicht bewerten')} else{ alert(rdata.errormsg)}}} } } function xGetActivities(aid){ try{document.getElementById('xActivityFeed').getAttribute('id');}catch(e){/*Feed not active*/ return true;} var method = 'getActivities'; var last_id = aid ? aid : document.getElementById('xActivityFeed').children[0].getAttribute('id'); if(last_id===null || last_id==='feedaddonli'){last_id = document.getElementById('xActivityFeed').children[1].getAttribute('id');} var param_string = "method="+method+"&last_id="+last_id; activity_request = hpm_createHttpRequestObject(); activity_request.open("POST","ajax/handler.php",true); activity_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); activity_request.setRequestHeader("Content-length", param_string.length); activity_request.setRequestHeader("Connection", "close"); activity_request.onreadystatechange=activityHandler; activity_request.send(param_string); } var ban_request; function xUnbanUser(id){xBanUser(id,true);} function xBanUser(id,unban){ var method = unban ? 'unbanUser' : 'banUser'; var param_string = "method="+method+"&userid="+id; ban_request = hpm_createHttpRequestObject(); ban_request.open("POST","./ajax/handler.php",true); ban_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); ban_request.setRequestHeader("Content-length", param_string.length); ban_request.setRequestHeader("Connection", "close"); ban_request.onreadystatechange=banHandler; ban_request.send(param_string); } function banHandler(){ if(ban_request.readyState == 4){ try{ rdata=JSON.parse(ban_request.responseText); if(rdata.done){location.reload();} else{ if(rdata.error=="nomodadmin"){alert("Moderatoren und Administratoren können nicht geblockt werden.");} else if(rdata.error=="reggedonly"){alert("{[error_noregged]}");} else if(rdata.error=="notfound"){alert("Benutzer nicht gefunden");} else if(rdata.error){alert(rdata.error);} else{alert("{[error_ban_generic]}")} } }catch(e){}} } function activityHandler(){ if(activity_request.readyState == 4){ try{rdata=JSON.parse(activity_request.responseText); new_actions = rdata.actions ? rdata.actions : ""; feed = document.getElementById('xActivityFeed'); feed.innerHTML = new_actions + feed.innerHTML;} catch(e){try{console.log("Error: "+ e + " Response was:"+ activity_request.responseText)}catch(e){}} } } function updateFeedTime(cancel){ try{ feed = document.getElementById('xActivityFeed'); spans = feed.getElementsByTagName('span'); maxcount = (spans.length > 40) ? 40 : spans.length; for(var i =0; i< maxcount;i++){ curspan = spans[i]; if(curspan.getAttribute('class') == 'cur_ts'){ curtime = curspan.innerHTML; new_time = xDateFormat(curtime); curspan.previousSibling.innerHTML = new_time; } } if(!cancel){setTimeout("updateFeedTime()",60*1000);} } catch(e){} } function xDateFormat(t){ cur = t ? t : 0; if((cur+"").length<13){cur = cur * 1000}; off = timezone_user_offset ? timezone_user_offset : 0; now = new Date(); if (typeof time_diff_to_server === 'undefined') { var time_diff_to_server = false; } if(time_diff_to_server){curts = Date.parse(now); now.setTime (curts + time_diff_to_server);} now_s = now.getFullYear() + ' ' + (now.getMonth()+1) + ' ' + now.getDate(); today_start = Date.parse(now_s); yesterday_start = today_start - 24*60*60*1000; diff = (Date.parse(now) - cur) / 1000; if(diff < (60)){return 'vor einer Minute'} //diff kleiner als 1 minute? else if(diff < (60*30)){mins = Math.ceil(diff/60); res = 'vor %minutes Minuten'.replace("%minutes", mins); } //diff kleiner als 30 minuten? else if(cur > today_start){cur = cur + off; res = dateFormat(cur,"today");} //cur größer als today_start else if(cur > yesterday_start){cur = cur + off; res = dateFormat(cur,"yesterday");} //cur größer als yesterday_start else {cur = cur + off; res = dateFormat(cur,"norm");} //standard-formatierung: return res; } var xscriptsloaded = []; function xLoadScript(script,sname) { if (typeof(sname) == 'undefined'){ var doit = 0; switch(script){ case 'jquery' : load_url = jq_source; doit = jq_added ? 0 : 1; jq_added = 1; break; case 'titletags' : load_url = title_source; doit = title_added ? 0 : 1; title_added = 1; break; case 'jqueryui' : load_url = jqui_source; doit = jqui_added ? 0 : 1; jqui_added = 1; break; case 'contextmenu' : load_url = context_source; doit = context_added ? 0 : 1; context_added = 1; break; } if(doit){ var e = document.createElement('script'); e.src = load_url; e.async = false; document.documentElement.getElementsByTagName("HEAD")[0].appendChild(e); } }else{ title = sname.toLowerCase(); source = script; if(title=="jquery"){ try{$('
'); return true;}catch(e){} } load_url = source; if(xscriptsloaded.indexOf(title) < 0){ xscriptsloaded.push(title); var e = document.createElement('script'); e.src = load_url; e.async = false; docstate = document.readyState; document.documentElement.getElementsByTagName("HEAD")[0].appendChild(e); } } } function xmouseX(evt) { if(!evt){evt = window.event;} if (evt.pageX) return evt.pageX; else if (evt.clientX) return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); else return null; } function xmouseY(evt) { if(!evt){evt = window.event;} if (evt.pageY) return evt.pageY; else if (evt.clientY) return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); else return null; } function to_UTF8(string){ try { result = decodeURIComponent(string); } catch (e) { result = unescape(string); } return encodeURIComponent(result); } function to_latin(string){ try { result = encodeURIComponent(string); } catch (e) { result = escape(string); } return decodeURIComponent(result); } function xconvert2entity(utf8_string) { if (typeof(utf8_string == 'array')){ utf8_string = {arr : utf8_string}; doarray = 1; } if (typeof(utf8_string == 'object')){ utf8_string = JSON.stringify(utf8_string); dojson = 1; } var html_entity = ""; for(i=0; i<=utf8_string.length; i++) { if(utf8_string.charCodeAt(i)>127){ html_entity += "&#" + utf8_string.charCodeAt(i) + ";"; }else{html_entity += utf8_string.charAt(i);} } if(dojson){html_entity = JSON.parse(html_entity);} if(doarray){html_entity = html_entity.arr;} return html_entity; } function clearAutosave(forum,thread){ var f = forum ? forum : ''; var t = thread ? thread: ''; try{$('
');}catch(e){/*nojqery*/ return true;} if (typeof updateurl === 'undefined') { updateurl = './ajax/checkncacheNewMessage.php';} $('#messagetext').val(''); $('.autosaveinfo,#autosaveinfo,#autosave_info,.autosave_info').remove(); data = {"clear":1,"thread":t,"forum":f}; $.ajax({url : updateurl ,processData: true,contentType: "application/x-www-form-urlencoded; charset:utf-8",data: data,dataType:'json',type : "POST", success: function(res){if(res.cleared){/*done*/}} }); $('#messagetext').focus(); } function clearPNAutosave(){ try{$('
');}catch(e){/*nojqery*/ return true;} if (typeof updateurl === 'undefined') { updateurl = './ajax/checkncacheNewMessage.php';} $('#messagetext').val(''); $('.autosaveinfo,#autosaveinfo,#autosave_info,.autosave_info').remove(); var recs = []; var temprecs =$(document.forms.sendmail).find('input[name="name[]"]'); $.each(temprecs,function(){ var curval = $(this).val(); if(curval && curval.length){recs.push(curval)} }); if(!recs.length){recs=0;} data = {"clear":1,"thread":recs,"forum":"pn"}; $.ajax({url : updateurl ,processData: true,contentType: "application/x-www-form-urlencoded; charset:utf-8",data: data,dataType:'json',type : "POST", success: function(res){if(res.cleared){/*done*/}} }); $('#messagetext').focus(); } var WindowWidth = 0; var WindowHeight = 0; var OffsetX = 0; var OffsetY = 0; var dimSet = 0; var modalContParent = 0; var modalContElement = 0; var scrollTopOffset = 0; function doForumModal(id,header,mwidth){ if(!dimSet) setForumDimensions(); mwidth = mwidth ? mwidth : (WindowWidth/2); mwidth = parseInt(mwidth); modalDiv = document.createElement('div'); modalDiv.className = 'modalDivContainer content panel box'; modalDiv.id = 'modalDivContainer'; modalDiv.style.position = 'absolute'; modalDiv.style.top = 0; modalDiv.style.left = 0; modalDiv.style.width = (WindowWidth + OffsetX)+"px"; modalDiv.style.height = (WindowHeight + OffsetY)+"px"; modalDiv.style.filter = 'Alpha(opacity=50)'; modalDiv.style.opacity = 0.5; modalDiv.style.zIndex = 55555; modalDiv.style.background = '#000000'; modalDiv.onclick = function() {closeForumModal()}; contentdiv = document.createElement('div'); contentdiv.className = 'modalDivContainer content panel box'; contentdiv.id = 'modalDivContent'; contentdiv.style.position='absolute'; //contentdiv.style.top = parseInt(OffsetY + (WindowHeight / 2.8))+"px"; contentdiv.style.top = "100px"; contentdiv.style.left = parseInt((WindowWidth/2) - (mwidth/2))+"px"; contentdiv.style.width = mwidth ? mwidth + 'px' : "500px"; contentdiv.style.height = 'auto'; contentdiv.style.background = '#ffffff'; contentdiv.style.border = '3px solid #3579A1'; contentdiv.style.zIndex = 55556; contentdiv.style.margin = "0px"; contentdiv.style.padding = "0px"; if(header){ contentheaderdiv = document.createElement('div'); contentheaderdiv .className = 'modalDivHeader boxheader'; contentheaderdiv.innerHTML = ''+header+'X
'; } contentcontentdiv= document.createElement('div'); contentcontentdiv.className = 'modalDivContent boxcontent c_r_content2 panel tms1'; contentcontentdiv.style.marginBottom = "0px"; var innercontent = document.getElementById(id); modalContParent = innercontent.parentNode; modalContElement = innercontent; innercontent .style.display = 'block'; contentcontentdiv.appendChild(innercontent ); if(header){contentdiv.appendChild(contentheaderdiv);} contentdiv.appendChild(contentcontentdiv); xaddClass(document.body,"stop_scrolling"); document.body.appendChild(modalDiv); document.body.appendChild(contentdiv); } function closeForumModal(){ xremoveClass(document.body,"stop_scrolling"); try{if(scrollTopOffset > 0){window.scrollBy(0,scrollTopOffset );}}catch(e){} modalContElement.style.display = 'none'; modalContParent.appendChild(modalContElement) document.getElementById('modalDivContent').parentNode.removeChild(document.getElementById('modalDivContent')); document.getElementById('modalDivContainer').parentNode.removeChild(document.getElementById('modalDivContainer')); } function setForumDimensions(){ if(typeof(window.innerWidth) == 'number'){ //Non-IE WindowWidth = window.innerWidth ; WindowHeight = window.innerHeight; OffsetX = window.pageXOffset; OffsetY = window.pageYOffset; } else if(document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight )){ //IE 6+ in standard compliant mode WindowWidth = document.documentElement.clientWidth; WindowHeight = document.documentElement.clientHeight; OffetX = document.body.scrollLeft ; OffsetY = document.body.scrollTop; } else if(document.body && ( document.body.clientWidth || document.body.clientHeight )){ //IE 4 compatible WindowWidth = document.body.clientWidth; WindowHeight = document.body.clientHeight; OffetX = document.body.scrollLeft ; OffsetY = document.body.scrollTop; } scrollTopOffset = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop; dimSet = 1; } function xhasClass(ele,cls) { return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); } function xaddClass(ele,cls) { if (!this.xhasClass(ele,cls)) ele.className += " "+cls; } function xremoveClass(ele,cls) { if (xhasClass(ele,cls)) { var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)'); ele.className=ele.className.replace(reg,' '); } } if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(obj, start) { for (var i = (start || 0), j = this.length; i < j; i++) { if (this[i] === obj) { return i; } } return -1; } } function warningModal(targetid,targettype){ document.getElementById("hidden_targetid").value = targetid; document.getElementById("hidden_targettype").value = targettype; doForumModal("warnmodal",""); //prüfen, ob treshold erreicht wird: try{ document.getElementById("warnmodal").className = ""; if(document.getElementById("warn_treshold_"+targetid)){ document.getElementById("warnmodal").className = "treshold"; } } catch(e){console.log(e);} } function undoWarning(targetid,ttype,iid){ if(!unwarnurl){var unwarnurl = "/ajax/handler.php?method=unwarn";} var param_string = "target_id="+targetid+"&target_type="+ttype+'&integration_id='+iid; warning_request = hpm_createHttpRequestObject(); warning_request.open("POST",unwarnurl,true); warning_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); warning_request.setRequestHeader("Content-length", param_string.length); warning_request.setRequestHeader("Connection", "close"); warning_request.onreadystatechange=warningdone; warning_request.send(param_string); } function undoWarningById(id){ if(!unwarnurl){var unwarnurl = "/ajax/handler.php?method=unwarn";} var param_string = "id="+id; warning_request = hpm_createHttpRequestObject(); warning_request.open("POST",unwarnurl,true); warning_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); warning_request.setRequestHeader("Content-length", param_string.length); warning_request.setRequestHeader("Connection", "close"); warning_request.onreadystatechange=warningdone; warning_request.send(param_string); } function doWarning(){ var targetid = document.getElementById("hidden_targetid").value; var ttype = document.getElementById("hidden_targettype").value; var selVal = document.getElementById("warntype_select").selectedIndex; var warntype = document.getElementById("warntype_select").options[selVal].value; var doPn = document.getElementById("dopn").value; var custPn = document.getElementById("custpn").value; if(!warnurl){var warnurl = "/ajax/handler.php?method=warning";} var param_string = "target_id="+targetid+"&target_type="+ttype+"&warning_type="+warntype+"&dopn="+doPn ; var custwarning = false; if(warntype== "custom"){ custwarning = document.getElementById("custwarning").value; if(custwarning == ""){try{document.getElementById("custwarning_error").style.display='block'; return true;}catch(e){}} custwarning = escape(xconvert2entity(custwarning )); param_string = param_string + "&warning_string=" + custwarning; } var pnText = ""; var skipescape = 0; if(custPn){pnText = document.getElementById("custpntext").innerHTML;} else{ if(custwarning){pnText = custwarning; skipescape = 1;} else{pnText = document.getElementById("warnoptdesc_"+warntype).innerHTML; } } if(!skipescape){pnText = escape(xconvert2entity(pnText));} param_string = param_string + "&pn_string=" + pnText; warning_request = hpm_createHttpRequestObject(); warning_request.open("POST",warnurl,true); warning_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); warning_request.setRequestHeader("Content-length", param_string.length); warning_request.setRequestHeader("Connection", "close"); warning_request.onreadystatechange=warningdone; warning_request.send(param_string); } function warningdone(){ if(warning_request.readyState == 4){ try{rdata=JSON.parse(warning_request.responseText);} catch(e){try{console.log("Error: "+ e + " Response was:"+ warning_request.responseText)}catch(e){}} if(rdata.done){location.reload();} else{if(rdata.errormsg){ if(rdata.errormsg == "notactive"){alert("{[notactive]}")} if(rdata.errormsg == "norights"){alert("{[norights]}")} if(rdata.errormsg == "notfound"){alert("{[notfound]}")} // alert(rdata.errormsg); }} } } var trackingurl = '/ajax/handler.php?method=hitcounter'; function xtrack(track_what,tracking_id){ var cururl = trackingurl + "&what=" + track_what + "&whatid=" + tracking_id; var param_string = ""; warning_request = hpm_createHttpRequestObject(); warning_request.open("GET",cururl ,true); warning_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); warning_request.setRequestHeader("Content-length", param_string.length); warning_request.setRequestHeader("Connection", "close"); warning_request.send(); return true; } function makeFeedEntry(){ var formstring = ""; $entryform = $(formstring); $entryform.appendTo('body'); doForumModal('newfeedentry'); } function addFeedEntry(entry){ $.ajax({ type: "POST", url: '/ajax/handler.php?method=addFeedEntry', data: {'entry':entry}, success: function(result){ location.reload(); } }); } function removeFeedEntry(actionid,entryid){ if(!confirm("{[confirm_delete_generic]}")){return false;} var querystring = "&actionid="+actionid; $('#'+actionid).remove(); if(typeof document.selection != 'undefined'){querystring += "&entryid=" + entryid;} $.ajax({ type: "GET", url: '/ajax/contentHandler.php?action=del&ctype=70' + querystring, success: function(result){ } }); } function isInt(value) { return !isNaN(parseInt(value,10)) && (parseFloat(value,10) == parseInt(value,10)); } function createForumActionInfoBox(){ var $skel = $('