/**
  * Enqueue a script that fixes a bug where pages moved to a different menu
  * would not be highlighted properly when the user visits them.
  */
 public function enqueue_menu_fix_script()
 {
     wp_enqueue_auto_versioned_script('ame-menu-fix', plugins_url('js/menu-highlight-fix.js', $this->plugin_file), array('jquery'), true);
 }
示例#2
0
 public function enqueueScripts()
 {
     wp_register_auto_versioned_script('knockout', plugins_url('js/knockout-2.2.1.js', WS_ADMIN_BAR_EDITOR_FILE));
     wp_register_auto_versioned_script('jquery-json', plugins_url('js/jquery.json-2.4.js', WS_ADMIN_BAR_EDITOR_FILE), array('jquery'));
     wp_register_auto_versioned_script('jquery-ajax-form', plugins_url('js/jquery.form.js', WS_ADMIN_BAR_EDITOR_FILE), array('jquery'));
     wp_register_auto_versioned_script('jquery-qtip2', plugins_url('js/qtip/jquery.qtip.min.js', WS_ADMIN_BAR_EDITOR_FILE), array('jquery'));
     wp_register_auto_versioned_script('mjs-jquery-nested-sortable', plugins_url('js/jquery.mjs.nestedSortable.js', WS_ADMIN_BAR_EDITOR_FILE), array('jquery-ui-sortable'));
     wp_register_auto_versioned_script('ws-abe-nested-sortable', plugins_url('js/knockout-nested-sortable.js', WS_ADMIN_BAR_EDITOR_FILE), array('knockout', 'mjs-jquery-nested-sortable'));
     wp_register_auto_versioned_script('ws-abe-node-view-model', plugins_url('js/node-view-model.js', WS_ADMIN_BAR_EDITOR_FILE), array('knockout', 'jquery'));
     wp_register_auto_versioned_script('ws-abe-settings-script', plugins_url('js/settings-page.js', WS_ADMIN_BAR_EDITOR_FILE), array('jquery'));
     if ($this->isEditorPage()) {
         wp_enqueue_auto_versioned_script('ws-admin-bar-editor', plugins_url('js/admin-bar-editor.js', WS_ADMIN_BAR_EDITOR_FILE), array('jquery', 'knockout', 'jquery-json', 'jquery-ajax-form', 'jquery-ui-dialog', 'mjs-jquery-nested-sortable', 'ws-abe-nested-sortable', 'ws-abe-node-view-model', 'jquery-qtip2'));
     } else {
         if ($this->isSettingsPage()) {
             wp_enqueue_script('ws-abe-settings-script');
         }
     }
     if ($this->isDemoMode()) {
         wp_register_auto_versioned_script('ws-abe-jquery-cookie', plugins_url('js/jquery-cookie/jquery.cookie.js', WS_ADMIN_BAR_EDITOR_FILE));
         wp_enqueue_auto_versioned_script('ws-abe-demo-helper', plugins_url('js/demo.js', WS_ADMIN_BAR_EDITOR_FILE), array('ws-abe-jquery-cookie'));
     }
 }