Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b9a0da

Browse files
committed
removed nglr namespace
1 parent 88eca57 commit 9b9a0da

45 files changed

Lines changed: 5514 additions & 1911 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Rakefile

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ include FileUtils
22

33
desc 'Compile JavaScript'
44
task :compile do
5-
compiled = %x(java -jar lib/shrinksafe/shrinksafe.jar \
6-
lib/webtoolkit/webtoolkit.base64.js \
5+
concat = %x(cat \
76
lib/underscore/underscore.js \
7+
src/angular.prefix \
8+
lib/webtoolkit/webtoolkit.base64.js \
9+
lib/swfobject.js/swfobject.js \
810
src/Loader.js \
911
src/API.js \
1012
src/Binder.js \
@@ -19,35 +21,16 @@ task :compile do
1921
src/Users.js \
2022
src/Validators.js \
2123
src/Widgets.js \
22-
src/angular-bootstrap.js \
24+
src/angular.suffix \
2325
)
2426
f = File.new("angular.js", 'w')
25-
f.write(compiled)
27+
f.write(concat)
2628
f.close
27-
end
2829

29-
desc 'Compile JavaScript with Google Closure Compiler'
30-
task :compileclosure do
31-
# --compilation_level ADVANCED_OPTIMIZATIONS \
3230
%x(java -jar lib/compiler-closure/compiler.jar \
33-
--js lib/webtoolkit/webtoolkit.base64.js \
34-
--js lib/underscore/underscore.js \
35-
--js src/Loader.js \
36-
--js src/API.js \
37-
--js src/Binder.js \
38-
--js src/ControlBar.js \
39-
--js src/DataStore.js \
40-
--js src/Filters.js \
41-
--js src/JSON.js \
42-
--js src/Model.js \
43-
--js src/Parser.js \
44-
--js src/Scope.js \
45-
--js src/Server.js \
46-
--js src/Users.js \
47-
--js src/Validators.js \
48-
--js src/Widgets.js \
49-
--js src/angular-bootstrap.js \
50-
--js_output_file angular.js)
31+
--compilation_level ADVANCED_OPTIMIZATIONS \
32+
--js angular.js \
33+
--js_output_file angular-minified.js)
5134
end
5235

5336
namespace :server do

TODO.text

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
- angular.defaults = {}
44
- var scope = angular.compile(element, options);
55
* angular.js is not self boot straping by default.
6-
*
6+
* Remove SWFObject

angular-minified.js

Lines changed: 122 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular.js

Lines changed: 4568 additions & 164 deletions
Large diffs are not rendered by default.

jsTestDriver.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ load:
1515

1616
exclude:
1717
- src/angular-bootstrap.js
18+
- src/angular.prefix
19+
- src/angular.suffix
20+

lib/shrinksafe/js.jar

-739 KB
Binary file not shown.

lib/shrinksafe/shrinksafe.jar

-17.3 KB
Binary file not shown.

