Subpage under development, new version coming soon!
Asunto: SkUnk - dodatek do sokkera
Lipa91 para
kryminator
501.lib_common.js
// ========================================================
// =================== C O M M O N ========================
sk_libs.common = {
// Returns array with URL path split by slash separator.
_splitURL : function() {
return document.location.pathname.split("/");
},
// Checks if browser is the one given in parameter by checking whether
// user agent contains given string.
_userAgent : function(bName) {
return navigator.userAgent.indexOf(bName) != -1;
},
// Gets dayt of the week from date string.
_weekday : function(date) {
var arr = date.split('-');
return new Date(parseInt(arr[0], 10),
parseInt(arr[1], 10)-1,
parseInt(arr[2], 10)).getDay();
},
// Removes element from list from preferences and from preferences by moving
// last element of list to index of removed element.
removeFromPrefs : function(key, arr, idx, cb) {
var lastIdx = arr.length-1;
var keyPfx = key + _optionSeparator;
var keyRemove = keyPfx + lastIdx + '';
var keySave = keyPfx + idx + '';
var val = {};
for (var i=0; i 0;
},
// Checks if current layout is old sokker layout.
isLayoutOld : function() {
return _layout.skin == _layout.SKIN.OLD;
},
// Checks if given list based on key contains given value.
// Returns null if given value is invalid, false if value is not in array or
// single-item array (array is needed to exclude situation when index is 0
// and some conditions would be falses then) with index of value in array
// if it is included there.
containsValue : function(key, arr, val) {
var subid = _uniques[key];
var idx = _fieldsForOption[key].indexOf(subid);
tArr = [];
for (var i=0; i 0) {
cntnr.appendChild(header);
}
if (items.length > 0) {
cntnr.appendChild(content);
}
}
return cntnr;
},
// Creates popup dialog
createPopup : function(ev, id_, args) {
// Setting default values if some arguments were not given.
onSave = args.onSave;
onCancel = args.onCancel || function(ev) {
document.body.removeChild(document.getElementById(id_));
};
onLoad = args.onLoad || function(ev) {};
labelSave = args.labelSave || _('lblSave');
labelCancel = args.labelCancel || _('lblCancel');
items = args.items || [];
buttons = args.buttons || [];
isAbove = args.isAbove || false;
isOnLeft = args.isOnLeft || false;
// Check if popup exists, if no then create it.
var divPopup = $('div#' + id_, document);
if (divPopup.length == 0) {
// Building the popup.
divPopup = document.createElement('div');
var divContent = document.createElement('div');
var divButtons = document.createElement('div');
divPopup.setAttribute('id', id_);
divPopup.setAttribute('class', _layout.classdef.popup);
divContent.setAttribute('class', _layout.classdef.popupDiv);
divButtons.setAttribute('class', _layout.classdef.popupDiv);
for (var idx in items) {
divContent.appendChild(items[idx]);
}
if (onSave) {
var btnSave = document.createElement('button');
btnSave.setAttribute('type', 'button');
btnSave.setAttribute('class', _layout.classdef.btnLink);
btnSave.setAttribute('style', 'cursor:pointer;');
btnSave.innerHTML = vsprintf(_layout.html.button, [labelSave]);
btnSave.addEventListener('click', onSave);
divButtons.appendChild(btnSave);
}
var btnCancel = document.createElement('button');
btnCancel.setAttribute('type', 'button');
btnCancel.setAttribute('class', _layout.classdef.btnLink);
btnCancel.setAttribute('style', 'cursor:pointer;');
btnCancel.innerHTML = vsprintf(_layout.html.button, [labelCancel]);
btnCancel.addEventListener('click', onCancel);
divButtons.appendChild(btnCancel);
for (var idx in buttons) {
divButtons.appendChild(buttons[idx]);
}
divPopup.appendChild(divContent);
divPopup.appendChild(divButtons);
// Set popup to be invisible to estimate its height and after that apply proper style to it.
divPopup.setAttribute('style', 'visibility:hidden;position: absolute;');
document.body.appendChild(divPopup);
} else {
divPopup = divPopup[0];
}
offsetY = isAbove ? -(divPopup.clientHeight + 20) : 0;
offsetX = isOnLeft ? -(divPopup.clientWidth + 20) : 0;
divPopup.setAttribute('style', [
_layout.styledef.popupBorder,
'border-radius: 10px;',
'top: ' + (ev.clientY + document.defaultView.scrollY + offsetY) + 'px;',
'left: ' + (ev.clientX + document.defaultView.scrollX + offsetX) + 'px;',
'padding: 10px 10px 0px 10px;',
'position: absolute;',
'z-index: 1000;'
].join(''));
onLoad();
},
// Creates flags container with built-in functionality of executing given
// callback function with locale related to clicked flag.
createFlagsDiv : function(callback, args) {
var flagsCntnr = document.createElement('div');
flagsCntnr.setAttribute('id', 'sk_flagsDiv');
flagsCntnr.setAttribute('style', 'max-width:400px;');
// Flag links for old layout
var flagLinks = $('div#indexFooterLangList li', document);
flagLinks.each(function(idx) {
var langCode = this.querySelector('a').getAttribute('href').split('/').reverse()[0];
var flagLink = vsprintf(sk_libs.player._flagPathTemplate, [this.getAttribute('flag')]);
var img = document.createElement('img');
img.setAttribute('style', 'display:inline;');
img.setAttribute('border', '0');
img.setAttribute('alt', '');
img.setAttribute('src', flagLink);
img.addEventListener('click', function(evImgClick) {
executeWithLocale(function() {
callback(args);
executeWithLocale(function() {}, null);
}, langCode);
});
flagsCntnr.appendChild(img);
});
// Flag links for new layout
var xhr = new XMLHttpRequest();
xhr.open('GET', _http('/get/part/lang_list'), true);
xhr.addEventListener('load', function(evLoad) {
if (this.readyState === 4 && this.status === 200) {
var flagLinks = $(this.responseText).find('a.btn');
var flagsCntnr = $('#sk_flagsDiv', document)[0];
flagLinks.each(function(idx) {
var langCode = this.getAttribute('href').split('/').reverse()[0];
var flagLink = this.querySelector('img')
.getAttribute('src').replace(/^https:/, 'http:');
var img = document.createElement('img');
img.setAttribute('style', 'display:inline;');
img.setAttribute('border', '0');
img.setAttribute('alt', '');
img.setAttribute('src', flagLink);
img.addEventListener('click', function(evImgClick) {
executeWithLocale(function() {
callback(args);
executeWithLocale(function() {}, null);
}, langCode);
});
flagsCntnr.appendChild(img);
});
}
});
xhr.send();
return flagsCntnr;
},
// Converts given number to formatted string representing amount of money,
// optionally with given currency.
number2Currency : function(no, curr) {
if (curr) {
curr = ' ' + curr;
} else {
curr = '';
}
if (no%1 != 0) {
no = parseInt(no);
}
return no.toString().replace(/\d(?=(\d{3})+$)/g, '$& ') + curr;
},
// ************** MAIN ***************
// Checks if current page is main page.
isTeam : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "glowna";
var test2 = arr[0] == "" && arr[1] == "team";
var test3 = arr.slice(2).indexOf("teamID") % 2 == 0;
var test4 = arr.slice(2).indexOf("userID") % 2 == 0;
return test1 || (test2 && (test3 || test4));
},
// Checks if current page is login page.
isLogon : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "logon";
return test1;
},
// Checks if current page is login page.
isLeague : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "league";
return test1;
},
// ************** FORUM **************
// Checks if current page is forum page.
isForum : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "forum";
var test2 = arr.slice(2).indexOf("ID_forum") % 2 == 0;
return test1 && test2;
},
// Checks if current page is thread page.
isThread : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "forum_topic";
var test2 = arr.slice(2).indexOf("ID_forum") % 2 == 0;
/*var test3 = arr.slice(2).indexOf("ID_topic") % 2 == 0;
var test4 = arr.slice(2).indexOf("pg") % 2 == 0;
var test5 = /\/forum_topic\/#new$/.test(document.location.href);
var test6 = arr.slice(2).indexOf("post_no") % 2 == 0;
var test7 = arr.slice(2).indexOf("action") % 2 == 0;
var test8 = /\/action\/Del\/?/.test(document.location.href);
return (test1 && test2 && test3 && test4) || (test1 && test5)
|| (test1 && test3 && test6 && test7 && test8);*/
return test1 && test2;
},
// Checks if current page is reply to post page.
isNewPost : function() {
var arr = this._splitURL();
var test1 = arr.slice(2).indexOf("post_no") % 2 == 0;
var test2 = arr.slice(2).indexOf("action");
var test3 = arr[test2 + 1] == "New";
test2 = test2 % 2 == 0;
return test1 && test2 && test3;
},
// ************** PLAYER **************
// Checks if current page is player page.
isPlayer : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "player";
var test2 = arr.slice(2).indexOf("PID") % 2 == 0;
return test1 && test2;
},
// ************** PLAYERS **************
// Checks if current page is players page.
isPlayers : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "players";
var test2 = arr[0] == "" && arr[1] == "players.php";
return test1 || test2;
},
// ************** JUNIORS **************
// Checks if current page is juniors page.
isJuniors : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "juniors";
return test1;
},
// ************** TRANSFERS **************
// Checks if current page is transfers page.
isTransfers : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "transfers";
var test2 = /\/action\/showlast\/?/.test(document.location.href);
return test1 && !test2;
},
// Checks if current page is transfer search page.
isTransferSearch : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "transferSearch";
return test1;
},
// Loads main transfers page.
loadTransfers : function() {
document.location.href = _http('/transfers');
},
// ************** OFFICE **************
// Checks if current page is main office page.
isOffice : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "office";
return test1;
},
// Loads main office page.
loadOffice : function() {
document.location.href = _http('/office');
},
// ************** MATCHES **************
// Checks if current page is matches page.
isMatches : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "matches";
return test1;
},
// Checks if current page is studio page.
isStudio : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "studio";
var test2 = arr.slice(2).indexOf("matchID") % 2 == 0;
return test1 && test2;
},
// Checks if current page is match report/comment page.
isReport : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "comment";
var test2 = arr.slice(2).indexOf("matchID") % 2 == 0;
return test1 && test2;
},
// Checks if current page is match view page.
isMatchView : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "matchview.php";
return test1;
},
// Checks if current page is match video page.
isMatchVideo : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "match_video";
return test1;
},
// Checks if current page is match statistics page.
isMatchStats : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "stats";
var test2 = arr.slice(2).indexOf("matchID") % 2 == 0;
var test3 = arr.slice(2).indexOf("teamID") % 2 == 0;
return test1 && test2 && test3;
},
// ************** HISTORY **************
// Checks if current page is club history page.
isHistory : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "history_team";
var test2 = arr.slice(2).indexOf("teamID") % 2 == 0;
return test1 && test2;
},
// ************** STADIUM **************
// Checks if current page is club stadium page.
isStadium : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "arena";
return test1;
},
// Checks if current page is user`s club stadium page.
isUserStadium : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "arena";
var test2 = arr.length == 2;
var test3 = $(_searcher.stadium.changePrice, document).length > 0;
var test4 = $(_searcher.stadium.construction, document).length > 0;
return test1 && (test2 || (test3 && test4));
},
// Loads user stadium page.
loadUserStadium : function() {
document.location.href = _http('/arena');
},
// ************** TACTICS **************
// Checks if current page is tactic edit page.
isTacticEdit : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "tactedit";
return test1;
},
// ************** ECONOMY **************
// Checks if current page is club economy page.
isEconomy : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "economy";
return test1;
},
// ************** LINE-UP **************
// Checks if current page is line-up page.
isLineup : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "lineup";
var test2 = arr.slice(2).indexOf("matchID") % 2 == 0;
var test3 = arr.slice(2).indexOf("squadform") % 2 == 1;
var test4 = arr.length == 4;
return test1 && test2 && (test3 || test4);
}
};
// ========================================================
// =================== C O M M O N ========================
sk_libs.common = {
// Returns array with URL path split by slash separator.
_splitURL : function() {
return document.location.pathname.split("/");
},
// Checks if browser is the one given in parameter by checking whether
// user agent contains given string.
_userAgent : function(bName) {
return navigator.userAgent.indexOf(bName) != -1;
},
// Gets dayt of the week from date string.
_weekday : function(date) {
var arr = date.split('-');
return new Date(parseInt(arr[0], 10),
parseInt(arr[1], 10)-1,
parseInt(arr[2], 10)).getDay();
},
// Removes element from list from preferences and from preferences by moving
// last element of list to index of removed element.
removeFromPrefs : function(key, arr, idx, cb) {
var lastIdx = arr.length-1;
var keyPfx = key + _optionSeparator;
var keyRemove = keyPfx + lastIdx + '';
var keySave = keyPfx + idx + '';
var val = {};
for (var i=0; i 0;
},
// Checks if current layout is old sokker layout.
isLayoutOld : function() {
return _layout.skin == _layout.SKIN.OLD;
},
// Checks if given list based on key contains given value.
// Returns null if given value is invalid, false if value is not in array or
// single-item array (array is needed to exclude situation when index is 0
// and some conditions would be falses then) with index of value in array
// if it is included there.
containsValue : function(key, arr, val) {
var subid = _uniques[key];
var idx = _fieldsForOption[key].indexOf(subid);
tArr = [];
for (var i=0; i 0) {
cntnr.appendChild(header);
}
if (items.length > 0) {
cntnr.appendChild(content);
}
}
return cntnr;
},
// Creates popup dialog
createPopup : function(ev, id_, args) {
// Setting default values if some arguments were not given.
onSave = args.onSave;
onCancel = args.onCancel || function(ev) {
document.body.removeChild(document.getElementById(id_));
};
onLoad = args.onLoad || function(ev) {};
labelSave = args.labelSave || _('lblSave');
labelCancel = args.labelCancel || _('lblCancel');
items = args.items || [];
buttons = args.buttons || [];
isAbove = args.isAbove || false;
isOnLeft = args.isOnLeft || false;
// Check if popup exists, if no then create it.
var divPopup = $('div#' + id_, document);
if (divPopup.length == 0) {
// Building the popup.
divPopup = document.createElement('div');
var divContent = document.createElement('div');
var divButtons = document.createElement('div');
divPopup.setAttribute('id', id_);
divPopup.setAttribute('class', _layout.classdef.popup);
divContent.setAttribute('class', _layout.classdef.popupDiv);
divButtons.setAttribute('class', _layout.classdef.popupDiv);
for (var idx in items) {
divContent.appendChild(items[idx]);
}
if (onSave) {
var btnSave = document.createElement('button');
btnSave.setAttribute('type', 'button');
btnSave.setAttribute('class', _layout.classdef.btnLink);
btnSave.setAttribute('style', 'cursor:pointer;');
btnSave.innerHTML = vsprintf(_layout.html.button, [labelSave]);
btnSave.addEventListener('click', onSave);
divButtons.appendChild(btnSave);
}
var btnCancel = document.createElement('button');
btnCancel.setAttribute('type', 'button');
btnCancel.setAttribute('class', _layout.classdef.btnLink);
btnCancel.setAttribute('style', 'cursor:pointer;');
btnCancel.innerHTML = vsprintf(_layout.html.button, [labelCancel]);
btnCancel.addEventListener('click', onCancel);
divButtons.appendChild(btnCancel);
for (var idx in buttons) {
divButtons.appendChild(buttons[idx]);
}
divPopup.appendChild(divContent);
divPopup.appendChild(divButtons);
// Set popup to be invisible to estimate its height and after that apply proper style to it.
divPopup.setAttribute('style', 'visibility:hidden;position: absolute;');
document.body.appendChild(divPopup);
} else {
divPopup = divPopup[0];
}
offsetY = isAbove ? -(divPopup.clientHeight + 20) : 0;
offsetX = isOnLeft ? -(divPopup.clientWidth + 20) : 0;
divPopup.setAttribute('style', [
_layout.styledef.popupBorder,
'border-radius: 10px;',
'top: ' + (ev.clientY + document.defaultView.scrollY + offsetY) + 'px;',
'left: ' + (ev.clientX + document.defaultView.scrollX + offsetX) + 'px;',
'padding: 10px 10px 0px 10px;',
'position: absolute;',
'z-index: 1000;'
].join(''));
onLoad();
},
// Creates flags container with built-in functionality of executing given
// callback function with locale related to clicked flag.
createFlagsDiv : function(callback, args) {
var flagsCntnr = document.createElement('div');
flagsCntnr.setAttribute('id', 'sk_flagsDiv');
flagsCntnr.setAttribute('style', 'max-width:400px;');
// Flag links for old layout
var flagLinks = $('div#indexFooterLangList li', document);
flagLinks.each(function(idx) {
var langCode = this.querySelector('a').getAttribute('href').split('/').reverse()[0];
var flagLink = vsprintf(sk_libs.player._flagPathTemplate, [this.getAttribute('flag')]);
var img = document.createElement('img');
img.setAttribute('style', 'display:inline;');
img.setAttribute('border', '0');
img.setAttribute('alt', '');
img.setAttribute('src', flagLink);
img.addEventListener('click', function(evImgClick) {
executeWithLocale(function() {
callback(args);
executeWithLocale(function() {}, null);
}, langCode);
});
flagsCntnr.appendChild(img);
});
// Flag links for new layout
var xhr = new XMLHttpRequest();
xhr.open('GET', _http('/get/part/lang_list'), true);
xhr.addEventListener('load', function(evLoad) {
if (this.readyState === 4 && this.status === 200) {
var flagLinks = $(this.responseText).find('a.btn');
var flagsCntnr = $('#sk_flagsDiv', document)[0];
flagLinks.each(function(idx) {
var langCode = this.getAttribute('href').split('/').reverse()[0];
var flagLink = this.querySelector('img')
.getAttribute('src').replace(/^https:/, 'http:');
var img = document.createElement('img');
img.setAttribute('style', 'display:inline;');
img.setAttribute('border', '0');
img.setAttribute('alt', '');
img.setAttribute('src', flagLink);
img.addEventListener('click', function(evImgClick) {
executeWithLocale(function() {
callback(args);
executeWithLocale(function() {}, null);
}, langCode);
});
flagsCntnr.appendChild(img);
});
}
});
xhr.send();
return flagsCntnr;
},
// Converts given number to formatted string representing amount of money,
// optionally with given currency.
number2Currency : function(no, curr) {
if (curr) {
curr = ' ' + curr;
} else {
curr = '';
}
if (no%1 != 0) {
no = parseInt(no);
}
return no.toString().replace(/\d(?=(\d{3})+$)/g, '$& ') + curr;
},
// ************** MAIN ***************
// Checks if current page is main page.
isTeam : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "glowna";
var test2 = arr[0] == "" && arr[1] == "team";
var test3 = arr.slice(2).indexOf("teamID") % 2 == 0;
var test4 = arr.slice(2).indexOf("userID") % 2 == 0;
return test1 || (test2 && (test3 || test4));
},
// Checks if current page is login page.
isLogon : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "logon";
return test1;
},
// Checks if current page is login page.
isLeague : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "league";
return test1;
},
// ************** FORUM **************
// Checks if current page is forum page.
isForum : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "forum";
var test2 = arr.slice(2).indexOf("ID_forum") % 2 == 0;
return test1 && test2;
},
// Checks if current page is thread page.
isThread : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "forum_topic";
var test2 = arr.slice(2).indexOf("ID_forum") % 2 == 0;
/*var test3 = arr.slice(2).indexOf("ID_topic") % 2 == 0;
var test4 = arr.slice(2).indexOf("pg") % 2 == 0;
var test5 = /\/forum_topic\/#new$/.test(document.location.href);
var test6 = arr.slice(2).indexOf("post_no") % 2 == 0;
var test7 = arr.slice(2).indexOf("action") % 2 == 0;
var test8 = /\/action\/Del\/?/.test(document.location.href);
return (test1 && test2 && test3 && test4) || (test1 && test5)
|| (test1 && test3 && test6 && test7 && test8);*/
return test1 && test2;
},
// Checks if current page is reply to post page.
isNewPost : function() {
var arr = this._splitURL();
var test1 = arr.slice(2).indexOf("post_no") % 2 == 0;
var test2 = arr.slice(2).indexOf("action");
var test3 = arr[test2 + 1] == "New";
test2 = test2 % 2 == 0;
return test1 && test2 && test3;
},
// ************** PLAYER **************
// Checks if current page is player page.
isPlayer : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "player";
var test2 = arr.slice(2).indexOf("PID") % 2 == 0;
return test1 && test2;
},
// ************** PLAYERS **************
// Checks if current page is players page.
isPlayers : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "players";
var test2 = arr[0] == "" && arr[1] == "players.php";
return test1 || test2;
},
// ************** JUNIORS **************
// Checks if current page is juniors page.
isJuniors : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "juniors";
return test1;
},
// ************** TRANSFERS **************
// Checks if current page is transfers page.
isTransfers : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "transfers";
var test2 = /\/action\/showlast\/?/.test(document.location.href);
return test1 && !test2;
},
// Checks if current page is transfer search page.
isTransferSearch : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "transferSearch";
return test1;
},
// Loads main transfers page.
loadTransfers : function() {
document.location.href = _http('/transfers');
},
// ************** OFFICE **************
// Checks if current page is main office page.
isOffice : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "office";
return test1;
},
// Loads main office page.
loadOffice : function() {
document.location.href = _http('/office');
},
// ************** MATCHES **************
// Checks if current page is matches page.
isMatches : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "matches";
return test1;
},
// Checks if current page is studio page.
isStudio : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "studio";
var test2 = arr.slice(2).indexOf("matchID") % 2 == 0;
return test1 && test2;
},
// Checks if current page is match report/comment page.
isReport : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "comment";
var test2 = arr.slice(2).indexOf("matchID") % 2 == 0;
return test1 && test2;
},
// Checks if current page is match view page.
isMatchView : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "matchview.php";
return test1;
},
// Checks if current page is match video page.
isMatchVideo : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "match_video";
return test1;
},
// Checks if current page is match statistics page.
isMatchStats : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "stats";
var test2 = arr.slice(2).indexOf("matchID") % 2 == 0;
var test3 = arr.slice(2).indexOf("teamID") % 2 == 0;
return test1 && test2 && test3;
},
// ************** HISTORY **************
// Checks if current page is club history page.
isHistory : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "history_team";
var test2 = arr.slice(2).indexOf("teamID") % 2 == 0;
return test1 && test2;
},
// ************** STADIUM **************
// Checks if current page is club stadium page.
isStadium : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "arena";
return test1;
},
// Checks if current page is user`s club stadium page.
isUserStadium : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "arena";
var test2 = arr.length == 2;
var test3 = $(_searcher.stadium.changePrice, document).length > 0;
var test4 = $(_searcher.stadium.construction, document).length > 0;
return test1 && (test2 || (test3 && test4));
},
// Loads user stadium page.
loadUserStadium : function() {
document.location.href = _http('/arena');
},
// ************** TACTICS **************
// Checks if current page is tactic edit page.
isTacticEdit : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "tactedit";
return test1;
},
// ************** ECONOMY **************
// Checks if current page is club economy page.
isEconomy : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "economy";
return test1;
},
// ************** LINE-UP **************
// Checks if current page is line-up page.
isLineup : function() {
var arr = this._splitURL();
var test1 = arr[0] == "" && arr[1] == "lineup";
var test2 = arr.slice(2).indexOf("matchID") % 2 == 0;
var test3 = arr.slice(2).indexOf("squadform") % 2 == 1;
var test4 = arr.length == 4;
return test1 && test2 && (test3 || test4);
}
};
Lipa91 para
kryminator
w obydwu plikach są adresy "http" i prosta próa zmiany na "https" niestety nie pomaga ;)
D@ni para
kryminator
No i nie musisz, tam to tez nie jest idealne, jak grasz arcade w sobote to pokazuje mecz reprezentacyjny, dla mnie istotne jest aby pokazywalo szkolke i to czy gracz gra jeden czy dwa mecze treningowe w tygodniu :)
kryminator para
D@ni
to jeszcze to przegadamy potem, postaram się do najbliższej wersji dodać, razem z estymowaniem talentu juniora
Lipa91 para
kryminator
nową wersję? podmieniłem tylko manifest w wersji, która miałem od dawna.. :)
Wygląda na tę samą, ale... działa.. ¯\_(ツ)_/¯
nie chciałem musieć przeklikiwać wszystkich opcji ze starej wersji... :)
nie chciałem musieć przeklikiwać wszystkich opcji ze starej wersji... :)
kryminator para
Lipa91
nie, źle!
tylko rozpierdol robisz :P
to jest chrome na windows i sposób updatu jest troche dupny, ale
masz to w katalogu jakimśtam i powinieneś zrobić tak:
ściągasz skunk.zip
wypierniczasz ZAWARTOŚĆ katalogu jakiśtam
i wtryniasz tam zawartość archiwum skunk.zip
ewentualne wypierniczanie może być zbędne, w sensie może to usunie opcje skunka zapisane w przeglądarce, ale mam nadzieje ze nie, genralnie trzeba zawartość katalogu ze skunkiem zastąpić zawartoscia nowszej wersji ze skunk.zip
tylko rozpierdol robisz :P
to jest chrome na windows i sposób updatu jest troche dupny, ale
masz to w katalogu jakimśtam i powinieneś zrobić tak:
ściągasz skunk.zip
wypierniczasz ZAWARTOŚĆ katalogu jakiśtam
i wtryniasz tam zawartość archiwum skunk.zip
ewentualne wypierniczanie może być zbędne, w sensie może to usunie opcje skunka zapisane w przeglądarce, ale mam nadzieje ze nie, genralnie trzeba zawartość katalogu ze skunkiem zastąpić zawartoscia nowszej wersji ze skunk.zip
kryminator para
Lipa91
* Google Chrome Windows
1. Ściągnij plik skunk.zip dostępny w linkach powyżej.
2. Rozpakuj skunk.zip do wybranego przez siebie katalogu
3. Otwórz Chrome i przejdź do chrome://extensions.
4. Zaznacz tryb programisty (Developer mode).
5. Kliknij "Wczytaj rozszerzenie bez pakietu..." (Load unpacked extension...).
6. Wskaż katalog do którego rozpakowałeś skunk.zip w punkcie 2.
UWAGA: Chrome nie ukatualni dodatku samoczynnie. Żeby to zrobić należy ściągnąć nowszego skunk.zip i plikami z niego zastąpić pliki gdzie aktualnie jest rozpakowany SkUnk (nie tworzyć nowego katalogu bo to nie będzie zapisanych opcji SkUnk-a) a następnie na stronie chrome://extensions kliknąć "Załaduj ponownie" w sekcji SkUnk-a (powinien po tym podskoczyć numer wersji).
EDIT: to z pierwszego postu, link do najnowszej wersji tez jest zawsze w pierwszym poscie, przynajmniej powinien byc
(editado)
1. Ściągnij plik skunk.zip dostępny w linkach powyżej.
2. Rozpakuj skunk.zip do wybranego przez siebie katalogu
3. Otwórz Chrome i przejdź do chrome://extensions.
4. Zaznacz tryb programisty (Developer mode).
5. Kliknij "Wczytaj rozszerzenie bez pakietu..." (Load unpacked extension...).
6. Wskaż katalog do którego rozpakowałeś skunk.zip w punkcie 2.
UWAGA: Chrome nie ukatualni dodatku samoczynnie. Żeby to zrobić należy ściągnąć nowszego skunk.zip i plikami z niego zastąpić pliki gdzie aktualnie jest rozpakowany SkUnk (nie tworzyć nowego katalogu bo to nie będzie zapisanych opcji SkUnk-a) a następnie na stronie chrome://extensions kliknąć "Załaduj ponownie" w sekcji SkUnk-a (powinien po tym podskoczyć numer wersji).
EDIT: to z pierwszego postu, link do najnowszej wersji tez jest zawsze w pierwszym poscie, przynajmniej powinien byc
(editado)
Lipa91 para
kryminator
a no to nie wiedziałem. Ja ściągnąłem i wciągnąłem drugi raz - miałem 2 wtyczki, nową i starą.. a w nowej ustawienia są defaultowe.
ciekawe czy jakbym podmienił zawartość to nie musiałym zaznaczać od nowa wszystkich ustawień :)
ciekawe czy jakbym podmienił zawartość to nie musiałym zaznaczać od nowa wszystkich ustawień :)
kryminator para
Lipa91
nie chciałem musieć przeklikiwać wszystkich opcji ze starej wersji... :)
nie musisz tego robić tak ze jak teraz masz skunka w katalogu ABC1 to jak jest nowa wersja robisz katalog ABC2 i wczytujesz nowego skunka jako kolejny dodatek, tylko wtryniasz wszystko do katalogu ABC1 i przy pierwszym skunk klikasz jakś ikonkę przeładowania dodatku, opcje się zachowają
nie musisz tego robić tak ze jak teraz masz skunka w katalogu ABC1 to jak jest nowa wersja robisz katalog ABC2 i wczytujesz nowego skunka jako kolejny dodatek, tylko wtryniasz wszystko do katalogu ABC1 i przy pierwszym skunk klikasz jakś ikonkę przeładowania dodatku, opcje się zachowają
mnóstwo treści ale nie mogę znaleźć konkretnej odpowiedzi. Jeśli zainstaluję skunka na firefoxa to będzie działało czy nie? Czy korzystać z innej przeglądarki?
Jeśli z innej to jaką polecacie? Chroma nie lubię i mam do tego jakieś tam swoje uprzedzenia
Jeśli z innej to jaką polecacie? Chroma nie lubię i mam do tego jakieś tam swoje uprzedzenia