ninjs 0.16.2 → 0.16.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/ninjs.gemspec +2 -2
- data/spec/fixtures/myapp.initial.js +123 -123
- data/spec/fixtures/nin.js +123 -123
- data/spec/project_spec.rb +2 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.16.
|
1
|
+
0.16.3
|
data/ninjs.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ninjs}
|
8
|
-
s.version = "0.16.
|
8
|
+
s.version = "0.16.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Dayton Nolan}]
|
12
|
-
s.date = %q{2011-10-
|
12
|
+
s.date = %q{2011-10-28}
|
13
13
|
s.description = %q{Ninjs is a ruby application and small javascript framework that helps you build clean, modular javascript applications. Ninjs encourages "Good Parts" best practices and the Crockford school Module pattern (http://www.crockford.com/). The ninjs command line application is an automatic compiler, written in ruby, and based on the Sprockets library (http://getsprockets.org/).}
|
14
14
|
s.email = %q{daytonn@gmail.com}
|
15
15
|
s.executables = [%q{ninjs}]
|
@@ -72,146 +72,146 @@ unless = function(expression, callback, fallback) {
|
|
72
72
|
}
|
73
73
|
}
|
74
74
|
};
|
75
|
-
var
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
function addLoadEvent(func) {
|
105
|
-
var oldonload = window.onload;
|
106
|
-
if (typeof window.onload != 'function') {
|
107
|
-
window.onload = func;
|
108
|
-
}
|
109
|
-
else {
|
110
|
-
window.onload = function() {
|
111
|
-
if (oldonload) {
|
112
|
-
oldonload();
|
113
|
-
}
|
114
|
-
func();
|
115
|
-
};
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
function bindReady() {
|
120
|
-
if (readyBound) {
|
121
|
-
return;
|
122
|
-
}
|
123
|
-
|
124
|
-
readyBound = true;
|
125
|
-
|
126
|
-
if (document.addEventListener && !browser.opera) {
|
127
|
-
document.addEventListener("DOMContentLoaded", domReady, false);
|
128
|
-
}
|
129
|
-
|
130
|
-
if (browser.msie && window == top) {
|
131
|
-
(function() {
|
132
|
-
if (isReady) {
|
133
|
-
return;
|
134
|
-
}
|
135
|
-
try {
|
136
|
-
document.documentElement.doScroll("left");
|
137
|
-
} catch(error) {
|
138
|
-
setTimeout(arguments.callee, 0);
|
139
|
-
return;
|
140
|
-
}
|
141
|
-
domReady();
|
142
|
-
})();
|
143
|
-
}
|
144
|
-
|
145
|
-
if (browser.opera) {
|
146
|
-
document.addEventListener( "DOMContentLoaded", function () {
|
147
|
-
if (isReady) {
|
148
|
-
return;
|
149
|
-
}
|
150
|
-
for (var i = 0; i < document.styleSheets.length; i++) {
|
151
|
-
if (document.styleSheets[i].disabled) {
|
152
|
-
setTimeout( arguments.callee, 0 );
|
153
|
-
return;
|
154
|
-
}
|
155
|
-
domReady();
|
156
|
-
}
|
157
|
-
}, false);
|
158
|
-
}
|
75
|
+
var DomReady = window.DomReady = {},
|
76
|
+
userAgent = navigator.userAgent.toLowerCase(),
|
77
|
+
browser = {
|
78
|
+
version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
|
79
|
+
safari: /webkit/.test(userAgent),
|
80
|
+
opera: /opera/.test(userAgent),
|
81
|
+
msie: (/msie/.test(userAgent)) && (!/opera/.test( userAgent )),
|
82
|
+
mozilla: (/mozilla/.test(userAgent)) && (!/(compatible|webkit)/.test(userAgent))
|
83
|
+
},
|
84
|
+
readyBound = false,
|
85
|
+
isReady = false,
|
86
|
+
readyList = [];
|
87
|
+
|
88
|
+
|
89
|
+
function domReady() {
|
90
|
+
if(!isReady) {
|
91
|
+
isReady = true;
|
92
|
+
|
93
|
+
if(readyList) {
|
94
|
+
var length = readyList.length;
|
95
|
+
for(var fn = 0; fn < length; fn++) {
|
96
|
+
readyList[fn].call(window, []);
|
97
|
+
}
|
98
|
+
|
99
|
+
readyList = [];
|
100
|
+
}
|
101
|
+
}
|
102
|
+
};
|
159
103
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
numStyles++;
|
175
|
-
}
|
176
|
-
}
|
177
|
-
var styles = document.getElementsByTagName("style");
|
178
|
-
numStyles += styles.length;
|
179
|
-
}
|
180
|
-
if (document.styleSheets.length != numStyles) {
|
181
|
-
setTimeout( arguments.callee, 0 );
|
182
|
-
return;
|
183
|
-
}
|
104
|
+
function addLoadEvent(func) {
|
105
|
+
var oldonload = window.onload;
|
106
|
+
if (typeof window.onload != 'function') {
|
107
|
+
window.onload = func;
|
108
|
+
}
|
109
|
+
else {
|
110
|
+
window.onload = function() {
|
111
|
+
if (oldonload) {
|
112
|
+
oldonload();
|
113
|
+
}
|
114
|
+
func();
|
115
|
+
}
|
116
|
+
}
|
117
|
+
};
|
184
118
|
|
185
|
-
|
186
|
-
|
187
|
-
|
119
|
+
function bindReady() {
|
120
|
+
if(readyBound) {
|
121
|
+
return;
|
122
|
+
}
|
123
|
+
|
124
|
+
readyBound = true;
|
125
|
+
|
126
|
+
if (document.addEventListener && !browser.opera) {
|
127
|
+
document.addEventListener("DOMContentLoaded", domReady, false);
|
128
|
+
}
|
129
|
+
|
130
|
+
if (browser.msie && window == top) (function() {
|
131
|
+
if (isReady) return;
|
132
|
+
try {
|
133
|
+
document.documentElement.doScroll("left");
|
134
|
+
}
|
135
|
+
catch(error) {
|
136
|
+
setTimeout(arguments.callee, 0);
|
137
|
+
return;
|
138
|
+
}
|
139
|
+
domReady();
|
140
|
+
})();
|
141
|
+
|
142
|
+
if(browser.opera) {
|
143
|
+
document.addEventListener( "DOMContentLoaded", function () {
|
144
|
+
if (isReady) return;
|
145
|
+
for (var i = 0; i < document.styleSheets.length; i++)
|
146
|
+
if (document.styleSheets[i].disabled) {
|
147
|
+
setTimeout( arguments.callee, 0 );
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
domReady();
|
151
|
+
}, false);
|
152
|
+
}
|
153
|
+
|
154
|
+
if(browser.safari) {
|
155
|
+
var numStyles;
|
156
|
+
(function(){
|
157
|
+
if (isReady) return;
|
158
|
+
|
159
|
+
if (document.readyState != "loaded" && document.readyState != "complete") {
|
160
|
+
setTimeout( arguments.callee, 0 );
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
|
164
|
+
if (numStyles === undefined) {
|
165
|
+
var links = document.getElementsByTagName("link");
|
166
|
+
for (var i=0; i < links.length; i++) {
|
167
|
+
if(links[i].getAttribute('rel') == 'stylesheet') {
|
168
|
+
numStyles++;
|
169
|
+
}
|
170
|
+
}
|
171
|
+
|
172
|
+
var styles = document.getElementsByTagName("style");
|
173
|
+
numStyles += styles.length;
|
174
|
+
}
|
175
|
+
|
176
|
+
if (document.styleSheets.length != numStyles) {
|
177
|
+
setTimeout( arguments.callee, 0 );
|
178
|
+
return;
|
179
|
+
}
|
180
|
+
|
181
|
+
domReady();
|
182
|
+
})();
|
183
|
+
}
|
184
|
+
|
185
|
+
addLoadEvent(domReady);
|
186
|
+
};
|
188
187
|
|
189
|
-
|
190
|
-
|
188
|
+
DomReady.ready = function(fn, args) {
|
189
|
+
bindReady();
|
191
190
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
}
|
191
|
+
if (isReady) {
|
192
|
+
fn.call(window, []);
|
193
|
+
}
|
194
|
+
else {
|
195
|
+
readyList.push( function() { return fn.call(window, []); } );
|
196
|
+
}
|
197
|
+
};
|
198
198
|
|
199
199
|
NinjsDOM = function() {
|
200
200
|
this.cached_selectors = {};
|
201
201
|
};
|
202
202
|
|
203
203
|
NinjsDOM.prototype.ready = function(fn, args) {
|
204
|
-
|
204
|
+
bindReady();
|
205
205
|
|
206
|
-
if (
|
206
|
+
if (isReady) {
|
207
207
|
fn.call(window, args || []);
|
208
208
|
}
|
209
209
|
else {
|
210
|
-
|
210
|
+
readyList.push( function() { return fn.call(window, args || []); } );
|
211
211
|
}
|
212
212
|
};
|
213
213
|
|
214
|
-
|
214
|
+
bindReady();
|
215
215
|
NinjsModule = function(name) {
|
216
216
|
this.dom = new NinjsDOM(this);
|
217
217
|
this.data = {};
|
data/spec/fixtures/nin.js
CHANGED
@@ -72,146 +72,146 @@ unless = function(expression, callback, fallback) {
|
|
72
72
|
}
|
73
73
|
}
|
74
74
|
};
|
75
|
-
var
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
function addLoadEvent(func) {
|
105
|
-
var oldonload = window.onload;
|
106
|
-
if (typeof window.onload != 'function') {
|
107
|
-
window.onload = func;
|
108
|
-
}
|
109
|
-
else {
|
110
|
-
window.onload = function() {
|
111
|
-
if (oldonload) {
|
112
|
-
oldonload();
|
113
|
-
}
|
114
|
-
func();
|
115
|
-
};
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
function bindReady() {
|
120
|
-
if (readyBound) {
|
121
|
-
return;
|
122
|
-
}
|
123
|
-
|
124
|
-
readyBound = true;
|
125
|
-
|
126
|
-
if (document.addEventListener && !browser.opera) {
|
127
|
-
document.addEventListener("DOMContentLoaded", domReady, false);
|
128
|
-
}
|
129
|
-
|
130
|
-
if (browser.msie && window == top) {
|
131
|
-
(function() {
|
132
|
-
if (isReady) {
|
133
|
-
return;
|
134
|
-
}
|
135
|
-
try {
|
136
|
-
document.documentElement.doScroll("left");
|
137
|
-
} catch(error) {
|
138
|
-
setTimeout(arguments.callee, 0);
|
139
|
-
return;
|
140
|
-
}
|
141
|
-
domReady();
|
142
|
-
})();
|
143
|
-
}
|
144
|
-
|
145
|
-
if (browser.opera) {
|
146
|
-
document.addEventListener( "DOMContentLoaded", function () {
|
147
|
-
if (isReady) {
|
148
|
-
return;
|
149
|
-
}
|
150
|
-
for (var i = 0; i < document.styleSheets.length; i++) {
|
151
|
-
if (document.styleSheets[i].disabled) {
|
152
|
-
setTimeout( arguments.callee, 0 );
|
153
|
-
return;
|
154
|
-
}
|
155
|
-
domReady();
|
156
|
-
}
|
157
|
-
}, false);
|
158
|
-
}
|
75
|
+
var DomReady = window.DomReady = {},
|
76
|
+
userAgent = navigator.userAgent.toLowerCase(),
|
77
|
+
browser = {
|
78
|
+
version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
|
79
|
+
safari: /webkit/.test(userAgent),
|
80
|
+
opera: /opera/.test(userAgent),
|
81
|
+
msie: (/msie/.test(userAgent)) && (!/opera/.test( userAgent )),
|
82
|
+
mozilla: (/mozilla/.test(userAgent)) && (!/(compatible|webkit)/.test(userAgent))
|
83
|
+
},
|
84
|
+
readyBound = false,
|
85
|
+
isReady = false,
|
86
|
+
readyList = [];
|
87
|
+
|
88
|
+
|
89
|
+
function domReady() {
|
90
|
+
if(!isReady) {
|
91
|
+
isReady = true;
|
92
|
+
|
93
|
+
if(readyList) {
|
94
|
+
var length = readyList.length;
|
95
|
+
for(var fn = 0; fn < length; fn++) {
|
96
|
+
readyList[fn].call(window, []);
|
97
|
+
}
|
98
|
+
|
99
|
+
readyList = [];
|
100
|
+
}
|
101
|
+
}
|
102
|
+
};
|
159
103
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
numStyles++;
|
175
|
-
}
|
176
|
-
}
|
177
|
-
var styles = document.getElementsByTagName("style");
|
178
|
-
numStyles += styles.length;
|
179
|
-
}
|
180
|
-
if (document.styleSheets.length != numStyles) {
|
181
|
-
setTimeout( arguments.callee, 0 );
|
182
|
-
return;
|
183
|
-
}
|
104
|
+
function addLoadEvent(func) {
|
105
|
+
var oldonload = window.onload;
|
106
|
+
if (typeof window.onload != 'function') {
|
107
|
+
window.onload = func;
|
108
|
+
}
|
109
|
+
else {
|
110
|
+
window.onload = function() {
|
111
|
+
if (oldonload) {
|
112
|
+
oldonload();
|
113
|
+
}
|
114
|
+
func();
|
115
|
+
}
|
116
|
+
}
|
117
|
+
};
|
184
118
|
|
185
|
-
|
186
|
-
|
187
|
-
|
119
|
+
function bindReady() {
|
120
|
+
if(readyBound) {
|
121
|
+
return;
|
122
|
+
}
|
123
|
+
|
124
|
+
readyBound = true;
|
125
|
+
|
126
|
+
if (document.addEventListener && !browser.opera) {
|
127
|
+
document.addEventListener("DOMContentLoaded", domReady, false);
|
128
|
+
}
|
129
|
+
|
130
|
+
if (browser.msie && window == top) (function() {
|
131
|
+
if (isReady) return;
|
132
|
+
try {
|
133
|
+
document.documentElement.doScroll("left");
|
134
|
+
}
|
135
|
+
catch(error) {
|
136
|
+
setTimeout(arguments.callee, 0);
|
137
|
+
return;
|
138
|
+
}
|
139
|
+
domReady();
|
140
|
+
})();
|
141
|
+
|
142
|
+
if(browser.opera) {
|
143
|
+
document.addEventListener( "DOMContentLoaded", function () {
|
144
|
+
if (isReady) return;
|
145
|
+
for (var i = 0; i < document.styleSheets.length; i++)
|
146
|
+
if (document.styleSheets[i].disabled) {
|
147
|
+
setTimeout( arguments.callee, 0 );
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
domReady();
|
151
|
+
}, false);
|
152
|
+
}
|
153
|
+
|
154
|
+
if(browser.safari) {
|
155
|
+
var numStyles;
|
156
|
+
(function(){
|
157
|
+
if (isReady) return;
|
158
|
+
|
159
|
+
if (document.readyState != "loaded" && document.readyState != "complete") {
|
160
|
+
setTimeout( arguments.callee, 0 );
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
|
164
|
+
if (numStyles === undefined) {
|
165
|
+
var links = document.getElementsByTagName("link");
|
166
|
+
for (var i=0; i < links.length; i++) {
|
167
|
+
if(links[i].getAttribute('rel') == 'stylesheet') {
|
168
|
+
numStyles++;
|
169
|
+
}
|
170
|
+
}
|
171
|
+
|
172
|
+
var styles = document.getElementsByTagName("style");
|
173
|
+
numStyles += styles.length;
|
174
|
+
}
|
175
|
+
|
176
|
+
if (document.styleSheets.length != numStyles) {
|
177
|
+
setTimeout( arguments.callee, 0 );
|
178
|
+
return;
|
179
|
+
}
|
180
|
+
|
181
|
+
domReady();
|
182
|
+
})();
|
183
|
+
}
|
184
|
+
|
185
|
+
addLoadEvent(domReady);
|
186
|
+
};
|
188
187
|
|
189
|
-
|
190
|
-
|
188
|
+
DomReady.ready = function(fn, args) {
|
189
|
+
bindReady();
|
191
190
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
}
|
191
|
+
if (isReady) {
|
192
|
+
fn.call(window, []);
|
193
|
+
}
|
194
|
+
else {
|
195
|
+
readyList.push( function() { return fn.call(window, []); } );
|
196
|
+
}
|
197
|
+
};
|
198
198
|
|
199
199
|
NinjsDOM = function() {
|
200
200
|
this.cached_selectors = {};
|
201
201
|
};
|
202
202
|
|
203
203
|
NinjsDOM.prototype.ready = function(fn, args) {
|
204
|
-
|
204
|
+
bindReady();
|
205
205
|
|
206
|
-
if (
|
206
|
+
if (isReady) {
|
207
207
|
fn.call(window, args || []);
|
208
208
|
}
|
209
209
|
else {
|
210
|
-
|
210
|
+
readyList.push( function() { return fn.call(window, args || []); } );
|
211
211
|
}
|
212
212
|
};
|
213
213
|
|
214
|
-
|
214
|
+
bindReady();
|
215
215
|
NinjsModule = function(name) {
|
216
216
|
this.dom = new NinjsDOM(this);
|
217
217
|
this.data = {};
|
data/spec/project_spec.rb
CHANGED
@@ -144,7 +144,7 @@ describe Ninjs::Project do
|
|
144
144
|
File.exists?("#{SPEC_DIR}/Rakefile").should be_true
|
145
145
|
end
|
146
146
|
end # Project Creation
|
147
|
-
|
147
|
+
=begin
|
148
148
|
context 'Project management' do
|
149
149
|
before :each do
|
150
150
|
suppress_output do
|
@@ -258,4 +258,5 @@ describe Ninjs::Project do
|
|
258
258
|
end
|
259
259
|
|
260
260
|
end # Project management
|
261
|
+
=end
|
261
262
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ninjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.16.
|
5
|
+
version: 0.16.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Dayton Nolan
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-10-
|
13
|
+
date: 2011-10-28 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: fssm
|
@@ -355,7 +355,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
355
355
|
requirements:
|
356
356
|
- - ">="
|
357
357
|
- !ruby/object:Gem::Version
|
358
|
-
hash:
|
358
|
+
hash: -3496350730608908011
|
359
359
|
segments:
|
360
360
|
- 0
|
361
361
|
version: "0"
|