crmMailing - Comments/cleanup
authorTim Otten <totten@civicrm.org>
Fri, 30 Jan 2015 03:25:34 +0000 (19:25 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 31 Jan 2015 03:19:32 +0000 (19:19 -0800)
js/angular-crm-ui.js
js/angular-crmMailing.js

index 44b19bdb280e104578148adaf1efc952ad5a764e..2bc70199310c7911af7a5f4a6e81a058281d61d7 100644 (file)
       };
     })
 
+    // Display a date widget.
     // example: <input crm-ui-date="myobj.datefield" />
     // example: <input crm-ui-date="myobj.datefield" crm-ui-date-format="yy-mm-dd" />
+    // WISHLIST: use ngModel
     .directive('crmUiDate', function ($parse, $timeout) {
       return {
         restrict: 'AE',
@@ -59,7 +61,9 @@
       };
     })
 
+    // Display a date-time widget.
     // example: <div crm-ui-date-time="myobj.mydatetimefield"></div>
+    // WISHLIST: use ngModel
     .directive('crmUiDateTime', function ($parse) {
       return {
         restrict: 'AE',
       };
     })
 
+    // Define a scope in which a name like "subform.foo" maps to a unique ID.
     // example: <div ng-form="subform" crm-ui-id-scope><label crm-ui-for="subform.foo">Foo:</label><input crm-ui-id="subform.foo" name="foo"/></div>
     .directive('crmUiIdScope', function () {
       return {
       };
     })
 
+    // Display an HTML blurb inside an IFRAME.
     // example: <iframe crm-ui-iframe="getHtmlContent()"></iframe>
     .directive('crmUiIframe', function ($parse) {
       return {
           };
 
           scope.$parent.$watch(attrs.crmUiIframe, refresh);
-          //setTimeout(function () { refresh(); }, 50);
         }
       };
     })
 
+    // Define a rich text editor.
     // example: <textarea crm-ui-id="myForm.body_html" crm-ui-richtext name="body_html" ng-model="mailing.body_html"></textarea>
+    // WISHLIST: use ngModel
     .directive('crmUiRichtext', function ($timeout) {
       return {
         require: '?ngModel',
       };
     })
 
+    // Display a lock icon (based on a boolean).
     // example: <a crm-ui-lock binding="mymodel.boolfield"></a>
     // example: <a crm-ui-lock
     //            binding="mymodel.boolfield"
       };
     })
 
+    // Display a fancy SELECT (based on select2).
     // usage: <select crm-ui-select="{placeholder:'Something',allowClear:true,...}" ng-model="myobj.field"><option...></select>
     .directive('crmUiSelect', function ($parse, $timeout) {
       return {
       };
     })
 
+    // Display a time-entry field.
     // example: <input crm-ui-time="myobj.mytimefield" />
+    // WISHLIST: use ngModel
     .directive('crmUiTime', function ($parse, $timeout) {
       return {
         restrict: 'AE',
       };
     })
 
+    // Generic, field-independent form validator.
     // example: <span ng-model="placeholder" crm-ui-validate="foo && bar || whiz" />
     // example: <span ng-model="placeholder" crm-ui-validate="foo && bar || whiz" crm-ui-validate-name="myError" />
-    // Generic, field-independent validator.
     .directive('crmUiValidate', function() {
       return {
         restrict: 'EA',
index 8881051f6d3111cd57f16396bfc35e6d95b97187..889f8af88a8e8d12d64f3170d73fc7ec4291cda5 100644 (file)
 
   // Controller for the "Preview Mailing Component" segment
   // which displays header/footer/auto-responder
-  angular.module('crmMailing').controller('PreviewComponentCtrl', function PreviewMailingDialogCtrl($scope, dialogService) {
+  angular.module('crmMailing').controller('PreviewComponentCtrl', function PreviewComponentCtrl($scope, dialogService) {
     var ts = $scope.ts = CRM.ts(null);
 
     $scope.previewComponent = function previewComponent(title, componentId) {
     };
   });
 
-  // Controller for the "Preview Mailing" dialog
+  // Controller for the "Preview Mailing Component" dialog
   // Note: Expects $scope.model to be an object with properties:
   //   - "name"
   //   - "subject"
   //   - "body_html"
   //   - "body_text"
-  angular.module('crmMailing').controller('PreviewComponentDialogCtrl', function PreviewMailingDialogCtrl($scope) {
+  angular.module('crmMailing').controller('PreviewComponentDialogCtrl', function PreviewComponentDialogCtrl($scope) {
     $scope.ts = CRM.ts(null);
   });