(REF) Setup UI - Follow jQuery plugin conventions more closely
authorTim Otten <totten@civicrm.org>
Thu, 16 Jul 2020 19:51:20 +0000 (12:51 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 16 Jul 2020 19:51:20 +0000 (12:51 -0700)
1. Conventional for jQuery plugins to be named `jquery.foo.js`

2. Conventional to bind to `window.jQuery` at load-time

setup/res/jquery.setupui.js [moved from setup/res/installer.js with 89% similarity]
setup/src/Setup/UI/SetupController.php

similarity index 89%
rename from setup/res/installer.js
rename to setup/res/jquery.setupui.js
index 801c34c2b31833d7b5365d6f852d5800d9976816..e000da4cd02edcaab665b2fbc666471e3204a502 100644 (file)
@@ -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
index a0434fa401b51b6e449bf71e3588d18d89b6afa8..c7e685f9fff8ffc7720dfcaf122ee5c375c13a66 100644 (file)
@@ -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')],