fixed line endings CRLF -> LF

This commit is contained in:
Andreas Gohr 2017-02-09 17:48:44 +01:00
commit 9281ecfa76
21 changed files with 633 additions and 633 deletions

View file

@ -1,85 +1,85 @@
/**
* @file helper funcs
*
*/
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
// shuffle func for random values
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Array.prototype.shuffle = function(){
var tmp, rand;
for(var i =0; i < this.length; i++){
rand = Math.floor(Math.random() * this.length);
tmp = this[i];
this[i] = this[rand];
this[rand] =tmp;
}
};
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
// js trim func for ie
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
};
}
var linkTo_UnCryptMailto = function(s){
location.href=decryptString(s,-2);
};
var decryptCharcode = function(n, start, end, offset) {
n = n + offset;
if (offset > 0 && n > end) {
n = start + (n - end - 1);
} else if (offset < 0 && n < start) {
n = end - (start - n - 1);
}
return String.fromCharCode(n);
};
var decryptString = function(enc, offset) {
var dec = '';
var len = enc.length;
for (var i = 0; i < len; i++) {
var n = enc.charCodeAt(i);
if (n >= 43 && n <= 58) {
dec += decryptCharcode(n, 43, 58, offset);
} else if (n >= 64 && n <= 90) {
dec += decryptCharcode(n, 64, 90, offset);
} else if (n >= 97 && n <= 122) {
dec += decryptCharcode(n, 97, 122, offset);
} else {
dec += enc.charAt(i);
}
}
return dec;
};
/**
* simplify setting and getting state out of a node
* $("#my_id").data("my_data_attr") equals $$("#my_id").my_data_attr and
* $("#my_id").data("my_data_attr", "my_data_val") equals $$("#my_id").my_data_attr = my_data_val
* you can also do
* $$("#my_id").my_data_val = $$("#my_id").my_data_val + 1.
*/
var $$ = function(param) {
var node = $(param)[0];
var id = $.data(node);
$.cache[id] = $.cache[id] || {};
$.cache[id].node = node;
return $.cache[id];
};
var alertFB = false;
if (typeof console === "undefined" || typeof console.log === "undefined") {
console = {};
if (alertFB) {
console.log = function(msg) {
alert(msg);
};
} else {
console.log = function() {};
}
}
var wikiLang = "de";
/**
* anonymous func: get page language
*/
(function($){ $("html").attr("lang"); if(typeof(l)!= 'undefined' && l.length>=2) wikiLang=l.substr(0,2).toLowerCase(); if(wikiLang!='de'&& wikiLang!='en') wikiLang='de'; })(jQuery);
/**
* @file helper funcs
*
*/
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
// shuffle func for random values
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Array.prototype.shuffle = function(){
var tmp, rand;
for(var i =0; i < this.length; i++){
rand = Math.floor(Math.random() * this.length);
tmp = this[i];
this[i] = this[rand];
this[rand] =tmp;
}
};
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
// js trim func for ie
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
};
}
var linkTo_UnCryptMailto = function(s){
location.href=decryptString(s,-2);
};
var decryptCharcode = function(n, start, end, offset) {
n = n + offset;
if (offset > 0 && n > end) {
n = start + (n - end - 1);
} else if (offset < 0 && n < start) {
n = end - (start - n - 1);
}
return String.fromCharCode(n);
};
var decryptString = function(enc, offset) {
var dec = '';
var len = enc.length;
for (var i = 0; i < len; i++) {
var n = enc.charCodeAt(i);
if (n >= 43 && n <= 58) {
dec += decryptCharcode(n, 43, 58, offset);
} else if (n >= 64 && n <= 90) {
dec += decryptCharcode(n, 64, 90, offset);
} else if (n >= 97 && n <= 122) {
dec += decryptCharcode(n, 97, 122, offset);
} else {
dec += enc.charAt(i);
}
}
return dec;
};
/**
* simplify setting and getting state out of a node
* $("#my_id").data("my_data_attr") equals $$("#my_id").my_data_attr and
* $("#my_id").data("my_data_attr", "my_data_val") equals $$("#my_id").my_data_attr = my_data_val
* you can also do
* $$("#my_id").my_data_val = $$("#my_id").my_data_val + 1.
*/
var $$ = function(param) {
var node = $(param)[0];
var id = $.data(node);
$.cache[id] = $.cache[id] || {};
$.cache[id].node = node;
return $.cache[id];
};
var alertFB = false;
if (typeof console === "undefined" || typeof console.log === "undefined") {
console = {};
if (alertFB) {
console.log = function(msg) {
alert(msg);
};
} else {
console.log = function() {};
}
}
var wikiLang = "de";
/**
* anonymous func: get page language
*/
(function($){ $("html").attr("lang"); if(typeof(l)!= 'undefined' && l.length>=2) wikiLang=l.substr(0,2).toLowerCase(); if(wikiLang!='de'&& wikiLang!='en') wikiLang='de'; })(jQuery);

