Script for building minified javascript using closure compiler

This commit is contained in:
chouseknecht
2013-06-10 18:31:17 -04:00
parent cba55a061a
commit 9e9e41db35
41 changed files with 197 additions and 213 deletions

View File

@@ -73,7 +73,7 @@ angular.module('AuthService', ['ngCookies'])
return $http({
method: 'GET',
url: '/api/v1/me/',
headers: { 'Authorization': 'Token ' + this.getToken() },
headers: { 'Authorization': 'Token ' + this.getToken() }
});
},

View File

@@ -106,12 +106,12 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
applyDefaults: function() {
for (fld in this.form.fields) {
if (this.form.fields[fld].default || this.form.fields[fld].default == 0) {
if (this.form.fields[fld]['default'] || this.form.fields[fld]['default'] == 0) {
if (this.form.fields[fld].type == 'select' && this.scope[fld + '_options']) {
this.scope[fld] = this.scope[fld + '_options'][this.form.fields[fld].default];
this.scope[fld] = this.scope[fld + '_options'][this.form.fields[fld]['default']];
}
else {
this.scope[fld] = this.form.fields[fld].default;
this.scope[fld] = this.form.fields[fld]['default'];
}
}
}
@@ -166,7 +166,7 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
}
html += "<input type=\"text\" name=\"" + fld + "\" ";
html += "ng-model=\"" + fld + "\" ";
html += (field.class) ? this.attr(field, "class") : "";
html += (field['class']) ? this.attr(field, "class") : "";
html += " readonly />\n";
return html;
},
@@ -203,7 +203,7 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
html += 'name="' + fld + '" ';
html += (field.ngChange) ? this.attr(field,'ngChange') : "";
html += (field.id) ? this.attr(field,'id') : "";
html += (field.class) ? this.attr(field, 'class') : "";
html += (field['class']) ? this.attr(field, 'class') : "";
html += (field.placeholder) ? this.attr(field,'placeholder') : "";
html += (options.mode == 'edit' && field.editRequired) ? "required " : "";
html += (options.mode == 'add' && field.addRequired) ? "required " : "";
@@ -262,7 +262,7 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
html += (field.rows) ? this.attr(field, 'rows') : "";
html += "ng-model=\"" + fld + '" ';
html += 'name="' + fld + '" ';
html += (field.class) ? this.attr(field,'class') : "";
html += (field['class']) ? this.attr(field,'class') : "";
html += (field.ngChange) ? this.attr(field,'ngChange') : "";
html += (field.id) ? this.attr(field,'id') : "";
html += (field.placeholder) ? this.attr(field,'placeholder') : "";
@@ -337,8 +337,8 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
html += "<div class=\"controls\">\n";
// Use 'text' rather than 'number' so that our integer directive works correctly
html += (field.slider) ? "<div class=\"slider\" id=\"" + fld + "-slider\"></div>\n" : "";
html += "<input type=\"text\" value=\"" + field.default + "\" ";
html += (field.class) ? this.attr(field, 'class') : "";
html += "<input type=\"text\" value=\"" + field['default'] + "\" ";
html += (field['class']) ? this.attr(field, 'class') : "";
html += (field.slider) ? "ng-slider=\"" + fld + "\" " : "";
html += "ng-model=\"" + fld + '" ';
html += 'name="' + fld + '" ';
@@ -483,7 +483,7 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
for (action in this.form.statusActions) {
act = this.form.statusActions[action];
html += "<button " + this.attr(act, 'ngClick') + "class=\"btn";
html += (act.class) ? " " + act.class : "";
html += (act['class']) ? " " + act['class'] : "";
html += "\" ";
html += (act.awToolTip) ? this.attr(act,'awToolTip') : "";
html += (act.awToolTip) ? "data-placement=\"top\" " : "";
@@ -572,7 +572,7 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
//button
html += "<button ";
html += "class=\"btn btn-small";
html += (button.class) ? " " + button.class : "";
html += (button['class']) ? " " + button['class'] : "";
html += "\" ";
if (button.ngClick) {
html += this.attr(button,'ngClick');
@@ -759,8 +759,8 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
html += "<td class=\"actions\">";
for (action in form.related[itm].fieldActions) {
html += "<button class=\"btn btn-mini";
html += (form.related[itm]['fieldActions'][action].class) ?
" " + form.related[itm]['fieldActions'][action].class : "";
html += (form.related[itm]['fieldActions'][action]['class']) ?
" " + form.related[itm]['fieldActions'][action]['class'] : "";
html += "\" ";
html += (form.related[itm]['fieldActions'][action].awToolTip) ? this.attr(form.related[itm]['fieldActions'][action],'awToolTip') : "";
html += this.attr(form.related[itm]['fieldActions'][action],'ngClick') +
@@ -919,7 +919,7 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
for (act in form.related[itm].fieldActions) {
var action = form.related[itm].fieldActions[act];
html += "<button class=\"btn btn-small";
html += (action.class) ? " " + action.class : "";
html += (action['class']) ? " " + action['class'] : "";
html += "\" " + this.attr(action,'ngClick');
html += (action.awToolTip) ? this.attr(action,'awToolTip') : "";
html += (action.awToolTip) ? "data-placement=\"top\" " : "";

View File

@@ -7,7 +7,7 @@
*
*/
angular.module('ListGenerator', ['GeneratorHelpers',])
angular.module('ListGenerator', ['GeneratorHelpers'])
.factory('GenerateList', [ '$location', '$compile', '$rootScope', 'SearchWidget', 'PaginateWidget',
function($location, $compile, $rootScope, SearchWidget, PaginateWidget) {
return {
@@ -153,7 +153,7 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
if ( (list.actions[action].basePaths == undefined) ||
(list.actions[action].basePaths && list.actions[action].basePaths.indexOf(base) > -1) ) {
html += "<button " + this.attr(list.actions[action], 'ngClick') + "class=\"btn";
html += (list.actions[action].class) ? " " + list.actions[action].class : " btn-small";
html += (list.actions[action]['class']) ? " " + list.actions[action]['class'] : " btn-small";
html += "\" ";
html += (list.actions[action].ngHide) ? this.attr(list.actions[action],'ngHide') : "";
html += (list.actions[action].awToolTip) ? this.attr(list.actions[action],'awToolTip') : "";
@@ -173,7 +173,7 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
// table header row
html += "<table class=\"table table-condensed"
html += (list.class) ? " " + list.class : "";
html += (list['class']) ? " " + list['class'] : "";
html += (options.mode == 'lookup' || list.hover) ? " table-hover" : "";
html += "\">\n";
html += "<thead>\n";
@@ -213,7 +213,7 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
cnt++;
html += "<td ";
html += "<td class=\"" + fld + "-column";
html += (list.fields[fld].class) ? " " + list.fields[fld].class : "";
html += (list.fields[fld]['class']) ? " " + list.fields[fld]['class'] : "";
html += "\" ";
html += (list.fields[fld].ngClass) ? this.attr(list.fields[fld], 'ngClass') : "";
html += ">\n";
@@ -250,7 +250,7 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
html += "<td class=\"actions\">";
for (action in list.fieldActions) {
html += "<button class=\"btn";
html += (list.fieldActions[action].class) ? " " + list.fieldActions[action].class : " btn-small";
html += (list.fieldActions[action]['class']) ? " " + list.fieldActions[action]['class'] : " btn-small";
html += "\" " + this.attr(list.fieldActions[action],'ngClick');
html += (list.fieldActions[action].ngShow) ? this.attr(list.fieldActions[action],'ngShow') : "";
html += (list.fieldActions[action].awToolTip) ? this.attr(list.fieldActions[action],'awToolTip') : "";

View File

@@ -23,7 +23,7 @@ angular.module('PromptDialog', [])
var scope = dialog.scope();
scope.promptHeader = params.hdr;
scope.promptBody = params.body;
var cls = (params.class == null || params.class == undefined) ? 'btn-danger' : params.class;
var cls = (params['class'] == null || params['class'] == undefined) ? 'btn-danger' : params['class'];
$('#prompt-action-btn').addClass(cls); //Use jquery because django template engine conflicts with Angular's
// use of {{...}}
//scope.id = params.id;

View File

@@ -20,7 +20,6 @@ angular.module('RestServices',['ngCookies','AuthService'])
var key,rgx;
for (key in this.params) {
rgx = new RegExp("\\:" + key,'gm');
rgx.compile;
if (rgx.test(this.url)) {
this.url = this.url.replace(rgx,this.params[key]);
delete this.params[key];
@@ -51,7 +50,7 @@ angular.module('RestServices',['ngCookies','AuthService'])
data: data });
},
delete: function(data) {
destroy: function(data) {
var url = this.url;
return $http({method: 'DELETE',
url: url,