WordPress.org

Make WordPress Core

Changeset 4970


Ignore:
Timestamp:
03/06/2007 05:35:01 PM (11 years ago)
Author:
ryan
Message:

JS localization from mdawaffe. fixes #3913

Location:
trunk
Files:
2 edited
5 moved

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/cat.js

    r4969 r4970  
    1 <?php
    2 require_once('../wp-config.php');
    3 cache_javascript_headers();
    4 ?>
    51addLoadEvent(function(){catList=new listMan('categorychecklist');catList.ajaxRespEl='jaxcat';catList.topAdder=1;catList.alt=0;catList.showLink=0;});
    62addLoadEvent(newCatAddIn);
     
    95    if ( !jaxcat )
    106        return false;
    11     Element.update(jaxcat,'<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="<?php echo js_escape(__('Add')); ?>"/><span id="howto"><?php echo js_escape(__('Separate multiple categories with commas.')); ?></span></span>');
     7    Element.update(jaxcat,'<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="' + catL10n.add + '"/><span id="howto">' + catL10n.how + '</span></span>');
    128    $('newcat').onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','jaxcat');", e); };
    139    $('catadd').onclick = function() { catList.ajaxAdder('category', 'jaxcat'); };
  • trunk/wp-admin/dbx-admin-key.js

    r4969 r4970  
    1 <?php
    2 require_once('admin.php');
    3 cache_javascript_headers();
    4 
    5 switch ( $_GET['pagenow'] ) :
    6     case 'post.php' :
    7     case 'post-new.php' :
    8         $man = 'postmeta';
    9         break;
    10     case 'page.php' :
    11     case 'page-new.php' :
    12         $man = 'pagemeta';
    13         break;
    14     case 'link.php' :
    15         $man = 'linkmeta';
    16         break;
    17     default:
    18         exit;
    19         break;
    20 endswitch;
    21 ?>
    22 addLoadEvent( function() {var manager = new dbxManager('<?php echo $man; ?>');} );
     1addLoadEvent( function() {var manager = new dbxManager( dbxL10n.mananger );} );
    232
    243addLoadEvent( function()
     
    276    var meta = new dbxGroup(
    287        'grabit',       // container ID [/-_a-zA-Z0-9/]
    29         'vertical',     // orientation ['vertical'|'horizontal']
     8        'vertical',         // orientation ['vertical'|'horizontal']
    309        '10',           // drag threshold ['n' pixels]
    3110        'no',           // restrict drag movement to container axis ['yes'|'no']
     
    3312        'yes',          // include open/close toggle buttons ['yes'|'no']
    3413        'closed',       // default state ['open'|'closed']
    35         '<?php echo js_escape(__('open')); ?>',         // word for "open", as in "open this box"
    36         '<?php echo js_escape(__('close')); ?>',        // word for "close", as in "close this box"
    37         '<?php echo js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
    38         '<?php echo js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
    39         '<?php echo js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
    40         '<?php echo js_escape(__(', or press the enter key to %toggle% it')); ?>',  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
     14        dbxL10n.open,       // word for "open", as in "open this box"
     15        dbxL10n.close,      // word for "close", as in "close this box"
     16        dbxL10n.moveMouse,  // sentence for "move this box" by mouse
     17        dbxL10n.toggleMouse,    // pattern-match sentence for "(open|close) this box" by mouse
     18        dbxL10n.moveKey,    // sentence for "move this box" by keyboard
     19        dbxL10n.toggleKey,  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
    4120        '%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
    4221        );
     
    5130
    5231    var advanced = new dbxGroup(
    53         'advancedstuff',        // container ID [/-_a-zA-Z0-9/]
    54         'vertical',         // orientation ['vertical'|'horizontal']
    55         '10',           // drag threshold ['n' pixels]
     32        'advancedstuff',
     33        'vertical',
     34        '10',
    5635        'yes',          // restrict drag movement to container axis ['yes'|'no']
    57         '10',           // animate re-ordering [frames per transition, or '0' for no effect]
    58         'yes',          // include open/close toggle buttons ['yes'|'no']
    59         'closed',       // default state ['open'|'closed']
    60         '<?php echo js_escape(__('open')); ?>',         // word for "open", as in "open this box"
    61         '<?php echo js_escape(__('close')); ?>',        // word for "close", as in "close this box"
    62         '<?php echo js_escape(__('click-down and drag to move this box')); ?>', // sentence for "move this box" by mouse
    63         '<?php echo js_escape(__('click to %toggle% this box')); ?>', // pattern-match sentence for "(open|close) this box" by mouse
    64         '<?php echo js_escape(__('use the arrow keys to move this box')); ?>', // sentence for "move this box" by keyboard
    65         '<?php echo js_escape(__(', or press the enter key to %toggle% it')); ?>',  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
     36        '10',
     37        'yes',
     38        'closed',
     39        dbxL10n.open,
     40        dbxL10n.close,
     41        dbxL10n.moveMouse,
     42        dbxL10n.toggleMouse,
     43        dbxL10n.moveKey,
     44        dbxL10n.toggleKey,
    6645        '%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
    6746        );
  • trunk/wp-admin/upload.js

    r4969 r4970  
    1 <?php require_once('admin.php'); cache_javascript_headers(); ?>
    21addLoadEvent( function() {
    32    theFileList = {
     
    7069                params.ID = '';
    7170                params.action = '';
    72                 h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
    73             } else {
    74                 h += "<a href='#' onclick='return theFileList.cancelView();'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')) ?></a>";
    75             }
     71                h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "'";
     72            } else {
     73                h += "<a href='#' onclick='return theFileList.cancelView();'";
     74            }
     75            h += " title='" + this.browseTitle + "' class='back'>" + this.back + "</a>";
    7676            h += "<div id='file-title'>"
    7777            if ( 0 == this.currentImage.isImage )
    78                 h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
     78                h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>" + this.currentImage.title + "</a></h2>";
    7979            else
    8080                h += "<h2>" + this.currentImage.title + "</h2>";
    8181            h += " &#8212; <span>";
    82             h += "<a href='#' onclick='return theFileList.editView(" + id + ");'><?php echo attribute_escape(__('Edit')); ?></a>"
     82            h += "<a href='#' onclick='return theFileList.editView(" + id + ");'>" + this.edit + "</a>"
    8383            h += "</span>";
    8484            h += '</div>'
    8585            h += "<div id='upload-file-view' class='alignleft'>";
    8686            if ( 1 == this.currentImage.isImage ) {
    87                 h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>";
     87                h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>";
    8888                h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
    8989                h += "</a>";
     
    9999                checked = 'display-full';
    100100                if ( this.currentImage.thumb ) {
    101                     display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> <?php echo attribute_escape(__('Thumbnail')); ?></label><br />");
     101                    display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> " + this.thumb + "</label><br />");
    102102                    checked = 'display-thumb';
    103103                }
    104                 display.push("<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php echo attribute_escape(__('Full size')); ?></label>");
     104                display.push("<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> " + this.full + "</label>");
    105105            } else if ( this.currentImage.thumb ) {
    106                 display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> <?php echo attribute_escape(__('Icon')); ?></label>");
     106                display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> " + this.icon + "</label>");
    107107            }
    108108            if ( display.length ) {
    109                 display.push("<br /><label for='display-title'><input type='radio' name='display' id='display-title' value='title' /> <?php echo attribute_escape(__('Title')); ?></label>");
    110                 h += "<tr><th style='padding-bottom:.5em'><?php echo attribute_escape(__('Show:')); ?></th><td style='padding-bottom:.5em'>";
     109                display.push("<br /><label for='display-title'><input type='radio' name='display' id='display-title' value='title' /> " + this.title + "</label>");
     110                h += "<tr><th style='padding-bottom:.5em'>" + this.show + "</th><td style='padding-bottom:.5em'>";
    111111                $A(display).each( function(i) { h += i; } );
    112112                h += "</td></tr>";
    113113            }
    114114
    115             h += "<tr><th><?php echo attribute_escape(__('Link to:')); ?></th><td>";
    116             h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> <?php echo attribute_escape(__('File')); ?></label><br />";
    117             h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> <?php echo attribute_escape(__('Page')); ?></label><br />";
    118             h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> <?php echo attribute_escape(__('None')); ?></label>";
     115            h += "<tr><th>" + this.link + "</th><td>";
     116            h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> " + this.file + "</label><br />";
     117            h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> " + this.page + "</label><br />";
     118            h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> " + this.none + "</label>";
    119119            h += "</td></tr>";
    120120
    121121            h += "<tr><td colspan='2'><p class='submit'>";
    122             h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='<?php echo attribute_escape(__('Send to editor &raquo;')); ?>' />";
     122            h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='" + this.editorText + "' />";
    123123            h += "</p></td></tr></table>";
    124124            h += "</form>";
     
    148148                params.ID = '';
    149149                params.action = '';
    150                 h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
    151             } else {
    152                 h += "<a href='#' onclick='return theFileList.cancelView();'  title='<?php echo attribute_escape(__('Browse your files')); ?>' class='back'><?php echo attribute_escape(__('&laquo; Back')); ?></a>";
    153             }
     150                h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "'";
     151            } else {
     152                h += "<a href='#' onclick='return theFileList.cancelView();'";
     153            }
     154            h += " title='" + this.browseTitle + "' class='back'>" + this.back + "</a>";
    154155            h += "<div id='file-title'>"
    155156            if ( 0 == this.currentImage.isImage )
    156                 h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo attribute_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>";
     157                h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>" + this.currentImage.title + "</a></h2>";
    157158            else
    158159                h += "<h2>" + this.currentImage.title + "</h2>";
    159160            h += " &#8212; <span>";
    160             h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'><?php echo attribute_escape(__('Insert')); ?></a>"
     161            h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'>" + this.insert + "</a>";
    161162            h += "</span>";
    162163            h += '</div>'
    163164            h += "<div id='upload-file-view' class='alignleft'>";
    164165            if ( 1 == this.currentImage.isImage ) {
    165                 h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo wp_specialchars(__('Direct link to file')); ?>'>";
     166                h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>";
    166167                h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
    167168                h += "</a>";
     
    171172
    172173
    173             h += "<table><col /><col class='widefat' /><tr>"
    174             h += "<th scope='row'><label for='url'><?php echo attribute_escape(__('URL')); ?></label></th>";
     174            h += "<table><col /><col class='widefat' /><tr>";
     175            h += "<th scope='row'><label for='url'>" + this.urlText + "</label></th>";
    175176            h += "<td><input type='text' id='url' class='readonly' value='" + this.currentImage.srcBase + this.currentImage.src + "' readonly='readonly' /></td>";
    176177            h += "</tr><tr>";
    177             h += "<th scope='row'><label for='post_title'><?php echo attribute_escape(__('Title')); ?></label></th>";
     178            h += "<th scope='row'><label for='post_title'>" + this.title + "</label></th>";
    178179            h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>";
    179180            h += "</tr><tr>";
    180             h += "<th scope='row'><label for='post_content'><?php echo attribute_escape(__('Description')); ?></label></th>";
     181            h += "<th scope='row'><label for='post_content'>" + this.desc + "</label></th>";
    181182            h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>";
    182             h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='<?php echo attribute_escape(__('Delete File')); ?>' onclick='theFileList.deleteFile(" + id + ");' />";
     183            h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='" + this.deleteText + "' onclick='theFileList.deleteFile(" + id + ");' />";
    183184            h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />";
    184185            h += "<input type='hidden' name='action' id='action-value' value='save' />";
    185186            h += "<input type='hidden' name='ID' value='" + id + "' />";
    186187            h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";
    187             h += "<div class='submit'><input type='submit' value='<?php echo attribute_escape(__('Save &raquo;')); ?>' /></div>";
     188            h += "<div class='submit'><input type='submit' value='" + this.saveText + "' /></div>";
    188189            h += "</td></tr></table></form>";
    189190
     
    258259
    259260        deleteFile: function(id) {
    260             if ( confirm("<?php printf(js_escape(__("Are you sure you want to delete the file '%s'?\nClick ok to delete or cancel to go back.")), '" + this.currentImage.title + "'); ?>") ) {
     261            if ( confirm( this.confirmText.replace(/%title%/g, this.currentImage.title) ) ) {
    261262                $('action-value').value = 'delete';
    262263                $('upload-file').submit();
     
    267268
    268269    };
     270    Object.extend( theFileList, uploadL10n );
    269271    theFileList.initializeVars();
    270272    theFileList.initializeLinks();
  • trunk/wp-includes/js/autosave.js

    r4969 r4970  
    1 <?php @require_once('../../wp-config.php');
    2 cache_javascript_headers();
    3 ?>
    41var autosaveLast = '';
    52var autosavePeriodical;
     
    96    autosaveLast = form.post_title.value+form.content.value;
    107    // Keep autosave_interval in sync with edit_post().
    11     autosavePeriodical = new PeriodicalExecuter(autosave, <?php echo apply_filters('autosave_interval', '120'); ?>);
     8    autosavePeriodical = new PeriodicalExecuter(autosave, autosaveL10n.autosaveInterval);
    129    //Disable autosave after the form has been submitted
    1310    if(form.addEventListener) {
     
    4138
    4239    if(isNaN(res)) {
    43         message = "<?php echo js_escape(__('Error: ')); ?>" + response;
     40        message = autosaveL10n.errorText.replace(/%response%/g, response);
    4441    } else {
    45         message = "<?php echo js_escape(__('Saved at ')); ?>" + autosave_cur_time();
     42        message = autosaveL10n.saveText.replace(/%time%/g, autosave_cur_time());
    4643        $('post_ID').name = "post_ID";
    4744        $('post_ID').value = res;
     
    5350        nonceAjax.setVar("cookie", document.cookie);
    5451        nonceAjax.setVar("post_type", $('post_type').value);
    55         nonceAjax.requestFile = "<?php echo get_option('siteurl'); ?>/wp-admin/admin-ajax.php";
     52        nonceAjax.requestFile = autosaveL10n.requestFile;
    5653        nonceAjax.onCompletion = autosave_update_nonce;
    5754        nonceAjax.method = "POST";
     
    6461
    6562function autosave_loading() {
    66     $('autosave').innerHTML = "<?php echo js_escape(__('Saving Draft...')); ?>";
     63    $('autosave').innerHTML = autosaveL10n.savingText;
    6764}
    6865
     
    7370
    7471    if(isNaN(res)) {
    75         message = "<?php echo js_escape(__('Error: ')); ?>" + response;
     72        message = autosaveL10n.errorText.replace(/%response%/g, response);
    7673    } else {
    77         message = "<?php echo js_escape(__('Saved at ')); ?>" + autosave_cur_time() + ".";
     74        message = autosaveL10n.saveText.replace(/%time%/g, autosave_cur_time());
    7875    }
    7976    $('autosave').innerHTML = message;
     
    149146    }
    150147
    151     autosaveAjax.requestFile = "<?php echo get_option('siteurl'); ?>/wp-admin/admin-ajax.php";
     148    autosaveAjax.requestFile = autosaveL10n.requestFile;
    152149    autosaveAjax.method = "POST";
    153150    autosaveAjax.element = null;
  • trunk/wp-includes/js/list-manipulation.js

    r4968 r4970  
    99        obj=theList;
    1010    if ( !message )
    11         message = obj.delText.replace(/%/g, what);
     11        message = obj.delText.replace(/%thing%/g, what);
    1212    if( confirm(message) )
    1313        return obj.ajaxDelete( what, id );
     
    3737    formStore: null,
    3838
    39     jumpText: 'Jump to new item',
    40     delText: 'Are you sure you want to delete this %s?',
     39    jumpText: '', // We get these from listManL10n
     40    delText: '',
    4141
    4242    initialize: function(theListId) {
  • trunk/wp-includes/js/wp-ajax.js

    r4969 r4970  
    1 <?php @require_once('../../wp-config.php'); cache_javascript_headers(); ?>
    21var WPAjax = Class.create();
    32Object.extend(WPAjax.prototype, Ajax.Request.prototype);
     
    54    WPComplete: false, // onComplete function
    65    WPError: false, // onWPError function
     6    defaultUrl: '', // We get these from WPAjaxL10n
     7    permText: '',
     8    strangeText: '',
     9    whoaText: '',
     10
    711    initialize: function(url, responseEl) {
    812        var tempObj = this;
     
    2024            }
    2125        });
    22         this.url = url ? url : '<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php';
     26        this.url = url ? url : this.defaultUrl;
    2327        this.getResponseElement(responseEl);
    2428    },
     
    5357        var r = parseInt(r,10);
    5458        if ( -1 == r ) {
    55             Element.update(this.myResponseElement,"<div class='error'><p><?php _e("You don't have permission to do that."); ?></p></div>");
     59            Element.update(this.myResponseElement,"<div class='error'><p>" + this.permText + "</p></div>");
    5660            return false;
    5761        } else if ( 0 == r ) {
    58             Element.update(this.myResponseElement,"<div class='error'><p><?php _e("Something strange happened.  Try refreshing the page."); ?></p></div>");
     62            Element.update(this.myResponseElement,"<div class='error'><p>" + this.strangeText + "</p></div>");
    5963            return false;
    6064        }
     
    7276});
    7377
     78Event.observe( window, 'load', function() { Object.extend(WPAjax.prototype, WPAjaxL10n); }, false )
     79
    7480Ajax.activeSendCount = 0;
    7581Ajax.Responders.register( {
     
    8086        wpBeforeUnload = window.onbeforeunload;
    8187        window.onbeforeunload = function() {
    82             return "<?php js_escape(__("Slow down, I'm still sending your data!")); ?>";
     88            return WPAjax.whoaText;
    8389        }
    8490    },
  • trunk/wp-includes/script-loader.php

    r4968 r4970  
    2020        $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070225' );
    2121        $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.0-0');
    22         $this->add( 'autosave', '/wp-includes/js/autosave-js.php', array('prototype', 'sack'), '20070116');
    23         $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax-js.php', array('prototype'), '20070118');
    24         $this->add( 'listman', '/wp-includes/js/list-manipulation.js', array('wp-ajax', 'fat'), '20070305');
     22        $this->add( 'autosave', '/wp-includes/js/autosave.js', array('prototype', 'sack'), '20070306');
     23        $this->localize( 'autosave', 'autosaveL10n', array(
     24            'autosaveInterval' => apply_filters('autosave_interval', '120'),
     25            'errorText' => __('Error: %response%'),
     26            'saveText' => __('Saved at %time%.'),
     27            'requestFile' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
     28            'savingText' => __('Saving Draft...')
     29        ) );
     30        $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax.js', array('prototype'), '20070306');
     31        $this->localize( 'wp-ajax', 'WPAjaxL10n', array(
     32            'defaultUrl' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php',
     33            'permText' => __("You don't have permission to do that."),
     34            'strangeText' => __("Something strange happened.  Try refreshing the page."),
     35            'whoaText' => __("Slow down, I'm still sending your data!")
     36        ) );
     37        $this->add( 'listman', '/wp-includes/js/list-manipulation.js', array('wp-ajax', 'fat'), '20070306');
    2538        $this->localize( 'listman', 'listManL10n', array(
    2639            'jumpText' => __('Jump to new item'),
    27             'delText' => __('Are you sure you want to delete this %s?')
     40            'delText' => __('Are you sure you want to delete this %thing%?')
    2841        ) );
    2942        $this->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.7.0');
     
    3851        $this->add( 'interface', '/wp-includes/js/jquery/interface.js', array('jquery'), '1.1.1');
    3952        if ( is_admin() ) {
    40             $this->add( 'dbx-admin-key', '/wp-admin/dbx-admin-key-js.php', array('dbx'), '3651' );
    41             $this->add( 'ajaxcat', '/wp-admin/cat-js.php', array('listman'), '20070118' );
     53            global $pagenow;
     54            $man = false;
     55            switch ( $pagenow ) :
     56            case 'post.php' :
     57            case 'post-new.php' :
     58                $man = 'postmeta';
     59                break;
     60            case 'page.php' :
     61            case 'page-new.php' :
     62                $man = 'pagemeta';
     63                break;
     64            case 'link.php' :
     65                $man = 'linkmeta';
     66                break;
     67            endswitch;
     68            if ( $man ) {
     69                $this->add( 'dbx-admin-key', '/wp-admin/dbx-admin-key.js', array('dbx'), '20070306' );
     70                $this->localize( 'dbx-admin-key', 'dbxL10n', array(
     71                    'manager' => $man,
     72                    'open' => __('open'),
     73                    'close' => __('close'),
     74                    'moveMouse' => __('click-down and drag to move this box'),
     75                    'toggleMouse' => __('click to %toggle% this box'),
     76                    'moveKey' => __('use the arrow keys to move this box'),
     77                    'toggleKey' => __(', or press the enter key to %toggle% it'),
     78                ) );
     79            }
     80            $this->add( 'ajaxcat', '/wp-admin/cat.js', array('listman'), '20070306' );
     81            $this->localize( 'ajaxcat', 'catL10n', array(
     82                'add' => attribute_escape(__('Add')),
     83                'how' => __('Separate multiple categories with commas.')
     84            ) );
    4285            $this->add( 'admin-categories', '/wp-admin/categories.js', array('listman'), '3684' );
    4386            $this->add( 'admin-custom-fields', '/wp-admin/custom-fields.js', array('listman'), '3733' );
     
    4588            $this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '4583' );
    4689            $this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' );
    47             $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '20070118' );
     90            $this->add( 'upload', '/wp-admin/upload.js', array('prototype'), '20070306' );
     91            $this->localize( 'upload', 'uploadL10n', array(
     92                'browseTitle' => attribute_escape(__('Browse your files')),
     93                'back' => __('&laquo; Back'),
     94                'directTitle' => attribute_escape(__('Direct link to file')),
     95                'edit' => __('Edit'),
     96                'thumb' => __('Thumbnail'),
     97                'full' => __('Full size'),
     98                'icon' => __('Icon'),
     99                'title' => __('Title'),
     100                'show' => __('Show:'),
     101                'link' => __('Link to:'),
     102                'file' => __('File'),
     103                'page' => __('Page'),
     104                'none' => __('None'),
     105                'editorText' => attribute_escape(__('Send to editor &raquo;')),
     106                'insert' => __('Insert'),
     107                'urlText' => __('URL'),
     108                'desc' => __('Description'),
     109                'deleteText' => attribute_escape(__('Delete File')),
     110                'saveText' => attribute_escape(__('Save &raquo;')),
     111                'confirmText' => __("Are you sure you want to delete the file '%title%'?\nClick ok to delete or cancel to go back.")
     112            ) );
    48113        }
    49114    }
Note: See TracChangeset for help on using the changeset viewer.