@@ -15,245 +15,245 @@ |
||
| 15 | 15 | class EspressoLegacyAdminAssetManager extends AssetManager |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - const JS_HANDLE_EE_ADMIN = 'ee_admin_js'; |
|
| 18 | + const JS_HANDLE_EE_ADMIN = 'ee_admin_js'; |
|
| 19 | 19 | |
| 20 | - const JS_HANDLE_EE_AJAX_TABLE_SORTING = 'espresso_ajax_table_sorting'; |
|
| 20 | + const JS_HANDLE_EE_AJAX_TABLE_SORTING = 'espresso_ajax_table_sorting'; |
|
| 21 | 21 | |
| 22 | - const JS_HANDLE_EE_DATEPICKER = 'ee-datepicker'; |
|
| 22 | + const JS_HANDLE_EE_DATEPICKER = 'ee-datepicker'; |
|
| 23 | 23 | |
| 24 | - const JS_HANDLE_EE_DIALOG = 'ee-dialog'; |
|
| 24 | + const JS_HANDLE_EE_DIALOG = 'ee-dialog'; |
|
| 25 | 25 | |
| 26 | - const JS_HANDLE_EE_HELP_TOUR = 'ee-help-tour'; |
|
| 26 | + const JS_HANDLE_EE_HELP_TOUR = 'ee-help-tour'; |
|
| 27 | 27 | |
| 28 | - const JS_HANDLE_EE_INJECT_WP = 'ee-inject-wp'; |
|
| 28 | + const JS_HANDLE_EE_INJECT_WP = 'ee-inject-wp'; |
|
| 29 | 29 | |
| 30 | - const JS_HANDLE_GOOGLE_CHARTS = 'google-charts'; |
|
| 30 | + const JS_HANDLE_GOOGLE_CHARTS = 'google-charts'; |
|
| 31 | 31 | |
| 32 | - const JS_HANDLE_MOMENT = 'ee-moment'; |
|
| 32 | + const JS_HANDLE_MOMENT = 'ee-moment'; |
|
| 33 | 33 | |
| 34 | - const JS_HANDLE_MOMENT_CORE = 'ee-moment-core'; |
|
| 34 | + const JS_HANDLE_MOMENT_CORE = 'ee-moment-core'; |
|
| 35 | 35 | |
| 36 | - const JS_HANDLE_PARSE_URI = 'ee-parse-uri'; |
|
| 36 | + const JS_HANDLE_PARSE_URI = 'ee-parse-uri'; |
|
| 37 | 37 | |
| 38 | - const JS_HANDLE_EE_TEXT_LINKS = 'ee-text-links'; |
|
| 38 | + const JS_HANDLE_EE_TEXT_LINKS = 'ee-text-links'; |
|
| 39 | 39 | |
| 40 | - const JS_HANDLE_EE_SERIALIZE_FULL_ARRAY = 'ee-serialize-full-array'; |
|
| 40 | + const JS_HANDLE_EE_SERIALIZE_FULL_ARRAY = 'ee-serialize-full-array'; |
|
| 41 | 41 | |
| 42 | - const JS_HANDLE_JOYRIDE_MODERNIZR = 'joyride-modernizr'; |
|
| 42 | + const JS_HANDLE_JOYRIDE_MODERNIZR = 'joyride-modernizr'; |
|
| 43 | 43 | |
| 44 | - const JS_HANDLE_JQUERY_JOYRIDE = 'jquery-joyride'; |
|
| 44 | + const JS_HANDLE_JQUERY_JOYRIDE = 'jquery-joyride'; |
|
| 45 | 45 | |
| 46 | - const CSS_HANDLE_EE_ADMIN = 'ee-admin-css'; |
|
| 46 | + const CSS_HANDLE_EE_ADMIN = 'ee-admin-css'; |
|
| 47 | 47 | |
| 48 | - const CSS_HANDLE_EE_JOYRIDE = 'ee-joyride-css'; |
|
| 49 | - |
|
| 50 | - const CSS_HANDLE_EE_TEXT_LINKS = 'ee-text-links'; |
|
| 48 | + const CSS_HANDLE_EE_JOYRIDE = 'ee-joyride-css'; |
|
| 49 | + |
|
| 50 | + const CSS_HANDLE_EE_TEXT_LINKS = 'ee-text-links'; |
|
| 51 | 51 | |
| 52 | - const CSS_HANDLE_EE_UI_THEME = 'espresso-ui-theme'; |
|
| 53 | - |
|
| 54 | - const CSS_HANDLE_JOYRIDE = 'joyride-css'; |
|
| 55 | - |
|
| 56 | - |
|
| 57 | - /** |
|
| 58 | - * @inheritDoc |
|
| 59 | - */ |
|
| 60 | - public function addAssets() |
|
| 61 | - { |
|
| 62 | - $joyride = filter_var(apply_filters('FHEE_load_joyride', false), FILTER_VALIDATE_BOOLEAN); |
|
| 63 | - $this->registerJavascript($joyride); |
|
| 64 | - $this->registerStyleSheets($joyride); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - |
|
| 68 | - /** |
|
| 69 | - * Register javascript assets |
|
| 70 | - * |
|
| 71 | - * @param bool $joyride |
|
| 72 | - */ |
|
| 73 | - private function registerJavascript($joyride = false) |
|
| 74 | - { |
|
| 75 | - $this->addJavascript( |
|
| 76 | - EspressoLegacyAdminAssetManager::JS_HANDLE_EE_DIALOG, |
|
| 77 | - EE_ADMIN_URL . 'assets/ee-dialog-helper.js', |
|
| 78 | - [ |
|
| 79 | - JqueryAssetManager::JS_HANDLE_JQUERY, |
|
| 80 | - JqueryAssetManager::JS_HANDLE_JQUERY_UI_DRAGGABLE, |
|
| 81 | - ] |
|
| 82 | - ); |
|
| 83 | - |
|
| 84 | - $this->addJavascript( |
|
| 85 | - EspressoLegacyAdminAssetManager::JS_HANDLE_EE_ADMIN, |
|
| 86 | - EE_ADMIN_URL . 'assets/ee-admin-page.js', |
|
| 87 | - [ |
|
| 88 | - CoreAssetManager::JS_HANDLE_CORE, |
|
| 89 | - EspressoLegacyAdminAssetManager::JS_HANDLE_PARSE_URI, |
|
| 90 | - EspressoLegacyAdminAssetManager::JS_HANDLE_EE_DIALOG, |
|
| 91 | - ] |
|
| 92 | - ); |
|
| 93 | - |
|
| 94 | - // script for sorting tables |
|
| 95 | - $this->addJavascript( |
|
| 96 | - EspressoLegacyAdminAssetManager::JS_HANDLE_EE_AJAX_TABLE_SORTING, |
|
| 97 | - EE_ADMIN_URL . 'assets/espresso_ajax_table_sorting.js', |
|
| 98 | - [ |
|
| 99 | - EspressoLegacyAdminAssetManager::JS_HANDLE_EE_ADMIN, |
|
| 100 | - JqueryAssetManager::JS_HANDLE_JQUERY_UI_SORTABLE, |
|
| 101 | - ] |
|
| 102 | - )->setEnqueueImmediately(); |
|
| 103 | - |
|
| 104 | - // script for parsing uri's |
|
| 105 | - $this->addJavascript( |
|
| 106 | - EspressoLegacyAdminAssetManager::JS_HANDLE_PARSE_URI, |
|
| 107 | - EE_GLOBAL_ASSETS_URL . 'scripts/parseuri.js' |
|
| 108 | - ); |
|
| 109 | - |
|
| 110 | - // and parsing associative serialized form elements |
|
| 111 | - $this->addJavascript( |
|
| 112 | - EspressoLegacyAdminAssetManager::JS_HANDLE_EE_SERIALIZE_FULL_ARRAY, |
|
| 113 | - EE_GLOBAL_ASSETS_URL . 'scripts/jquery.serializefullarray.js', |
|
| 114 | - [JqueryAssetManager::JS_HANDLE_JQUERY] |
|
| 115 | - |
|
| 116 | - ); |
|
| 117 | - |
|
| 118 | - // helpers scripts |
|
| 119 | - $this->addJavascript( |
|
| 120 | - EspressoLegacyAdminAssetManager::JS_HANDLE_EE_TEXT_LINKS, |
|
| 121 | - EE_PLUGIN_DIR_URL . 'core/helpers/assets/ee_text_list_helper.js', |
|
| 122 | - [JqueryAssetManager::JS_HANDLE_JQUERY] |
|
| 123 | - ); |
|
| 124 | - |
|
| 125 | - $this->addJavascript( |
|
| 126 | - EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT_CORE, |
|
| 127 | - EE_THIRD_PARTY_URL . 'moment/moment-with-locales.min.js' |
|
| 128 | - ); |
|
| 129 | - |
|
| 130 | - $this->addJavascript( |
|
| 131 | - EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT, |
|
| 132 | - EE_THIRD_PARTY_URL . 'moment/moment-timezone-with-data.min.js', |
|
| 133 | - [EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT_CORE] |
|
| 134 | - ); |
|
| 135 | - |
|
| 136 | - $this->addJavascript( |
|
| 137 | - EspressoLegacyAdminAssetManager::JS_HANDLE_EE_DATEPICKER, |
|
| 138 | - EE_ADMIN_URL . 'assets/ee-datepicker.js', |
|
| 139 | - [ |
|
| 140 | - JqueryAssetManager::JS_HANDLE_JQUERY_UI_TIMEPICKER_ADDON, |
|
| 141 | - EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT, |
|
| 142 | - ] |
|
| 143 | - ); |
|
| 144 | - |
|
| 145 | - // google charts |
|
| 146 | - $this->addJavascript( |
|
| 147 | - EspressoLegacyAdminAssetManager::JS_HANDLE_GOOGLE_CHARTS, |
|
| 148 | - 'https://www.gstatic.com/charts/loader.js' |
|
| 149 | - ); |
|
| 150 | - |
|
| 151 | - // this javascript is loaded on every admin page to catch any injections ee needs to add to wp run js. |
|
| 152 | - // Note: the intention of this script is to only do TARGETED injections. |
|
| 153 | - //ie: only injecting on certain script calls. |
|
| 154 | - $this->addJavascript( |
|
| 155 | - EspressoLegacyAdminAssetManager::JS_HANDLE_EE_INJECT_WP, |
|
| 156 | - EE_ADMIN_URL . 'assets/ee-cpt-wp-injects.js', |
|
| 157 | - [JqueryAssetManager::JS_HANDLE_JQUERY] |
|
| 158 | - ); |
|
| 159 | - |
|
| 160 | - $this->loadQtipJs(); |
|
| 161 | - |
|
| 162 | - // joyride is turned OFF by default, but prior to the admin_enqueue_scripts hook, |
|
| 163 | - // can be turned back on again via: add_filter('FHEE_load_joyride', '__return_true' ); |
|
| 164 | - if (! $joyride) { |
|
| 165 | - return; |
|
| 166 | - } |
|
| 167 | - |
|
| 168 | - $this->addJavascript( |
|
| 169 | - EspressoLegacyAdminAssetManager::JS_HANDLE_JOYRIDE_MODERNIZR, |
|
| 170 | - EE_THIRD_PARTY_URL . 'joyride/modernizr.mq.js', |
|
| 171 | - [], |
|
| 172 | - true, |
|
| 173 | - '2.1' |
|
| 174 | - ); |
|
| 175 | - |
|
| 176 | - // wanna go for a joyride? |
|
| 177 | - $this->addJavascript( |
|
| 178 | - EspressoLegacyAdminAssetManager::JS_HANDLE_JQUERY_JOYRIDE, |
|
| 179 | - EE_THIRD_PARTY_URL . 'joyride/jquery.joyride-2.1.js', |
|
| 180 | - [ |
|
| 181 | - JqueryAssetManager::JS_HANDLE_JQUERY_COOKIE, |
|
| 182 | - EspressoLegacyAdminAssetManager::JS_HANDLE_JOYRIDE_MODERNIZR, |
|
| 183 | - ], |
|
| 184 | - true, |
|
| 185 | - '2.1' |
|
| 186 | - )->setEnqueueImmediately(); |
|
| 187 | - |
|
| 188 | - $this->addJavascript( |
|
| 189 | - EspressoLegacyAdminAssetManager::JS_HANDLE_EE_HELP_TOUR, |
|
| 190 | - EE_ADMIN_URL . 'assets/ee-help-tour.js', |
|
| 191 | - [ |
|
| 192 | - EspressoLegacyAdminAssetManager::JS_HANDLE_JQUERY_JOYRIDE, |
|
| 193 | - ], |
|
| 194 | - true, |
|
| 195 | - '2.1' |
|
| 196 | - )->setEnqueueImmediately(); |
|
| 197 | - } |
|
| 198 | - |
|
| 199 | - |
|
| 200 | - /** |
|
| 201 | - * Register CSS assets. |
|
| 202 | - * |
|
| 203 | - * @param bool $joyride |
|
| 204 | - */ |
|
| 205 | - private function registerStyleSheets($joyride = false) |
|
| 206 | - { |
|
| 207 | - |
|
| 208 | - $this->addStylesheet( |
|
| 209 | - EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_UI_THEME, |
|
| 210 | - EE_GLOBAL_ASSETS_URL . 'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css' |
|
| 211 | - ); |
|
| 212 | - |
|
| 213 | - $this->addStylesheet( |
|
| 214 | - EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_TEXT_LINKS, |
|
| 215 | - EE_PLUGIN_DIR_URL . 'core/helpers/assets/ee_text_list_helper.css' |
|
| 216 | - ); |
|
| 217 | - |
|
| 218 | - $this->addStylesheet( |
|
| 219 | - EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_ADMIN, |
|
| 220 | - EE_ADMIN_URL . 'assets/ee-admin-page.css' |
|
| 221 | - )->setEnqueueImmediately(); |
|
| 222 | - |
|
| 223 | - if (! $joyride) { |
|
| 224 | - return; |
|
| 225 | - } |
|
| 226 | - // joyride style |
|
| 227 | - $this->addStylesheet( |
|
| 228 | - EspressoLegacyAdminAssetManager::CSS_HANDLE_JOYRIDE, |
|
| 229 | - EE_THIRD_PARTY_URL . 'joyride/joyride-2.1.css', |
|
| 230 | - [], |
|
| 231 | - 'all', |
|
| 232 | - '2.1' |
|
| 233 | - ); |
|
| 234 | - |
|
| 235 | - $this->addStylesheet( |
|
| 236 | - EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_JOYRIDE, |
|
| 237 | - EE_GLOBAL_ASSETS_URL . 'css/ee-joyride-styles.css', |
|
| 238 | - [EspressoLegacyAdminAssetManager::CSS_HANDLE_JOYRIDE], |
|
| 239 | - 'all', |
|
| 240 | - EVENT_ESPRESSO_VERSION |
|
| 241 | - )->setEnqueueImmediately(); |
|
| 242 | - } |
|
| 243 | - |
|
| 244 | - |
|
| 245 | - /** |
|
| 246 | - * registers assets for cleaning your ears |
|
| 247 | - */ |
|
| 248 | - public function loadQtipJs() |
|
| 249 | - { |
|
| 250 | - // qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook, |
|
| 251 | - // can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' ); |
|
| 252 | - if (apply_filters('FHEE_load_qtip', false)) { |
|
| 253 | - $qtip_loader = EEH_Qtip_Loader::instance(); |
|
| 254 | - if ($qtip_loader instanceof EEH_Qtip_Loader) { |
|
| 255 | - $qtip_loader->register_and_enqueue(); |
|
| 256 | - } |
|
| 257 | - } |
|
| 258 | - } |
|
| 52 | + const CSS_HANDLE_EE_UI_THEME = 'espresso-ui-theme'; |
|
| 53 | + |
|
| 54 | + const CSS_HANDLE_JOYRIDE = 'joyride-css'; |
|
| 55 | + |
|
| 56 | + |
|
| 57 | + /** |
|
| 58 | + * @inheritDoc |
|
| 59 | + */ |
|
| 60 | + public function addAssets() |
|
| 61 | + { |
|
| 62 | + $joyride = filter_var(apply_filters('FHEE_load_joyride', false), FILTER_VALIDATE_BOOLEAN); |
|
| 63 | + $this->registerJavascript($joyride); |
|
| 64 | + $this->registerStyleSheets($joyride); |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + |
|
| 68 | + /** |
|
| 69 | + * Register javascript assets |
|
| 70 | + * |
|
| 71 | + * @param bool $joyride |
|
| 72 | + */ |
|
| 73 | + private function registerJavascript($joyride = false) |
|
| 74 | + { |
|
| 75 | + $this->addJavascript( |
|
| 76 | + EspressoLegacyAdminAssetManager::JS_HANDLE_EE_DIALOG, |
|
| 77 | + EE_ADMIN_URL . 'assets/ee-dialog-helper.js', |
|
| 78 | + [ |
|
| 79 | + JqueryAssetManager::JS_HANDLE_JQUERY, |
|
| 80 | + JqueryAssetManager::JS_HANDLE_JQUERY_UI_DRAGGABLE, |
|
| 81 | + ] |
|
| 82 | + ); |
|
| 83 | + |
|
| 84 | + $this->addJavascript( |
|
| 85 | + EspressoLegacyAdminAssetManager::JS_HANDLE_EE_ADMIN, |
|
| 86 | + EE_ADMIN_URL . 'assets/ee-admin-page.js', |
|
| 87 | + [ |
|
| 88 | + CoreAssetManager::JS_HANDLE_CORE, |
|
| 89 | + EspressoLegacyAdminAssetManager::JS_HANDLE_PARSE_URI, |
|
| 90 | + EspressoLegacyAdminAssetManager::JS_HANDLE_EE_DIALOG, |
|
| 91 | + ] |
|
| 92 | + ); |
|
| 93 | + |
|
| 94 | + // script for sorting tables |
|
| 95 | + $this->addJavascript( |
|
| 96 | + EspressoLegacyAdminAssetManager::JS_HANDLE_EE_AJAX_TABLE_SORTING, |
|
| 97 | + EE_ADMIN_URL . 'assets/espresso_ajax_table_sorting.js', |
|
| 98 | + [ |
|
| 99 | + EspressoLegacyAdminAssetManager::JS_HANDLE_EE_ADMIN, |
|
| 100 | + JqueryAssetManager::JS_HANDLE_JQUERY_UI_SORTABLE, |
|
| 101 | + ] |
|
| 102 | + )->setEnqueueImmediately(); |
|
| 103 | + |
|
| 104 | + // script for parsing uri's |
|
| 105 | + $this->addJavascript( |
|
| 106 | + EspressoLegacyAdminAssetManager::JS_HANDLE_PARSE_URI, |
|
| 107 | + EE_GLOBAL_ASSETS_URL . 'scripts/parseuri.js' |
|
| 108 | + ); |
|
| 109 | + |
|
| 110 | + // and parsing associative serialized form elements |
|
| 111 | + $this->addJavascript( |
|
| 112 | + EspressoLegacyAdminAssetManager::JS_HANDLE_EE_SERIALIZE_FULL_ARRAY, |
|
| 113 | + EE_GLOBAL_ASSETS_URL . 'scripts/jquery.serializefullarray.js', |
|
| 114 | + [JqueryAssetManager::JS_HANDLE_JQUERY] |
|
| 115 | + |
|
| 116 | + ); |
|
| 117 | + |
|
| 118 | + // helpers scripts |
|
| 119 | + $this->addJavascript( |
|
| 120 | + EspressoLegacyAdminAssetManager::JS_HANDLE_EE_TEXT_LINKS, |
|
| 121 | + EE_PLUGIN_DIR_URL . 'core/helpers/assets/ee_text_list_helper.js', |
|
| 122 | + [JqueryAssetManager::JS_HANDLE_JQUERY] |
|
| 123 | + ); |
|
| 124 | + |
|
| 125 | + $this->addJavascript( |
|
| 126 | + EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT_CORE, |
|
| 127 | + EE_THIRD_PARTY_URL . 'moment/moment-with-locales.min.js' |
|
| 128 | + ); |
|
| 129 | + |
|
| 130 | + $this->addJavascript( |
|
| 131 | + EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT, |
|
| 132 | + EE_THIRD_PARTY_URL . 'moment/moment-timezone-with-data.min.js', |
|
| 133 | + [EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT_CORE] |
|
| 134 | + ); |
|
| 135 | + |
|
| 136 | + $this->addJavascript( |
|
| 137 | + EspressoLegacyAdminAssetManager::JS_HANDLE_EE_DATEPICKER, |
|
| 138 | + EE_ADMIN_URL . 'assets/ee-datepicker.js', |
|
| 139 | + [ |
|
| 140 | + JqueryAssetManager::JS_HANDLE_JQUERY_UI_TIMEPICKER_ADDON, |
|
| 141 | + EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT, |
|
| 142 | + ] |
|
| 143 | + ); |
|
| 144 | + |
|
| 145 | + // google charts |
|
| 146 | + $this->addJavascript( |
|
| 147 | + EspressoLegacyAdminAssetManager::JS_HANDLE_GOOGLE_CHARTS, |
|
| 148 | + 'https://www.gstatic.com/charts/loader.js' |
|
| 149 | + ); |
|
| 150 | + |
|
| 151 | + // this javascript is loaded on every admin page to catch any injections ee needs to add to wp run js. |
|
| 152 | + // Note: the intention of this script is to only do TARGETED injections. |
|
| 153 | + //ie: only injecting on certain script calls. |
|
| 154 | + $this->addJavascript( |
|
| 155 | + EspressoLegacyAdminAssetManager::JS_HANDLE_EE_INJECT_WP, |
|
| 156 | + EE_ADMIN_URL . 'assets/ee-cpt-wp-injects.js', |
|
| 157 | + [JqueryAssetManager::JS_HANDLE_JQUERY] |
|
| 158 | + ); |
|
| 159 | + |
|
| 160 | + $this->loadQtipJs(); |
|
| 161 | + |
|
| 162 | + // joyride is turned OFF by default, but prior to the admin_enqueue_scripts hook, |
|
| 163 | + // can be turned back on again via: add_filter('FHEE_load_joyride', '__return_true' ); |
|
| 164 | + if (! $joyride) { |
|
| 165 | + return; |
|
| 166 | + } |
|
| 167 | + |
|
| 168 | + $this->addJavascript( |
|
| 169 | + EspressoLegacyAdminAssetManager::JS_HANDLE_JOYRIDE_MODERNIZR, |
|
| 170 | + EE_THIRD_PARTY_URL . 'joyride/modernizr.mq.js', |
|
| 171 | + [], |
|
| 172 | + true, |
|
| 173 | + '2.1' |
|
| 174 | + ); |
|
| 175 | + |
|
| 176 | + // wanna go for a joyride? |
|
| 177 | + $this->addJavascript( |
|
| 178 | + EspressoLegacyAdminAssetManager::JS_HANDLE_JQUERY_JOYRIDE, |
|
| 179 | + EE_THIRD_PARTY_URL . 'joyride/jquery.joyride-2.1.js', |
|
| 180 | + [ |
|
| 181 | + JqueryAssetManager::JS_HANDLE_JQUERY_COOKIE, |
|
| 182 | + EspressoLegacyAdminAssetManager::JS_HANDLE_JOYRIDE_MODERNIZR, |
|
| 183 | + ], |
|
| 184 | + true, |
|
| 185 | + '2.1' |
|
| 186 | + )->setEnqueueImmediately(); |
|
| 187 | + |
|
| 188 | + $this->addJavascript( |
|
| 189 | + EspressoLegacyAdminAssetManager::JS_HANDLE_EE_HELP_TOUR, |
|
| 190 | + EE_ADMIN_URL . 'assets/ee-help-tour.js', |
|
| 191 | + [ |
|
| 192 | + EspressoLegacyAdminAssetManager::JS_HANDLE_JQUERY_JOYRIDE, |
|
| 193 | + ], |
|
| 194 | + true, |
|
| 195 | + '2.1' |
|
| 196 | + )->setEnqueueImmediately(); |
|
| 197 | + } |
|
| 198 | + |
|
| 199 | + |
|
| 200 | + /** |
|
| 201 | + * Register CSS assets. |
|
| 202 | + * |
|
| 203 | + * @param bool $joyride |
|
| 204 | + */ |
|
| 205 | + private function registerStyleSheets($joyride = false) |
|
| 206 | + { |
|
| 207 | + |
|
| 208 | + $this->addStylesheet( |
|
| 209 | + EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_UI_THEME, |
|
| 210 | + EE_GLOBAL_ASSETS_URL . 'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css' |
|
| 211 | + ); |
|
| 212 | + |
|
| 213 | + $this->addStylesheet( |
|
| 214 | + EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_TEXT_LINKS, |
|
| 215 | + EE_PLUGIN_DIR_URL . 'core/helpers/assets/ee_text_list_helper.css' |
|
| 216 | + ); |
|
| 217 | + |
|
| 218 | + $this->addStylesheet( |
|
| 219 | + EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_ADMIN, |
|
| 220 | + EE_ADMIN_URL . 'assets/ee-admin-page.css' |
|
| 221 | + )->setEnqueueImmediately(); |
|
| 222 | + |
|
| 223 | + if (! $joyride) { |
|
| 224 | + return; |
|
| 225 | + } |
|
| 226 | + // joyride style |
|
| 227 | + $this->addStylesheet( |
|
| 228 | + EspressoLegacyAdminAssetManager::CSS_HANDLE_JOYRIDE, |
|
| 229 | + EE_THIRD_PARTY_URL . 'joyride/joyride-2.1.css', |
|
| 230 | + [], |
|
| 231 | + 'all', |
|
| 232 | + '2.1' |
|
| 233 | + ); |
|
| 234 | + |
|
| 235 | + $this->addStylesheet( |
|
| 236 | + EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_JOYRIDE, |
|
| 237 | + EE_GLOBAL_ASSETS_URL . 'css/ee-joyride-styles.css', |
|
| 238 | + [EspressoLegacyAdminAssetManager::CSS_HANDLE_JOYRIDE], |
|
| 239 | + 'all', |
|
| 240 | + EVENT_ESPRESSO_VERSION |
|
| 241 | + )->setEnqueueImmediately(); |
|
| 242 | + } |
|
| 243 | + |
|
| 244 | + |
|
| 245 | + /** |
|
| 246 | + * registers assets for cleaning your ears |
|
| 247 | + */ |
|
| 248 | + public function loadQtipJs() |
|
| 249 | + { |
|
| 250 | + // qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook, |
|
| 251 | + // can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' ); |
|
| 252 | + if (apply_filters('FHEE_load_qtip', false)) { |
|
| 253 | + $qtip_loader = EEH_Qtip_Loader::instance(); |
|
| 254 | + if ($qtip_loader instanceof EEH_Qtip_Loader) { |
|
| 255 | + $qtip_loader->register_and_enqueue(); |
|
| 256 | + } |
|
| 257 | + } |
|
| 258 | + } |
|
| 259 | 259 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | $this->addJavascript( |
| 76 | 76 | EspressoLegacyAdminAssetManager::JS_HANDLE_EE_DIALOG, |
| 77 | - EE_ADMIN_URL . 'assets/ee-dialog-helper.js', |
|
| 77 | + EE_ADMIN_URL.'assets/ee-dialog-helper.js', |
|
| 78 | 78 | [ |
| 79 | 79 | JqueryAssetManager::JS_HANDLE_JQUERY, |
| 80 | 80 | JqueryAssetManager::JS_HANDLE_JQUERY_UI_DRAGGABLE, |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $this->addJavascript( |
| 85 | 85 | EspressoLegacyAdminAssetManager::JS_HANDLE_EE_ADMIN, |
| 86 | - EE_ADMIN_URL . 'assets/ee-admin-page.js', |
|
| 86 | + EE_ADMIN_URL.'assets/ee-admin-page.js', |
|
| 87 | 87 | [ |
| 88 | 88 | CoreAssetManager::JS_HANDLE_CORE, |
| 89 | 89 | EspressoLegacyAdminAssetManager::JS_HANDLE_PARSE_URI, |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | // script for sorting tables |
| 95 | 95 | $this->addJavascript( |
| 96 | 96 | EspressoLegacyAdminAssetManager::JS_HANDLE_EE_AJAX_TABLE_SORTING, |
| 97 | - EE_ADMIN_URL . 'assets/espresso_ajax_table_sorting.js', |
|
| 97 | + EE_ADMIN_URL.'assets/espresso_ajax_table_sorting.js', |
|
| 98 | 98 | [ |
| 99 | 99 | EspressoLegacyAdminAssetManager::JS_HANDLE_EE_ADMIN, |
| 100 | 100 | JqueryAssetManager::JS_HANDLE_JQUERY_UI_SORTABLE, |
@@ -104,13 +104,13 @@ discard block |
||
| 104 | 104 | // script for parsing uri's |
| 105 | 105 | $this->addJavascript( |
| 106 | 106 | EspressoLegacyAdminAssetManager::JS_HANDLE_PARSE_URI, |
| 107 | - EE_GLOBAL_ASSETS_URL . 'scripts/parseuri.js' |
|
| 107 | + EE_GLOBAL_ASSETS_URL.'scripts/parseuri.js' |
|
| 108 | 108 | ); |
| 109 | 109 | |
| 110 | 110 | // and parsing associative serialized form elements |
| 111 | 111 | $this->addJavascript( |
| 112 | 112 | EspressoLegacyAdminAssetManager::JS_HANDLE_EE_SERIALIZE_FULL_ARRAY, |
| 113 | - EE_GLOBAL_ASSETS_URL . 'scripts/jquery.serializefullarray.js', |
|
| 113 | + EE_GLOBAL_ASSETS_URL.'scripts/jquery.serializefullarray.js', |
|
| 114 | 114 | [JqueryAssetManager::JS_HANDLE_JQUERY] |
| 115 | 115 | |
| 116 | 116 | ); |
@@ -118,24 +118,24 @@ discard block |
||
| 118 | 118 | // helpers scripts |
| 119 | 119 | $this->addJavascript( |
| 120 | 120 | EspressoLegacyAdminAssetManager::JS_HANDLE_EE_TEXT_LINKS, |
| 121 | - EE_PLUGIN_DIR_URL . 'core/helpers/assets/ee_text_list_helper.js', |
|
| 121 | + EE_PLUGIN_DIR_URL.'core/helpers/assets/ee_text_list_helper.js', |
|
| 122 | 122 | [JqueryAssetManager::JS_HANDLE_JQUERY] |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | 125 | $this->addJavascript( |
| 126 | 126 | EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT_CORE, |
| 127 | - EE_THIRD_PARTY_URL . 'moment/moment-with-locales.min.js' |
|
| 127 | + EE_THIRD_PARTY_URL.'moment/moment-with-locales.min.js' |
|
| 128 | 128 | ); |
| 129 | 129 | |
| 130 | 130 | $this->addJavascript( |
| 131 | 131 | EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT, |
| 132 | - EE_THIRD_PARTY_URL . 'moment/moment-timezone-with-data.min.js', |
|
| 132 | + EE_THIRD_PARTY_URL.'moment/moment-timezone-with-data.min.js', |
|
| 133 | 133 | [EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT_CORE] |
| 134 | 134 | ); |
| 135 | 135 | |
| 136 | 136 | $this->addJavascript( |
| 137 | 137 | EspressoLegacyAdminAssetManager::JS_HANDLE_EE_DATEPICKER, |
| 138 | - EE_ADMIN_URL . 'assets/ee-datepicker.js', |
|
| 138 | + EE_ADMIN_URL.'assets/ee-datepicker.js', |
|
| 139 | 139 | [ |
| 140 | 140 | JqueryAssetManager::JS_HANDLE_JQUERY_UI_TIMEPICKER_ADDON, |
| 141 | 141 | EspressoLegacyAdminAssetManager::JS_HANDLE_MOMENT, |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | //ie: only injecting on certain script calls. |
| 154 | 154 | $this->addJavascript( |
| 155 | 155 | EspressoLegacyAdminAssetManager::JS_HANDLE_EE_INJECT_WP, |
| 156 | - EE_ADMIN_URL . 'assets/ee-cpt-wp-injects.js', |
|
| 156 | + EE_ADMIN_URL.'assets/ee-cpt-wp-injects.js', |
|
| 157 | 157 | [JqueryAssetManager::JS_HANDLE_JQUERY] |
| 158 | 158 | ); |
| 159 | 159 | |
@@ -161,13 +161,13 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | // joyride is turned OFF by default, but prior to the admin_enqueue_scripts hook, |
| 163 | 163 | // can be turned back on again via: add_filter('FHEE_load_joyride', '__return_true' ); |
| 164 | - if (! $joyride) { |
|
| 164 | + if ( ! $joyride) { |
|
| 165 | 165 | return; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | $this->addJavascript( |
| 169 | 169 | EspressoLegacyAdminAssetManager::JS_HANDLE_JOYRIDE_MODERNIZR, |
| 170 | - EE_THIRD_PARTY_URL . 'joyride/modernizr.mq.js', |
|
| 170 | + EE_THIRD_PARTY_URL.'joyride/modernizr.mq.js', |
|
| 171 | 171 | [], |
| 172 | 172 | true, |
| 173 | 173 | '2.1' |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | // wanna go for a joyride? |
| 177 | 177 | $this->addJavascript( |
| 178 | 178 | EspressoLegacyAdminAssetManager::JS_HANDLE_JQUERY_JOYRIDE, |
| 179 | - EE_THIRD_PARTY_URL . 'joyride/jquery.joyride-2.1.js', |
|
| 179 | + EE_THIRD_PARTY_URL.'joyride/jquery.joyride-2.1.js', |
|
| 180 | 180 | [ |
| 181 | 181 | JqueryAssetManager::JS_HANDLE_JQUERY_COOKIE, |
| 182 | 182 | EspressoLegacyAdminAssetManager::JS_HANDLE_JOYRIDE_MODERNIZR, |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | $this->addJavascript( |
| 189 | 189 | EspressoLegacyAdminAssetManager::JS_HANDLE_EE_HELP_TOUR, |
| 190 | - EE_ADMIN_URL . 'assets/ee-help-tour.js', |
|
| 190 | + EE_ADMIN_URL.'assets/ee-help-tour.js', |
|
| 191 | 191 | [ |
| 192 | 192 | EspressoLegacyAdminAssetManager::JS_HANDLE_JQUERY_JOYRIDE, |
| 193 | 193 | ], |
@@ -207,26 +207,26 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | $this->addStylesheet( |
| 209 | 209 | EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_UI_THEME, |
| 210 | - EE_GLOBAL_ASSETS_URL . 'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css' |
|
| 210 | + EE_GLOBAL_ASSETS_URL.'css/espresso-ui-theme/jquery-ui-1.10.3.custom.min.css' |
|
| 211 | 211 | ); |
| 212 | 212 | |
| 213 | 213 | $this->addStylesheet( |
| 214 | 214 | EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_TEXT_LINKS, |
| 215 | - EE_PLUGIN_DIR_URL . 'core/helpers/assets/ee_text_list_helper.css' |
|
| 215 | + EE_PLUGIN_DIR_URL.'core/helpers/assets/ee_text_list_helper.css' |
|
| 216 | 216 | ); |
| 217 | 217 | |
| 218 | 218 | $this->addStylesheet( |
| 219 | 219 | EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_ADMIN, |
| 220 | - EE_ADMIN_URL . 'assets/ee-admin-page.css' |
|
| 220 | + EE_ADMIN_URL.'assets/ee-admin-page.css' |
|
| 221 | 221 | )->setEnqueueImmediately(); |
| 222 | 222 | |
| 223 | - if (! $joyride) { |
|
| 223 | + if ( ! $joyride) { |
|
| 224 | 224 | return; |
| 225 | 225 | } |
| 226 | 226 | // joyride style |
| 227 | 227 | $this->addStylesheet( |
| 228 | 228 | EspressoLegacyAdminAssetManager::CSS_HANDLE_JOYRIDE, |
| 229 | - EE_THIRD_PARTY_URL . 'joyride/joyride-2.1.css', |
|
| 229 | + EE_THIRD_PARTY_URL.'joyride/joyride-2.1.css', |
|
| 230 | 230 | [], |
| 231 | 231 | 'all', |
| 232 | 232 | '2.1' |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | $this->addStylesheet( |
| 236 | 236 | EspressoLegacyAdminAssetManager::CSS_HANDLE_EE_JOYRIDE, |
| 237 | - EE_GLOBAL_ASSETS_URL . 'css/ee-joyride-styles.css', |
|
| 237 | + EE_GLOBAL_ASSETS_URL.'css/ee-joyride-styles.css', |
|
| 238 | 238 | [EspressoLegacyAdminAssetManager::CSS_HANDLE_JOYRIDE], |
| 239 | 239 | 'all', |
| 240 | 240 | EVENT_ESPRESSO_VERSION |