Removed unnecessary whitespace

This commit is contained in:
Tobi Schäfer 2014-07-04 21:15:09 +02:00
parent c505b8e7b4
commit 17078f3252

View file

@ -19,7 +19,7 @@ $(function() {
} }
// Go back one step in history when clicking on links with the cancel class. // Go back one step in history when clicking on links with the cancel class.
$("a.cancel").click(function(event) { $('a.cancel').click(function(event) {
event.preventDefault(); event.preventDefault();
history.back(); history.back();
}); });
@ -31,10 +31,10 @@ $(function() {
// Group related <option> elements by inserting additional <optgroup> elements. // Group related <option> elements by inserting additional <optgroup> elements.
var groups = [], var groups = [],
element = $("form#prefs #timeZone"); element = $('form#prefs #timeZone');
element.find("option").each(function(index, item) { element.find('option').each(function(index, item) {
var zone = $(item), var zone = $(item),
parts = zone.html().split("/"), // E.g. Europe/Vienna parts = zone.html().split('/'), // E.g. Europe/Vienna
group = parts[0]; group = parts[0];
if ($.inArray(group, groups) < 0) { if ($.inArray(group, groups) < 0) {
@ -43,11 +43,11 @@ $(function() {
}); });
groups.sort(); groups.sort();
$.each(groups, function(index, group) { $.each(groups, function(index, group) {
var key = group + "/"; // E.g. Europe/ var key = group + '/'; // E.g. Europe/
element.find("option:contains(" + key + ")") element.find('option:contains(' + key + ')')
.wrapAll($("<optgroup>").attr("label", group)) .wrapAll($('<optgroup>').attr('label', group))
.each(function(index, item) { .each(function(index, item) {
$(item).html($(item).html().replace(key, "")); $(item).html($(item).html().replace(key, ''));
}); });
}); });
@ -63,7 +63,7 @@ function setLayoutMode(mode) {
.append($('<button>') .append($('<button>')
.html('Exit Sandbox') .html('Exit Sandbox')
.click(function() { .click(function() {
location.replace($('a[href$="sandbox"]').attr('href')); location.replace($('a[href$='sandbox']').attr('href'));
}))));*/ }))));*/
$('.skin').each(function() { $('.skin').each(function() {
var skinButton = $('<div class="skin-control"><a class="skin-edit-link">'); var skinButton = $('<div class="skin-control"><a class="skin-edit-link">');
@ -158,18 +158,18 @@ jQuery.md5 = function (string) {
} }
function WordToHex(lValue) { function WordToHex(lValue) {
var WordToHexValue="",WordToHexValue_temp="",lByte,lCount; var WordToHexValue='',WordToHexValue_temp='',lByte,lCount;
for (lCount = 0;lCount<=3;lCount++) { for (lCount = 0;lCount<=3;lCount++) {
lByte = (lValue>>>(lCount*8)) & 255; lByte = (lValue>>>(lCount*8)) & 255;
WordToHexValue_temp = "0" + lByte.toString(16); WordToHexValue_temp = '0' + lByte.toString(16);
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2); WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
} }
return WordToHexValue; return WordToHexValue;
} }
function Utf8Encode(string) { function Utf8Encode(string) {
string = string.replace(/\r\n/g,"\n"); string = string.replace(/\r\n/g,'\n');
var utftext = ""; var utftext = '';
for (var n = 0; n < string.length; n++) { for (var n = 0; n < string.length; n++) {
@ -282,20 +282,20 @@ jQuery.md5 = function (string) {
} }
Antville = {}; Antville = {};
Antville.prefix = "Antville_"; Antville.prefix = 'Antville_';
Antville.encode = function(str) { Antville.encode = function(str) {
var chars = ["&", "<", ">", '"']; var chars = ['&', '<', '>', '\''];
for (var i in chars) { for (var i in chars) {
var c = chars[i]; var c = chars[i];
var re = new RegExp(c, "g"); var re = new RegExp(c, 'g');
str = str.replace(re, "&#" + c.charCodeAt() + ";"); str = str.replace(re, '&#' + c.charCodeAt() + ';');
} }
return str; return str;
} }
Antville.decode = function(str) { Antville.decode = function(str) {
return str.replace(/&amp;/g, "&"); return str.replace(/&amp;/g, '&');
} }
Antville.Referrer = function(url, text, count) { Antville.Referrer = function(url, text, count) {
@ -306,7 +306,7 @@ Antville.Referrer = function(url, text, count) {
var query = new Antville.Query(this.url); var query = new Antville.Query(this.url);
if (query[key]) { if (query[key]) {
if (prefix == null) if (prefix == null)
prefix = ""; prefix = '';
return prefix + Antville.encode(query[key]); return prefix + Antville.encode(query[key]);
} }
return this.text; return this.text;
@ -317,19 +317,19 @@ Antville.Referrer = function(url, text, count) {
Antville.Query = function(str) { Antville.Query = function(str) {
if (str == undefined) if (str == undefined)
var str = location.search.substring(1); var str = location.search.substring(1);
else if (str.indexOf("?") > -1) else if (str.indexOf('?') > -1)
var str = str.split("?")[1]; var str = str.split('?')[1];
if (str == "") if (str == '')
return this; return this;
var parts = Antville.decode(decodeURIComponent(str)).split("&"); var parts = Antville.decode(decodeURIComponent(str)).split('&');
for (var i in parts) { for (var i in parts) {
var pair = parts[i].split("="); var pair = parts[i].split('=');
var key = pair[0]; var key = pair[0];
if (key) { if (key) {
key = key.replace(/\+/g, " "); key = key.replace(/\+/g, ' ');
var value = pair[1]; var value = pair[1];
if (value) if (value)
value = value.replace(/\+/g, " "); value = value.replace(/\+/g, ' ');
this[key] = value; this[key] = value;
} }
} }
@ -343,13 +343,13 @@ Antville.Filter = function(def, key) {
else if (def instanceof Array) else if (def instanceof Array)
this.items = def; this.items = def;
else else
this.items = def.replace(/\r/g, "\n").split("\n"); this.items = def.replace(/\r/g, '\n').split('\n');
this.test = function(str) { this.test = function(str) {
if (!str) if (!str)
return false; return false;
str = str.replace(/&amp;/g, "&"); str = str.replace(/&amp;/g, '&');
for (var n in this.items) { for (var n in this.items) {
var re = new RegExp(this.items[n], "i"); var re = new RegExp(this.items[n], 'i');
if (re.test(str)) if (re.test(str))
return true; return true;
} }