From: Tim Otten Date: Thu, 16 Jul 2020 19:51:20 +0000 (-0700) Subject: (REF) Setup UI - Follow jQuery plugin conventions more closely X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=122da242af7653bd084868bb5177789d915a0c8a;p=civicrm-core.git (REF) Setup UI - Follow jQuery plugin conventions more closely 1. Conventional for jQuery plugins to be named `jquery.foo.js` 2. Conventional to bind to `window.jQuery` at load-time --- diff --git a/setup/res/installer.js b/setup/res/jquery.setupui.js similarity index 89% rename from setup/res/installer.js rename to setup/res/jquery.setupui.js index 801c34c2b3..e000da4cd0 100644 --- a/setup/res/installer.js +++ b/setup/res/jquery.setupui.js @@ -1,3 +1,6 @@ +/** + * This is a jQuery plugin which adds some helpers for the setup UI. + */ (function($){ /** * Enable or disable an error message. @@ -28,4 +31,4 @@ this.on('change', cb); return this; }; -})($); \ No newline at end of file +})(jQuery); \ No newline at end of file diff --git a/setup/src/Setup/UI/SetupController.php b/setup/src/Setup/UI/SetupController.php index a0434fa401..c7e685f9ff 100644 --- a/setup/src/Setup/UI/SetupController.php +++ b/setup/src/Setup/UI/SetupController.php @@ -191,7 +191,7 @@ class SetupController implements SetupControllerInterface { $r->body = $body; $r->assets = [ ['type' => 'script-url', 'url' => $this->getUrl('jquery.js')], - ['type' => 'script-url', 'url' => $this->urls['res'] . "installer.js"], + ['type' => 'script-url', 'url' => $this->urls['res'] . "jquery.setupui.js"], ['type' => 'script-code', 'code' => 'window.csj$ = jQuery.noConflict();'], ['type' => 'style-url', 'url' => $this->urls['res'] . "template.css"], ['type' => 'style-url', 'url' => $this->getUrl('font-awesome.css')],