bug 3068 fixed: on Internet Explorer 8, indexOf function is broken.

git-svn-id: http://piwigo.org/svn/branches/2.6@28038 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2014-04-01 13:09:30 +00:00
parent a6820e70bd
commit 734fef130a
2 changed files with 25 additions and 2 deletions

View File

@@ -8,6 +8,29 @@ function str_repeat(i, m) {
return o.join('');
}
if (!Array.prototype.indexOf)
{
Array.prototype.indexOf = function(elt /*, from*/)
{
var len = this.length;
var from = Number(arguments[1]) || 0;
from = (from < 0)
? Math.ceil(from)
: Math.floor(from);
if (from < 0)
from += len;
for (; from < len; from++)
{
if (from in this &&
this[from] === elt)
return from;
}
return -1;
};
}
function sprintf() {
var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = '';
while (f) {

View File

@@ -30,8 +30,8 @@ var protectedUsers = [{$protected_users}];
var guestUser = {$guest_user};
var truefalse = {
true:"{'Yes'|translate}",
false:"{'No'|translate}",
'true':"{'Yes'|translate}",
'false':"{'No'|translate}",
};
{/footer_script}