~canonical-sysadmins/wordpress/3.9.x

« back to all changes in this revision

Viewing changes to wp-admin/js/wp-gears.dev.js

  • Committer: Chris Jones
  • Date: 2010-01-19 13:17:33 UTC
  • Revision ID: cmsj@tenshu.net-20100119131733-rf31jv9k1v0xzo2h
[CJ] Import wordpress 2.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        },
29
29
 
30
30
        storeName : function() {
31
 
                var name = window.location.protocol + window.location.host;
 
31
                var name, host = window.location.host;
32
32
 
33
 
                name = name.replace(/[\/\\:*"?<>|;,]+/g, '_'); // gears beta doesn't allow certain chars in the store name
 
33
                if ( host.match(/[^a-z0-9._-]/i) )
 
34
                        host = encodeURIComponent(host);
 
35
                
 
36
                name = window.location.protocol + host;
 
37
                name = name.replace(/[^a-z0-9._-]+/gi, '_');
34
38
                name = 'wp_' + name.substring(0, 60); // max length of name is 64 chars
35
39
 
36
40
                return name;