zfben_rails_assets 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/example/.sass-cache/686d48c4bb3405df08bdcc662a0722bb96d63df5/test.sassc +0 -0
- data/example/.sass-cache/7a5615116aa96cc45242210dec5b677975f46879/reset.sassc +0 -0
- data/example/app/assets/javascripts/reset.sass +1 -0
- data/example/app/assets/javascripts/test.js +2 -3
- data/example/{vendor/assets/stylesheets/.gitkeep → app/assets/javascripts/zff.js} +0 -0
- data/example/app/assets/stylesheets/test.css +1 -0
- data/example/app/views/test/index.haml +1 -1
- data/{vendor/assets/javascripts/zzf → example/vendor/assets/javascripts/zff/core}/core.js +1 -3
- data/example/vendor/assets/javascripts/zff/core.js +1 -0
- data/{vendor/assets/javascripts/jquery/jquery.js → example/vendor/assets/javascripts/zff/lib/jquery/core.js} +0 -0
- data/{vendor/assets/javascripts/jqGrid.js → example/vendor/assets/javascripts/zff/lib/jquery/grid.js} +0 -0
- data/{vendor/assets/javascripts/jquery/jquery-ui.js → example/vendor/assets/javascripts/zff/lib/jquery/ui.js} +0 -0
- data/{vendor/assets/javascripts/underscore/underscore.js → example/vendor/assets/javascripts/zff/lib/underscore/core.js} +0 -0
- data/{vendor/assets/javascripts/zzf-spec → example/vendor/assets/javascripts/zff/spec}/core.js +4 -4
- data/{vendor/assets/javascripts/qunit → example/vendor/assets/javascripts/zff/spec}/qunit.js +0 -0
- data/example/vendor/assets/javascripts/zff/spec.js +2 -0
- data/example/vendor/assets/javascripts/zff.js +0 -0
- data/{vendor/assets/stylesheets → example/vendor/assets/stylesheets/zff/lib}/qunit.css +0 -0
- data/example/vendor/assets/stylesheets/zff/reset.sass +1 -0
- data/example/vendor/assets/stylesheets/zff/spec.css +1 -0
- data/lib/zfben_rails_assets/Gemfile +12 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/core/core.js +57 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/core.js +1 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/lib/jquery/core.js +8936 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/lib/jquery/grid.js +467 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/lib/jquery/ui.js +11631 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/lib/underscore/core.js +807 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/spec/core.js +38 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/spec/qunit.js +1448 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff/spec.js +2 -0
- data/lib/zfben_rails_assets/assets/javascripts/zff.js +0 -0
- data/lib/zfben_rails_assets/assets/stylesheets/zff/lib/qunit.css +225 -0
- data/lib/zfben_rails_assets/assets/stylesheets/zff/reset.sass +1 -0
- data/lib/zfben_rails_assets/assets/stylesheets/zff/spec.css +1 -0
- data/lib/zfben_rails_assets/config/compass.rb +11 -0
- data/lib/zfben_rails_assets/config/sass.rb +4 -0
- data/lib/zfben_rails_assets/tasks.rb +72 -0
- data/lib/zfben_rails_assets/version.rb +1 -1
- data/lib/zfben_rails_assets.rb +6 -2
- data/zfben_rails_assets.gemspec +0 -2
- metadata +44 -42
- data/vendor/assets/javascripts/jasmine/jasmine-html.js +0 -190
- data/vendor/assets/javascripts/jasmine/jasmine.js +0 -2445
- data/vendor/assets/javascripts/jasmine/mock-ajax.js +0 -114
- data/vendor/assets/javascripts/jasmine/spec-helper.js +0 -19
- data/vendor/assets/javascripts/jasmine.js +0 -4
- data/vendor/assets/javascripts/jquery/jquery-ui.js.1 +0 -843
- data/vendor/assets/javascripts/jquery.js +0 -1
- data/vendor/assets/javascripts/qunit.js +0 -1
- data/vendor/assets/javascripts/underscore.js +0 -1
- data/vendor/assets/javascripts/zzf/underscore.js +0 -6
- data/vendor/assets/javascripts/zzf-spec.js +0 -1
- data/vendor/assets/javascripts/zzf.js +0 -1
- data/vendor/assets/stylesheets/jasmine.css +0 -166
data/.gitignore
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
@import zff/reset
|
@@ -1,3 +1,2 @@
|
|
1
|
-
//= require
|
2
|
-
//= require
|
3
|
-
//= require zzf-spec
|
1
|
+
//= require zff/spec
|
2
|
+
//= require zff/core
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
/*= require zff/spec */
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require zff/core/core
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/{vendor/assets/javascripts/zzf-spec → example/vendor/assets/javascripts/zff/spec}/core.js
RENAMED
@@ -8,17 +8,17 @@ module('Load module');
|
|
8
8
|
|
9
9
|
asyncTest('success load', function(){
|
10
10
|
|
11
|
-
ok($.load('underscore') === 202, 'underscore is not loaded');
|
11
|
+
ok($.load('zff/lib/underscore/core') === 202, 'underscore is not loaded');
|
12
12
|
|
13
13
|
var i = 0;
|
14
14
|
|
15
|
-
$.load('underscore', function(){
|
15
|
+
$.load('zff/lib/underscore/core', function(){
|
16
16
|
ok($.isFunction(_), '_ is loaded');
|
17
|
-
ok($.load('underscore') === 200, 'underscore loaded');
|
17
|
+
ok($.load('zff/lib/underscore/core') === 200, 'zff/lib/underscore/core loaded');
|
18
18
|
i++;
|
19
19
|
ok(i === 1, 'success func is loaded');
|
20
20
|
});
|
21
|
-
$.load('underscore', function(){
|
21
|
+
$.load('zff/lib/underscore/core', function(){
|
22
22
|
i++;
|
23
23
|
ok(i === 2, 'twice success func is loaded');
|
24
24
|
start();
|
data/{vendor/assets/javascripts/qunit → example/vendor/assets/javascripts/zff/spec}/qunit.js
RENAMED
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
@import compass/reset
|
@@ -0,0 +1 @@
|
|
1
|
+
/*= require zff/lib/qunit */
|
@@ -0,0 +1,57 @@
|
|
1
|
+
//= require zff/lib/jquery/core
|
2
|
+
|
3
|
+
var MODULE_PATH = '/assets';
|
4
|
+
|
5
|
+
// load module
|
6
|
+
// $.load(module_name, success_function)
|
7
|
+
// $.load(module_name, ajax_options)
|
8
|
+
|
9
|
+
(function($){
|
10
|
+
|
11
|
+
var info = {};
|
12
|
+
|
13
|
+
$.load = function(module, opts){
|
14
|
+
opts = opts || {};
|
15
|
+
|
16
|
+
if($.isFunction(opts)){
|
17
|
+
opts = {
|
18
|
+
success: opts
|
19
|
+
};
|
20
|
+
}
|
21
|
+
|
22
|
+
if(typeof info[module] === 'undefined'){
|
23
|
+
var defaults = {
|
24
|
+
url: MODULE_PATH + '/' + module + '.js',
|
25
|
+
dataType: 'script'
|
26
|
+
};
|
27
|
+
|
28
|
+
opts = $.extend(defaults, opts);
|
29
|
+
|
30
|
+
var xhr = $.ajax(opts).success(function(){
|
31
|
+
info[module].state = 200;
|
32
|
+
}).error(function(){
|
33
|
+
info[module].state = 500;
|
34
|
+
});
|
35
|
+
|
36
|
+
info[module] = {
|
37
|
+
state: 202,
|
38
|
+
xhr: xhr
|
39
|
+
};
|
40
|
+
}else{
|
41
|
+
if(info[module].state === 200){
|
42
|
+
if($.isFunction(opts.success)){
|
43
|
+
opts.success();
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
if(info[module].state === 202){
|
48
|
+
$.each(['success', 'error', 'complete', 'statusCode'], function(i, type){
|
49
|
+
if($.isFunction(opts[type])){
|
50
|
+
info[module].xhr = info[module].xhr[type](opts[type]);
|
51
|
+
}
|
52
|
+
});
|
53
|
+
}
|
54
|
+
}
|
55
|
+
return info[module].state;
|
56
|
+
};
|
57
|
+
})($);
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require zff/core/core
|