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.
Files changed (55) hide show
  1. data/.gitignore +4 -0
  2. data/example/.sass-cache/686d48c4bb3405df08bdcc662a0722bb96d63df5/test.sassc +0 -0
  3. data/example/.sass-cache/7a5615116aa96cc45242210dec5b677975f46879/reset.sassc +0 -0
  4. data/example/app/assets/javascripts/reset.sass +1 -0
  5. data/example/app/assets/javascripts/test.js +2 -3
  6. data/example/{vendor/assets/stylesheets/.gitkeep → app/assets/javascripts/zff.js} +0 -0
  7. data/example/app/assets/stylesheets/test.css +1 -0
  8. data/example/app/views/test/index.haml +1 -1
  9. data/{vendor/assets/javascripts/zzf → example/vendor/assets/javascripts/zff/core}/core.js +1 -3
  10. data/example/vendor/assets/javascripts/zff/core.js +1 -0
  11. data/{vendor/assets/javascripts/jquery/jquery.js → example/vendor/assets/javascripts/zff/lib/jquery/core.js} +0 -0
  12. data/{vendor/assets/javascripts/jqGrid.js → example/vendor/assets/javascripts/zff/lib/jquery/grid.js} +0 -0
  13. data/{vendor/assets/javascripts/jquery/jquery-ui.js → example/vendor/assets/javascripts/zff/lib/jquery/ui.js} +0 -0
  14. data/{vendor/assets/javascripts/underscore/underscore.js → example/vendor/assets/javascripts/zff/lib/underscore/core.js} +0 -0
  15. data/{vendor/assets/javascripts/zzf-spec → example/vendor/assets/javascripts/zff/spec}/core.js +4 -4
  16. data/{vendor/assets/javascripts/qunit → example/vendor/assets/javascripts/zff/spec}/qunit.js +0 -0
  17. data/example/vendor/assets/javascripts/zff/spec.js +2 -0
  18. data/example/vendor/assets/javascripts/zff.js +0 -0
  19. data/{vendor/assets/stylesheets → example/vendor/assets/stylesheets/zff/lib}/qunit.css +0 -0
  20. data/example/vendor/assets/stylesheets/zff/reset.sass +1 -0
  21. data/example/vendor/assets/stylesheets/zff/spec.css +1 -0
  22. data/lib/zfben_rails_assets/Gemfile +12 -0
  23. data/lib/zfben_rails_assets/assets/javascripts/zff/core/core.js +57 -0
  24. data/lib/zfben_rails_assets/assets/javascripts/zff/core.js +1 -0
  25. data/lib/zfben_rails_assets/assets/javascripts/zff/lib/jquery/core.js +8936 -0
  26. data/lib/zfben_rails_assets/assets/javascripts/zff/lib/jquery/grid.js +467 -0
  27. data/lib/zfben_rails_assets/assets/javascripts/zff/lib/jquery/ui.js +11631 -0
  28. data/lib/zfben_rails_assets/assets/javascripts/zff/lib/underscore/core.js +807 -0
  29. data/lib/zfben_rails_assets/assets/javascripts/zff/spec/core.js +38 -0
  30. data/lib/zfben_rails_assets/assets/javascripts/zff/spec/qunit.js +1448 -0
  31. data/lib/zfben_rails_assets/assets/javascripts/zff/spec.js +2 -0
  32. data/lib/zfben_rails_assets/assets/javascripts/zff.js +0 -0
  33. data/lib/zfben_rails_assets/assets/stylesheets/zff/lib/qunit.css +225 -0
  34. data/lib/zfben_rails_assets/assets/stylesheets/zff/reset.sass +1 -0
  35. data/lib/zfben_rails_assets/assets/stylesheets/zff/spec.css +1 -0
  36. data/lib/zfben_rails_assets/config/compass.rb +11 -0
  37. data/lib/zfben_rails_assets/config/sass.rb +4 -0
  38. data/lib/zfben_rails_assets/tasks.rb +72 -0
  39. data/lib/zfben_rails_assets/version.rb +1 -1
  40. data/lib/zfben_rails_assets.rb +6 -2
  41. data/zfben_rails_assets.gemspec +0 -2
  42. metadata +44 -42
  43. data/vendor/assets/javascripts/jasmine/jasmine-html.js +0 -190
  44. data/vendor/assets/javascripts/jasmine/jasmine.js +0 -2445
  45. data/vendor/assets/javascripts/jasmine/mock-ajax.js +0 -114
  46. data/vendor/assets/javascripts/jasmine/spec-helper.js +0 -19
  47. data/vendor/assets/javascripts/jasmine.js +0 -4
  48. data/vendor/assets/javascripts/jquery/jquery-ui.js.1 +0 -843
  49. data/vendor/assets/javascripts/jquery.js +0 -1
  50. data/vendor/assets/javascripts/qunit.js +0 -1
  51. data/vendor/assets/javascripts/underscore.js +0 -1
  52. data/vendor/assets/javascripts/zzf/underscore.js +0 -6
  53. data/vendor/assets/javascripts/zzf-spec.js +0 -1
  54. data/vendor/assets/javascripts/zzf.js +0 -1
  55. data/vendor/assets/stylesheets/jasmine.css +0 -166
data/.gitignore CHANGED
@@ -2,3 +2,7 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ example/app/assets/javascripts/zff
6
+ example/app/assets/stylesheets/zff
7
+ example/app/assets/images/zff
8
+ example/config/compass.rb
@@ -0,0 +1 @@
1
+ @import zff/reset
@@ -1,3 +1,2 @@
1
- //= require qunit
2
- //= require zzf
3
- //= require zzf-spec
1
+ //= require zff/spec
2
+ //= require zff/core
@@ -0,0 +1 @@
1
+ /*= require zff/spec */
@@ -1,7 +1,7 @@
1
1
  !!!
2
2
  %html
3
3
  %head
4
- %link(rel="stylesheet" href="/assets/qunit.css")
4
+ %link(rel="stylesheet" href="/assets/test.css")
5
5
  %body
6
6
  = javascript_include_tag :test
7
7
  %h1(id="qunit-header")
@@ -1,6 +1,4 @@
1
- //= require jquery
2
-
3
- // zzf-core
1
+ //= require zff/lib/jquery/core
4
2
 
5
3
  var MODULE_PATH = '/assets';
6
4
 
@@ -0,0 +1 @@
1
+ //= require zff/core/core
@@ -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();
@@ -0,0 +1,2 @@
1
+ //= require zff/spec/qunit
2
+ //= require zff/spec/core
File without changes
@@ -0,0 +1 @@
1
+ @import compass/reset
@@ -0,0 +1 @@
1
+ /*= require zff/lib/qunit */
@@ -0,0 +1,12 @@
1
+ # html
2
+ gem 'haml'
3
+ gem 'haml-coderay'
4
+ gem 'coderay_bash'
5
+
6
+ # css
7
+ gem 'compass'
8
+
9
+ # js
10
+ gem 'therubyracer'
11
+ gem 'coffee-script'
12
+ gem 'uglifier'
@@ -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