12
js/base/rem.min.js vendored
View file

@ -1,7 +1,7 @@
/**
* Module: rem - v1.3.2
* Description: A polyfill to parse CSS links and rewrite pixel equivalents into head for non supporting browsers
* Date Built: 2014-07-02
* Copyright (c) 2014 | Chuck Carpenter <chuck.carpenter@me.com>,Lucas Serven <lserven@gmail.com>;
**/
/**
* Module: rem - v1.3.2
* Description: A polyfill to parse CSS links and rewrite pixel equivalents into head for non supporting browsers
* Date Built: 2014-07-02
* Copyright (c) 2014 | Chuck Carpenter <chuck.carpenter@me.com>,Lucas Serven <lserven@gmail.com>;
**/
!function(e){"use strict";var t=function(){var e=document.createElement("div");return e.style.cssText="font-size: 1rem;",/rem/.test(e.style.fontSize)},n=function(){for(var e=document.getElementsByTagName("link"),t=[],n=0;n<e.length;n++)"stylesheet"===e[n].rel.toLowerCase()&&null===e[n].getAttribute("data-norem")&&t.push(e[n].href);return t},r=function(){for(var e=0;e<h.length;e++)l(h[e],o)},o=function(e,t){if(p.push(e.responseText),v.push(t),v.length===h.length){for(var n=0;n<v.length;n++)a(p[n],v[n]);(h=m.slice(0)).length>0?(v=[],p=[],m=[],r()):i()}},a=function(e,t){for(var n,r=d(e).replace(/\/\*[\s\S]*?\*\//g,""),o=/[\w\d\s\-\/\\\[\]:,.'"*()<>+~%#^$_=|@]+\{[\w\d\s\-\/\\%#:!;,.'"*()]+\d*\.?\d+rem[\w\d\s\-\/\\%#:!;,.'"*()]*\}/g,a=r.match(o),i=/\d*\.?\d+rem/g,s=r.match(i),c=/(.*\/)/,l=c.exec(t)[0],u=/@import (?:url\()?['"]?([^'\)"]*)['"]?\)?[^;]*/gm;null!==(n=u.exec(e));)m.push(0===n[1].indexOf("/")?n[1]:l+n[1]);null!==a&&0!==a.length&&(f=f.concat(a),g=g.concat(s))},i=function(){for(var e=/[\w\d\s\-\/\\%#:,.'"*()]+\d*\.?\d+rem[\w\d\s\-\/\\%#:!,.'"*()]*[;}]/g,t=0;t<f.length;t++){u+=f[t].substr(0,f[t].indexOf("{")+1);for(var n=f[t].match(e),r=0;r<n.length;r++)u+=n[r],r===n.length-1&&"}"!==u[u.length-1]&&(u+="\n}")}s()},s=function(){for(var e=0;e<g.length;e++)y[e]=Math.round(parseFloat(g[e].substr(0,g[e].length-3)*w))+"px";c()},c=function(){for(var e=0;e<y.length;e++)y[e]&&(u=u.replace(g[e],y[e]));var t=document.createElement("style");t.setAttribute("type","text/css"),t.id="remReplace",document.getElementsByTagName("head")[0].appendChild(t),t.styleSheet?t.styleSheet.cssText=u:t.appendChild(document.createTextNode(u))},l=function(t,n){try{var r=e.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP")||new ActiveXObject("Msxml2.XMLHTTP"):new XMLHttpRequest;r.open("GET",t,!0),r.onreadystatechange=function(){4===r.readyState&&n(r,t)},r.send(null)}catch(o){if(e.XDomainRequest){var a=new XDomainRequest;a.open("get",t),a.onload=function(){n(a,t)},a.onerror=function(){return!1},a.send()}}},d=function(t){return e.matchMedia||e.msMatchMedia||(t=t.replace(/@media[\s\S]*?\}\s*\}/g,"")),t};if(!t()){var u="",h=n(),m=[],f=[],g=[],p=[],v=[],y=[],w="";w=function(){var e,t=document,n=t.documentElement,r=t.body||t.createElement("body"),o=!t.body,a=t.createElement("div"),i=r.style.fontSize;return o&&n.appendChild(r),a.style.cssText="width:1em; position:absolute; visibility:hidden; padding: 0;",r.style.fontSize="1em",r.appendChild(a),e=a.offsetWidth,o?n.removeChild(r):(r.removeChild(a),r.style.fontSize=i),e}(),r()}}(window);

View file

@ -1,198 +1,198 @@
/**
* @file utility funcs for jQuery projects
*
*/
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
// object literal with funcs for jquery plug-ins
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
var spc = {
/*general options */
config: {
debug: false,
dev: true
},
isDef: function(val){
return (val===undefined) ? false : true;
},
/* get options of object */
get_options: function(key, options){
var result = null;
if ('object' == typeof(options)) {
result = options[key];
}
if (!result) { return ""; }
return result;
},
/* set wai aria roles to list of containern */
set_wa: function(contlist, ariaattr,ariaval){
$(contlist).attr(ariaattr, ariaval);
},
/* Encode/decode htmlentities */
encode_entities: function(s){
return $("<acronym/>").text(s).html();
},
decode_entities: function(s){
return $("<acronym/>").html(s).text();
},
/* add func to load event */
add_loadEvent: function(func_name){
var lastonload = window.onload;
if (typeof window.onload != 'function') { window.onload = func_name; }
else { window.onload = function() { lastonload(); func_name(); }; }
},
/* logging for debug */
_debug: function(msg){
if(this.config.debug) {
try{
if(console){
console.log(msg);
} else{
alert(msg);
}
}catch(err){
alert(msg);
}
}
},
/* return obj values for debug */
_get_objVs: function(objl){
try{
var p = typeof JSON != "undefined" ? JSON.stringify : function(objl){
var arr = [];
$.each(objl,function(key,val){
var next = key + ": ";
next += $.isPlainObject(val) ? printObj(val) : val;
arr.push( next );
});
return "{ " + arr.join(", ") + " }";
};
return p(objl);
}catch(err){
this._debug(err);
return '';
}
},
aria_live: function(setobj){
if(typeof(setobj)=='object'){
setobj.attr('aria-live',"polite");
}
},
aria_role: function(setobj, role){
if(typeof(setobj)=='object'){
setobj.attr('role',role);
}
},
change_tabindex: function(remobj,setobj,i){
if(typeof(remobj)=='object'){
remobj.removeAttr('tabindex');
}
if(typeof(setobj)=='object'){
setobj.attr('tabindex',i);
}
},
/* set focus to dom object: param obj */
set_newfocusObj: function(focusobj){
try{
if(focusobj) focusobj.focus();
}catch(err){
this._debug('exception: '+err);
}
},
/* set focus to dom object: param id */
set_newfocusId: function(fid){
try{
var focusobj = document.getElementById(fid);
if(focusobj) focusobj.focus();
if(focusobj) console.log(focusobj);
}catch(err){
this._debug('exception: '+err);
}
},
/* set focus to nonfocussable dom object: */
set_newfocusBox: function(remobj,setobj){
this.change_tabindex(remobj,setobj,0);
try{
if(setobj) setobj.focus();
}catch(err){
this._debug('exception: '+err);
}
},
/* set title(s) and remove other title(s) if set */
set_title: function(remobj,setobj,ctitle){
if(typeof(remobj)=='object'){
remobj.removeAttr('title');
}
if(typeof(setobj)=='object'){
setobj.attr('title',ctitle);
}
},
/* count appearances of dom elems with certain markup */
count: function(jqdom){
var num = 0;
$(jqdom).each(function() {
num++;
});
return num;
},
countOV: function(objlit){
var i = 0;
for (var elem in objlit){
i++;
}
return i;
},
/*merge object literals (do not overwrite default, not recursively) */
merge: function(objl1,objl2,objl3,objl4){
return $.extend({},objl1,objl2,objl3,objl4);
},
/*merge object literals (do not overwrite default, recursively) */
mergeR: function(objl1,objl2,objl3,objl4){
return $.extend(true,{},objl1,objl2,objl3,objl4);
},
loadImage: function(isrc, func, errfunc){
try{
var img = new Image();
img.onload = func;
img.onerror = errfunc;
img.src = isrc;
}catch(err){
errfunc();
}
},
tb_getPageSize: function(){
var de=document.documentElement;
var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;
var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;
arrayPageSize=[w,h];
return arrayPageSize;
},
useLocStorage: function(){
return ('localStorage' in window && window.localStorage !== null);
},
saveLSI: function(key, data){
if (this.useLocStorage) {
localStorage.setItem(key, data);
}
},
removeLSI: function(key){
if (this.useLocStorage) {
localStorage.removeItem(key);
}
},
getLSI: function(key){
if (this.useLocStorage) {
return localStorage.getItem(key);
}
return '';
},
showAllLSI: function() {
if (this.useLocStorage) {
var key = "";
for (var i=0; i<=localStorage.length-1; i++) {
key = localStorage.key(i);
//console.log(key+': '+localStorage.getItem(key));
}
}
}
};
/**
* @file utility funcs for jQuery projects
*
*/
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
// object literal with funcs for jquery plug-ins
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
var spc = {
/*general options */
config: {
debug: false,
dev: true
},
isDef: function(val){
return (val===undefined) ? false : true;
},
/* get options of object */
get_options: function(key, options){
var result = null;
if ('object' == typeof(options)) {
result = options[key];
}
if (!result) { return ""; }
return result;
},
/* set wai aria roles to list of containern */
set_wa: function(contlist, ariaattr,ariaval){
$(contlist).attr(ariaattr, ariaval);
},
/* Encode/decode htmlentities */
encode_entities: function(s){
return $("<acronym/>").text(s).html();
},
decode_entities: function(s){
return $("<acronym/>").html(s).text();
},
/* add func to load event */
add_loadEvent: function(func_name){
var lastonload = window.onload;
if (typeof window.onload != 'function') { window.onload = func_name; }
else { window.onload = function() { lastonload(); func_name(); }; }
},
/* logging for debug */
_debug: function(msg){
if(this.config.debug) {
try{
if(console){
console.log(msg);
} else{
alert(msg);
}
}catch(err){
alert(msg);
}
}
},
/* return obj values for debug */
_get_objVs: function(objl){
try{
var p = typeof JSON != "undefined" ? JSON.stringify : function(objl){
var arr = [];
$.each(objl,function(key,val){
var next = key + ": ";
next += $.isPlainObject(val) ? printObj(val) : val;
arr.push( next );
});
return "{ " + arr.join(", ") + " }";
};
return p(objl);
}catch(err){
this._debug(err);
return '';
}
},
aria_live: function(setobj){
if(typeof(setobj)=='object'){
setobj.attr('aria-live',"polite");
}
},
aria_role: function(setobj, role){
if(typeof(setobj)=='object'){
setobj.attr('role',role);
}
},
change_tabindex: function(remobj,setobj,i){
if(typeof(remobj)=='object'){
remobj.removeAttr('tabindex');
}
if(typeof(setobj)=='object'){
setobj.attr('tabindex',i);
}
},
/* set focus to dom object: param obj */
set_newfocusObj: function(focusobj){
try{
if(focusobj) focusobj.focus();
}catch(err){
this._debug('exception: '+err);
}
},
/* set focus to dom object: param id */
set_newfocusId: function(fid){
try{
var focusobj = document.getElementById(fid);
if(focusobj) focusobj.focus();
if(focusobj) console.log(focusobj);
}catch(err){
this._debug('exception: '+err);
}
},
/* set focus to nonfocussable dom object: */
set_newfocusBox: function(remobj,setobj){
this.change_tabindex(remobj,setobj,0);
try{
if(setobj) setobj.focus();
}catch(err){
this._debug('exception: '+err);
}
},
/* set title(s) and remove other title(s) if set */
set_title: function(remobj,setobj,ctitle){
if(typeof(remobj)=='object'){
remobj.removeAttr('title');
}
if(typeof(setobj)=='object'){
setobj.attr('title',ctitle);
}
},
/* count appearances of dom elems with certain markup */
count: function(jqdom){
var num = 0;
$(jqdom).each(function() {
num++;
});
return num;
},
countOV: function(objlit){
var i = 0;
for (var elem in objlit){
i++;
}
return i;
},
/*merge object literals (do not overwrite default, not recursively) */
merge: function(objl1,objl2,objl3,objl4){
return $.extend({},objl1,objl2,objl3,objl4);
},
/*merge object literals (do not overwrite default, recursively) */
mergeR: function(objl1,objl2,objl3,objl4){
return $.extend(true,{},objl1,objl2,objl3,objl4);
},
loadImage: function(isrc, func, errfunc){
try{
var img = new Image();
img.onload = func;
img.onerror = errfunc;
img.src = isrc;
}catch(err){
errfunc();
}
},
tb_getPageSize: function(){
var de=document.documentElement;
var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;
var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;
arrayPageSize=[w,h];
return arrayPageSize;
},
useLocStorage: function(){
return ('localStorage' in window && window.localStorage !== null);
},
saveLSI: function(key, data){
if (this.useLocStorage) {
localStorage.setItem(key, data);
}
},
removeLSI: function(key){
if (this.useLocStorage) {
localStorage.removeItem(key);
}
},
getLSI: function(key){
if (this.useLocStorage) {
return localStorage.getItem(key);
}
return '';
},
showAllLSI: function() {
if (this.useLocStorage) {
var key = "";
for (var i=0; i<=localStorage.length-1; i++) {
key = localStorage.key(i);
//console.log(key+': '+localStorage.getItem(key));
}
}
}
};