From c9204702ae420076b905768258629799922f1558 Mon Sep 17 00:00:00 2001
From: Coleman Watts <coleman@civicrm.org>
Date: Thu, 27 Mar 2014 22:23:11 -0400
Subject: [PATCH] CRM-14383 - Update additional script closures

---
 js/crm.designerapp.js            | 60 +++++++++++++++++---------------
 js/crm.livePage.js               |  2 +-
 js/model/crm.profile-selector.js |  5 ++-
 js/model/crm.schema.js           |  5 ++-
 4 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/js/crm.designerapp.js b/js/crm.designerapp.js
index 12559cde77..2b049a0c0f 100644
--- a/js/crm.designerapp.js
+++ b/js/crm.designerapp.js
@@ -1,31 +1,33 @@
-cj(function($) {
-  /**
-   * FIXME we depend on this being a global singleton, mainly to facilitate vents
-   *
-   * vents:
-   * - resize: the size/position of widgets should be adjusted
-   * - ufUnsaved: any part of a UFGroup was changed; args: (is_changed:bool)
-   * - formOpened: a toggleable form (such as a UFFieldView or a UFGroupView) has been opened
-   */
-  CRM.designerApp = new Backbone.Marionette.Application();
+(function ($, _) {
+  $(function () {
+    /**
+     * FIXME we depend on this being a global singleton, mainly to facilitate vents
+     *
+     * vents:
+     * - resize: the size/position of widgets should be adjusted
+     * - ufUnsaved: any part of a UFGroup was changed; args: (is_changed:bool)
+     * - formOpened: a toggleable form (such as a UFFieldView or a UFGroupView) has been opened
+     */
+    CRM.designerApp = new Backbone.Marionette.Application();
 
-  /**
-   * FIXME: Workaround for problem that having more than one instance
-   * of a profile on the page will result in duplicate DOM ids.
-   * @see CRM-12188
-   */
-  CRM.designerApp.clearPreviewArea = function() {
-    $('.crm-profile-selector-preview-pane > .crm-form-block').each(function() {
-      var parent = $(this).parent();
-      CRM.designerApp.DetachedProfiles.push({
-        parent: parent,
-        item: $(this).detach()
+    /**
+     * FIXME: Workaround for problem that having more than one instance
+     * of a profile on the page will result in duplicate DOM ids.
+     * @see CRM-12188
+     */
+    CRM.designerApp.clearPreviewArea = function () {
+      $('.crm-profile-selector-preview-pane > .crm-form-block').each(function () {
+        var parent = $(this).parent();
+        CRM.designerApp.DetachedProfiles.push({
+          parent: parent,
+          item: $(this).detach()
+        });
       });
-    });
-  };
-  CRM.designerApp.restorePreviewArea = function() {
-    $.each(CRM.designerApp.DetachedProfiles, function() {
-      $(this.parent).append(this.item);
-    });
-  };
-});
+    };
+    CRM.designerApp.restorePreviewArea = function () {
+      $.each(CRM.designerApp.DetachedProfiles, function () {
+        $(this.parent).append(this.item);
+      });
+    };
+  });
+})(CRM.$, CRM._);
diff --git a/js/crm.livePage.js b/js/crm.livePage.js
index 48a327c479..819b58f804 100644
--- a/js/crm.livePage.js
+++ b/js/crm.livePage.js
@@ -1,6 +1,6 @@
 // http://civicrm.org/licensing
 // Adds ajaxy behavior to a simple CiviCRM page
-cj(function($) {
+CRM.$(function($) {
   var active = 'a.button, a.action-item, a.crm-popup';
   $('#crm-main-content-wrapper')
     // Widgetize the content area
diff --git a/js/model/crm.profile-selector.js b/js/model/crm.profile-selector.js
index f51aa4dc2b..8a7d078bb3 100644
--- a/js/model/crm.profile-selector.js
+++ b/js/model/crm.profile-selector.js
@@ -1,5 +1,4 @@
-(function($) {
-  var CRM = (window.CRM) ? (window.CRM) : (window.CRM = {});
+(function($, _) {
   if (!CRM.ProfileSelector) CRM.ProfileSelector = {};
 
   CRM.ProfileSelector.DummyModel = CRM.Backbone.Model.extend({
@@ -7,4 +6,4 @@
       profile_id: null
     }
   });
-})(cj);
+})(CRM.$, CRM._);
diff --git a/js/model/crm.schema.js b/js/model/crm.schema.js
index 1f855845ac..ed880ca7f8 100644
--- a/js/model/crm.schema.js
+++ b/js/model/crm.schema.js
@@ -1,5 +1,4 @@
-(function($) {
-  var CRM = (window.CRM) ? (window.CRM) : (window.CRM = {});
+(function($, _) {
   if (!CRM.Schema) CRM.Schema = {};
 
   /**
@@ -49,4 +48,4 @@
     initialize: function() {
     }
   });
-})(cj);
\ No newline at end of file
+})(CRM.$, CRM._);
-- 
GitLab