~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/media/common/util.js

  • Committer: mattgiuca
  • Date: 2008-06-15 05:08:15 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:770
media/common/util.js: Internet Explorer compatibility.
    Replaced all instances of string [] indexing with .charAt method.
    (String [] indexing as not supported in ECMAScript, only JavaScript).
    This fixes at least the "I Accept" not working bug in IE.
    There may be other instances which need fixing in other modules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
311
311
    if (("path" in obj) && obj.path != null)
312
312
    {
313
313
        var path = urlencode_path(obj.path.toString());
314
 
        if (url.length > 0 && path.length > 0 && path[0] != "/")
 
314
        if (url.length > 0 && path.length > 0 && path.charAt(0) != "/")
315
315
            path = "/" + path;
316
316
        url += path;
317
317
    }
426
426
    {
427
427
        arg = arguments[i];
428
428
        if (arg.length == 0) continue;
429
 
        if (arg[0] == '/')
 
429
        if (arg.charAt(0) == '/')
430
430
            path = arg;
431
431
        else
432
432
        {
433
 
            if (path.length > 0 && path[path.length-1] != '/')
 
433
            if (path.length > 0 && path.charAt(path.length-1) != '/')
434
434
                path += '/';
435
435
            path += arg;
436
436
        }
491
491
function pathlist_to_path(pathlist)
492
492
{
493
493
    ret = path_join.apply(null, pathlist);
494
 
    if (ret[ret.length-1] != '/')
 
494
    if (ret.charAt(ret.length-1) != '/')
495
495
        ret += '/';
496
496
    return ret;
497
497
}