src/API.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ angular.Array = {
6666
}
6767
return true;
6868
};
69-
var getter = nglr.Scope.getter;
69+
var getter = Scope.getter;
7070
var search = function(obj, text){
7171
if (text.charAt(0) === '!') {
7272
return !search(obj, text.substr(1));
@@ -147,7 +147,7 @@ angular.Array = {
147147
},
148148
orderBy:function(array, expression, descend) {
149149
function reverse(comp, descending) {
150-
return nglr.toBoolean(descending) ?
150+
return toBoolean(descending) ?
151151
function(a,b){return comp(b,a);} : comp;
152152
}
153153
function compare(v1, v2){
@@ -224,7 +224,7 @@ angular.Array = {
224224
value = {};
225225
array[index] = value;
226226
}
227-
nglr.merge(mergeValue, value);
227+
merge(mergeValue, value);
228228
return array;
229229
}
230230
};
@@ -281,7 +281,7 @@ angular.Function = {
281281
if (_.isFunction(expression)){
282282
return expression;
283283
} else if (expression){
284-
var scope = new nglr.Scope();
284+
var scope = new Scope();
285285
return function($) {
286286
scope.state = $;
287287
return scope.eval(expression);

src/Binder.js

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (C) 2009 BRAT Tech LLC
2-
nglr.Binder = function(doc, widgetFactory, urlWatcher, config) {
2+
Binder = function(doc, widgetFactory, urlWatcher, config) {
33
this.doc = doc;
44
this.urlWatcher = urlWatcher;
55
this.anchor = {};
@@ -8,7 +8,7 @@ nglr.Binder = function(doc, widgetFactory, urlWatcher, config) {
88
this.updateListeners = [];
99
};
1010

11-
nglr.Binder.parseBindings = function(string) {
11+
Binder.parseBindings = function(string) {
1212
var results = [];
1313
var lastIndex = 0;
1414
var index;
@@ -28,18 +28,18 @@ nglr.Binder.parseBindings = function(string) {
2828
return results.length === 0 ? [ string ] : results;
2929
};
3030

31-
nglr.Binder.hasBinding = function(string) {
32-
var bindings = nglr.Binder.parseBindings(string);
33-
return bindings.length > 1 || nglr.Binder.binding(bindings[0]) !== null;
31+
Binder.hasBinding = function(string) {
32+
var bindings = Binder.parseBindings(string);
33+
return bindings.length > 1 || Binder.binding(bindings[0]) !== null;
3434
};
3535

36-
nglr.Binder.binding = function(string) {
36+
Binder.binding = function(string) {
3737
var binding = string.replace(/\n/gm, ' ').match(/^\{\{(.*)\}\}$/);
3838
return binding ? binding[1] : null;
3939
};
4040

4141

42-
nglr.Binder.prototype.parseQueryString = function(query) {
42+
Binder.prototype.parseQueryString = function(query) {
4343
var params = {};
4444
query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,
4545
function (match, left, right) {
@@ -48,7 +48,7 @@ nglr.Binder.prototype.parseQueryString = function(query) {
4848
return params;
4949
};
5050

51-
nglr.Binder.prototype.parseAnchor = function(url) {
51+
Binder.prototype.parseAnchor = function(url) {
5252
var self = this;
5353
url = url || this.urlWatcher.getUrl();
5454

@@ -65,13 +65,13 @@ nglr.Binder.prototype.parseAnchor = function(url) {
6565
});
6666
};
6767

68-
nglr.Binder.prototype.onUrlChange = function (url) {
68+
Binder.prototype.onUrlChange = function (url) {
6969
console.log("URL change detected", url);
7070
this.parseAnchor(url);
7171
this.updateView();
7272
};
7373

74-
nglr.Binder.prototype.updateAnchor = function() {
74+
Binder.prototype.updateAnchor = function() {
7575
var url = this.urlWatcher.getUrl();
7676
var anchorIndex = url.indexOf('#');
7777
if (anchorIndex > -1)
@@ -93,7 +93,7 @@ nglr.Binder.prototype.updateAnchor = function() {
9393
return url;
9494
};
9595

96-
nglr.Binder.prototype.updateView = function() {
96+
Binder.prototype.updateView = function() {
9797
var start = new Date().getTime();
9898
var scope = jQuery(this.doc).scope();
9999
scope.set("$invalidWidgets", []);
@@ -103,7 +103,7 @@ nglr.Binder.prototype.updateView = function() {
103103
_.each(this.updateListeners, function(fn) {fn();});
104104
};
105105

106-
nglr.Binder.prototype.docFindWithSelf = function(exp){
106+
Binder.prototype.docFindWithSelf = function(exp){
107107
var doc = jQuery(this.doc);
108108
var selection = doc.find(exp);
109109
if (doc.is(exp)){
@@ -112,31 +112,31 @@ nglr.Binder.prototype.docFindWithSelf = function(exp){
112112
return selection;
113113
};
114114

115-
nglr.Binder.prototype.executeInit = function() {
115+
Binder.prototype.executeInit = function() {
116116
this.docFindWithSelf("[ng-init]").each(function() {
117117
var jThis = jQuery(this);
118118
var scope = jThis.scope();
119119
try {
120120
scope.eval(jThis.attr('ng-init'));
121121
} catch (e) {
122-
nglr.alert("EVAL ERROR:\n" + jThis.attr('ng-init') + '\n' + nglr.toJson(e, true));
122+
alert("EVAL ERROR:\n" + jThis.attr('ng-init') + '\n' + toJson(e, true));
123123
}
124124
});
125125
};
126126

127-
nglr.Binder.prototype.entity = function (scope) {
127+
Binder.prototype.entity = function (scope) {
128128
this.docFindWithSelf("[ng-entity]").attr("ng-watch", function() {
129129
try {
130130
var jNode = jQuery(this);
131131
var decl = scope.entity(jNode.attr("ng-entity"));
132132
return decl + (jNode.attr('ng-watch') || "");
133133
} catch (e) {
134-
nglr.alert(e);
134+
alert(e);
135135
}
136136
});
137137
};
138138

139-
nglr.Binder.prototype.compile = function() {
139+
Binder.prototype.compile = function() {
140140
var jNode = jQuery(this.doc);
141141
var self = this;
142142
if (this.config.autoSubmit) {
@@ -153,37 +153,37 @@ nglr.Binder.prototype.compile = function() {
153153
jNode.removeClass("ng-exception");
154154
} catch (e) {
155155
jNode.addClass("ng-exception");
156-
jNode.attr('ng-error', nglr.toJson(e, true));
156+
jNode.attr('ng-error', toJson(e, true));
157157
}
158158
self.updateView();
159159
return false;
160160
});
161161
};
162162

163-
nglr.Binder.prototype.translateBinding = function(node, parentPath, factories) {
163+
Binder.prototype.translateBinding = function(node, parentPath, factories) {
164164
var path = parentPath.concat();
165165
var offset = path.pop();
166-
var parts = nglr.Binder.parseBindings(node.nodeValue);
167-
if (parts.length > 1 || nglr.Binder.binding(parts[0])) {
166+
var parts = Binder.parseBindings(node.nodeValue);
167+
if (parts.length > 1 || Binder.binding(parts[0])) {
168168
var parent = node.parentNode;
169-
if (nglr.isLeafNode(parent)) {
169+
if (isLeafNode(parent)) {
170170
parent.setAttribute('ng-bind-template', node.nodeValue);
171171
factories.push({path:path, fn:function(node, scope, prefix) {
172-
return new nglr.BindUpdater(node, node.getAttribute('ng-bind-template'));
172+
return new BindUpdater(node, node.getAttribute('ng-bind-template'));
173173
}});
174174
} else {
175175
for (var i = 0; i < parts.length; i++) {
176176
var part = parts[i];
177-
var binding = nglr.Binder.binding(part);
177+
var binding = Binder.binding(part);
178178
var newNode;
179179
if (binding) {
180180
newNode = document.createElement("span");
181181
var jNewNode = jQuery(newNode);
182182
jNewNode.attr("ng-bind", binding);
183183
if (i === 0) {
184-
factories.push({path:path.concat(offset + i), fn:nglr.Binder.prototype.ng_bind});
184+
factories.push({path:path.concat(offset + i), fn:Binder.prototype.ng_bind});
185185
}
186-
} else if (nglr.msie && part.charAt(0) == ' ') {
186+
} else if (msie && part.charAt(0) == ' ') {
187187
newNode = document.createElement("span");
188188
newNode.innerHTML = '&nbsp;' + part.substring(1);
189189
} else {
@@ -196,7 +196,7 @@ nglr.Binder.prototype.translateBinding = function(node, parentPath, factories) {
196196
}
197197
};
198198

199-
nglr.Binder.prototype.precompile = function(root) {
199+
Binder.prototype.precompile = function(root) {
200200
var factories = [];
201201
this.precompileNode(root, [], factories);
202202
return function (template, scope, prefix) {
@@ -211,13 +211,13 @@ nglr.Binder.prototype.precompile = function(root) {
211211
try {
212212
scope.addWidget(factory.fn(node, scope, prefix));
213213
} catch (e) {
214-
nglr.alert(e);
214+
alert(e);
215215
}
216216
}
217217
};
218218
};
219219

220-
nglr.Binder.prototype.precompileNode = function(node, path, factories) {
220+
Binder.prototype.precompileNode = function(node, path, factories) {
221221
var nodeType = node.nodeType;
222222
if (nodeType == Node.TEXT_NODE) {
223223
this.translateBinding(node, path, factories);
@@ -234,19 +234,19 @@ nglr.Binder.prototype.precompileNode = function(node, path, factories) {
234234
if (attributes) {
235235
var bindings = node.getAttribute('ng-bind-attr');
236236
node.removeAttribute('ng-bind-attr');
237-
bindings = bindings ? nglr.fromJson(bindings) : {};
237+
bindings = bindings ? fromJson(bindings) : {};
238238
var attrLen = attributes.length;
239239
for (var i = 0; i < attrLen; i++) {
240240
var attr = attributes[i];
241241
var attrName = attr.name;
242242
// http://www.glennjones.net/Post/809/getAttributehrefbug.htm
243-
var attrValue = nglr.msie && attrName == 'href' ?
243+
var attrValue = msie && attrName == 'href' ?
244244
decodeURI(node.getAttribute(attrName, 2)) : attr.value;
245-
if (nglr.Binder.hasBinding(attrValue)) {
245+
if (Binder.hasBinding(attrValue)) {
246246
bindings[attrName] = attrValue;
247247
}
248248
}
249-
var json = nglr.toJson(bindings);
249+
var json = toJson(bindings);
250250
if (json.length > 2) {
251251
node.setAttribute("ng-bind-attr", json);
252252
}
@@ -270,7 +270,7 @@ nglr.Binder.prototype.precompileNode = function(node, path, factories) {
270270
return clone;
271271
};
272272
factories.push({path:path, fn:function(node, scope, prefix) {
273-
return new nglr.RepeaterUpdater(jQuery(node), repeaterExpression, template, prefix);
273+
return new RepeaterUpdater(jQuery(node), repeaterExpression, template, prefix);
274274
}});
275275
return;
276276
}
@@ -309,42 +309,42 @@ nglr.Binder.prototype.precompileNode = function(node, path, factories) {
309309
}
310310
};
311311

312-
nglr.Binder.prototype.ng_eval = function(node) {
313-
return new nglr.EvalUpdater(node, node.getAttribute('ng-eval'));
312+
Binder.prototype.ng_eval = function(node) {
313+
return new EvalUpdater(node, node.getAttribute('ng-eval'));
314314
};
315315

316-
nglr.Binder.prototype.ng_bind = function(node) {
317-
return new nglr.BindUpdater(node, "{{" + node.getAttribute('ng-bind') + "}}");
316+
Binder.prototype.ng_bind = function(node) {
317+
return new BindUpdater(node, "{{" + node.getAttribute('ng-bind') + "}}");
318318
};
319319

320-
nglr.Binder.prototype.ng_bind_attr = function(node) {
321-
return new nglr.BindAttrUpdater(node, nglr.fromJson(node.getAttribute('ng-bind-attr')));
320+
Binder.prototype.ng_bind_attr = function(node) {
321+
return new BindAttrUpdater(node, fromJson(node.getAttribute('ng-bind-attr')));
322322
};
323323

324-
nglr.Binder.prototype.ng_hide = function(node) {
325-
return new nglr.HideUpdater(node, node.getAttribute('ng-hide'));
324+
Binder.prototype.ng_hide = function(node) {
325+
return new HideUpdater(node, node.getAttribute('ng-hide'));
326326
};
327327

328-
nglr.Binder.prototype.ng_show = function(node) {
329-
return new nglr.ShowUpdater(node, node.getAttribute('ng-show'));
328+
Binder.prototype.ng_show = function(node) {
329+
return new ShowUpdater(node, node.getAttribute('ng-show'));
330330
};
331331

332-
nglr.Binder.prototype.ng_class = function(node) {
333-
return new nglr.ClassUpdater(node, node.getAttribute('ng-class'));
332+
Binder.prototype.ng_class = function(node) {
333+
return new ClassUpdater(node, node.getAttribute('ng-class'));
334334
};
335335

336-
nglr.Binder.prototype.ng_class_even = function(node) {
337-
return new nglr.ClassEvenUpdater(node, node.getAttribute('ng-class-even'));
336+
Binder.prototype.ng_class_even = function(node) {
337+
return new ClassEvenUpdater(node, node.getAttribute('ng-class-even'));
338338
};
339339

340-
nglr.Binder.prototype.ng_class_odd = function(node) {
341-
return new nglr.ClassOddUpdater(node, node.getAttribute('ng-class-odd'));
340+
Binder.prototype.ng_class_odd = function(node) {
341+
return new ClassOddUpdater(node, node.getAttribute('ng-class-odd'));
342342
};
343343

344-
nglr.Binder.prototype.ng_style = function(node) {
345-
return new nglr.StyleUpdater(node, node.getAttribute('ng-style'));
344+
Binder.prototype.ng_style = function(node) {
345+
return new StyleUpdater(node, node.getAttribute('ng-style'));
346346
};
347347

348-
nglr.Binder.prototype.ng_watch = function(node, scope) {
348+
Binder.prototype.ng_watch = function(node, scope) {
349349
scope.watch(node.getAttribute('ng-watch'));
350350
};

0 commit comments

Comments
 (0)