t3-rails 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +74 -0
- data/Rakefile +41 -0
- data/lib/generators/t3/behavior_generator.rb +17 -0
- data/lib/generators/t3/bootstrap_generator.rb +42 -0
- data/lib/generators/t3/generator_helper.rb +19 -0
- data/lib/generators/t3/module_generator.rb +17 -0
- data/lib/generators/t3/service_generator.rb +17 -0
- data/lib/generators/templates/behavior.js +45 -0
- data/lib/generators/templates/module.js +45 -0
- data/lib/generators/templates/service.js +45 -0
- data/lib/t3/rails.rb +8 -0
- data/lib/t3/rails/version.rb +6 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +27 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +79 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +56 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/log/development.log +4 -0
- data/test/dummy/log/test.log +3962 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/tmp/app/assets/javascripts/behaviors/validate.js +45 -0
- data/test/generators/behavior_generator_test.rb +21 -0
- data/test/generators/bootstrap_generator_test.rb +75 -0
- data/test/generators/module_generator_test.rb +21 -0
- data/test/generators/service_generator_test.rb +21 -0
- data/test/t3_rails_test.rb +13 -0
- data/test/test_helper.rb +18 -0
- data/vendor/assets/javascripts/t3-testing.js +459 -0
- data/vendor/assets/javascripts/t3.js +1233 -0
- data/vendor/assets/javascripts/t3.min.js +18 -0
- metadata +172 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
/*! t3 v 1.4.0*/
|
2
|
+
/*!
|
3
|
+
Copyright 2015 Box, Inc. All rights reserved.
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
You may obtain a copy of the License at
|
8
|
+
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
See the License for the specific language governing permissions and
|
15
|
+
limitations under the License.
|
16
|
+
*/
|
17
|
+
!function(e){var n={};if(n.EventTarget=function(){"use strict";function e(){this._handlers={}}return e.prototype={constructor:e,on:function(e,n){var t,r,o=this._handlers[e];for("undefined"==typeof o&&(o=this._handlers[e]=[]),t=0,r=o.length;r>t;t++)if(o[t]===n)return;o.push(n)},fire:function(e,n){var t,r,o,i={type:e,data:n};if(t=this._handlers[i.type],t instanceof Array)for(t=t.concat(),r=0,o=t.length;o>r;r++)t[r].call(this,i)},off:function(e,n){var t,r,o=this._handlers[e];if(o instanceof Array)for(t=0,r=o.length;r>t;t++)if(o[t]===n){o.splice(t,1);break}}},e}(),n.JQueryDOM=function(){"use strict";return{type:"jquery",query:function(e,n){return $(e).find(n)[0]||null},queryAll:function(e,n){return $.makeArray($(e).find(n))},on:function(e,n,t){$(e).on(n,t)},off:function(e,n,t){$(e).off(n,t)}}}(),n.DOM=n.JQueryDOM,n.Context=function(){"use strict";function e(e,n){this.application=e,this.element=n}return e.prototype={broadcast:function(e,n){this.application.broadcast(e,n)},getService:function(e){return this.application.getService(e)},getConfig:function(e){return this.application.getModuleConfig(this.element,e)},getGlobal:function(e){return this.application.getGlobal(e)},getGlobalConfig:function(e){return this.application.getGlobalConfig(e)},reportError:function(e){this.application.reportError(e)},getElement:function(){return this.element}},e}(),n.Application=function(){"use strict";function t(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}function r(e,n){return function(){return e.apply(n,arguments)}}function o(e,n){for(var t=0,r=e.length;r>t;t++)if(e[t]===n)return t;return-1}function i(){x={},E={},C={},A=[],M={},O={},S=!1;for(var e=0;e<D.length;e++)delete G[D[e]],delete n.Context.prototype[D[e]];D=[]}function a(e){for(var n=0,t=A.length;t>n;n++)if(A[n]===e)return!0;return!1}function u(e){if(x.debug)throw e;G.fire("error",{exception:e})}function f(e,n){var t,r;for(t in e)r=e[t],"function"==typeof r&&(e[t]=function(e,t){return function(){var r=n+"."+e+"() - ";try{return t.apply(this,arguments)}catch(o){o.name=r+o.name,o.message=r+o.message,u(o)}}}(t,r))}function s(e){var n=e.getAttribute("data-module");return n?n.split(" ")[0]:""}function c(e){return e&&e.hasAttribute("data-module")}function l(e){return e&&e.hasAttribute("data-type")}function d(e,n){"function"==typeof e[n]&&e[n].apply(e,Array.prototype.slice.call(arguments,2))}function p(e){var n=C[e];return n?a(e)?(u(new ReferenceError("Circular service dependency: "+A.join(" -> ")+" -> "+e)),null):(A.push(e),n.instance||(n.instance=n.creator(G)),A.pop(),n.instance):null}function h(e){var n,t,r,o,i=[];for(t=e.instance.behaviors||[],n=0;n<t.length;n++)"behaviorInstances"in e||(e.behaviorInstances={}),o=e.behaviorInstances,r=M[t[n]],r?(o[t[n]]||(o[t[n]]=r.creator(e.context)),i.push(o[t[n]])):u(new Error('Behavior "'+t[n]+'" not found'));return i}function g(e){for(var n=l(e);!n&&e&&!c(e);)e=e.parentNode,n=l(e);return n?e:null}function v(e,t,r){function o(e){for(var n=g(e.target),t=n?n.getAttribute("data-type"):"",o=0;o<r.length;o++)r[o](e,n,t);return!0}return n.DOM.on(e,t,o),o}function y(e){var n,t,o,i,a,u=h(e);for(n=0;n<j.length;n++){for(a=[],o=j[n],i="on"+o,e.instance[i]&&a.push(r(e.instance[i],e.instance)),t=0;t<u.length;t++)u[t][i]&&a.push(r(u[t][i],u[t]));a.length&&(e.eventHandlers[o]=v(e.element,o,a))}}function m(e){for(var t in e.eventHandlers)e.eventHandlers.hasOwnProperty(t)&&n.DOM.off(e.element,t,e.eventHandlers[t]);e.eventHandlers={}}function b(e){return O[e.id]}var w="[data-module]",x={},E={},A=[],C={},M={},O={},D=[],S=!1,G=new n.EventTarget,j=["click","mouseover","mouseout","mousedown","mouseup","mouseenter","mouseleave","keydown","keyup","submit","change","contextmenu","dblclick","input","focusin","focusout"];return t(G,{init:function(e){t(x,e||{}),this.startAll(document.documentElement),this.fire("init"),S=!0},destroy:function(){this.stopAll(document.documentElement),i()},isStarted:function(e){var n=b(e);return"object"==typeof n},start:function(e){var t,r,o,i=s(e),a=E[i];if(!a)return void u(new Error('Module type "'+i+'" is not defined.'));if(!this.isStarted(e)){e.id||(e.id="mod-"+i+"-"+a.counter),a.counter++,r=new n.Context(this,e),o=a.creator(r),x.debug||f(o,i),t={moduleName:i,instance:o,context:r,element:e,eventHandlers:{}},y(t),O[e.id]=t,d(t.instance,"init");for(var c,l=h(t),p=0,g=l.length;g>p;p++)c=l[p],d(c,"init")}},stop:function(e){var n=b(e);if(n){m(n);for(var t,r=h(n),o=r.length-1;o>=0;o--)t=r[o],d(t,"destroy");d(n.instance,"destroy"),delete O[e.id]}else if(x.debug)return void u(new Error("Unable to stop module associated with element: "+e.id))},startAll:function(e){for(var t=n.DOM.queryAll(e,w),r=0,o=t.length;o>r;r++)this.start(t[r])},stopAll:function(e){for(var t=n.DOM.queryAll(e,w),r=0,o=t.length;o>r;r++)this.stop(t[r])},addModule:function(e,n){return"undefined"!=typeof E[e]?void u(new Error("Module "+e+" has already been added.")):void(E[e]={creator:n,counter:1})},getModuleConfig:function(e,t){var r,o=b(e);return o?(o.config||(r=n.DOM.query(e,'script[type="text/x-config"]'),r&&(o.config=JSON.parse(r.text))),o.config?"undefined"==typeof t?o.config:t in o.config?o.config[t]:null:null):null},addService:function(e,t,r){if("undefined"!=typeof C[e])return void u(new Error("Service "+e+" has already been added."));if(r=r||{},C[e]={creator:t,instance:null},r.exports){var o,i=r.exports.length;for(o=0;i>o;o++){var a=r.exports[o],f=function(n){return function(){var t=p(e);return t[n].apply(t,arguments)}}(a);if(a in this)return void u(new Error(a+" already exists on Application object"));if(this[a]=f,a in n.Context.prototype)return void u(new Error(a+" already exists on Context prototype"));n.Context.prototype[a]=f,D.push(a)}}},getService:p,addBehavior:function(e,n){return"undefined"!=typeof M[e]?void u(new Error("Behavior "+e+" has already been added.")):void(M[e]={creator:n,instance:null})},broadcast:function(e,n){var t,i,a,u,f,s;for(i in O)if(O.hasOwnProperty(i)){for(s=[],a=O[i],-1!==o(a.instance.messages||[],e)&&s.push(r(a.instance.onmessage,a.instance)),f=h(a),t=0;t<f.length;t++)u=f[t],-1!==o(u.messages||[],e)&&s.push(r(u.onmessage,u));for(t=0;t<s.length;t++)s[t](e,n)}this.fire("message",{message:e,messageData:n})},getGlobal:function(n){return n in e?e[n]:null},getGlobalConfig:function(e){return"undefined"==typeof e?x:e in x?x[e]:null},setGlobalConfig:function(e){return S?void u(new Error("Cannot set global configuration after application initialization")):void t(x,e)},reportError:u})}(),"function"==typeof define&&define.amd)define("t3",[],function(){return n});else if("object"==typeof module&&"object"==typeof module.exports)module.exports=n;else{e.Box=e.Box||{};for(var t in n)n.hasOwnProperty(t)&&(e.Box[t]=n[t])}}("undefined"!=typeof window?window:this);
|
18
|
+
//# sourceMappingURL=t3.min.js.map
|
metadata
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: t3-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dom Christie
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.2.1
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.2.1
|
41
|
+
description: This gem provides T3 assets for your Rails 4+ application.
|
42
|
+
email:
|
43
|
+
- christiedom@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- MIT-LICENSE
|
49
|
+
- README.md
|
50
|
+
- Rakefile
|
51
|
+
- lib/generators/t3/behavior_generator.rb
|
52
|
+
- lib/generators/t3/bootstrap_generator.rb
|
53
|
+
- lib/generators/t3/generator_helper.rb
|
54
|
+
- lib/generators/t3/module_generator.rb
|
55
|
+
- lib/generators/t3/service_generator.rb
|
56
|
+
- lib/generators/templates/behavior.js
|
57
|
+
- lib/generators/templates/module.js
|
58
|
+
- lib/generators/templates/service.js
|
59
|
+
- lib/t3/rails.rb
|
60
|
+
- lib/t3/rails/version.rb
|
61
|
+
- test/dummy/README.rdoc
|
62
|
+
- test/dummy/Rakefile
|
63
|
+
- test/dummy/app/assets/javascripts/application.js
|
64
|
+
- test/dummy/app/assets/stylesheets/application.css
|
65
|
+
- test/dummy/app/controllers/application_controller.rb
|
66
|
+
- test/dummy/app/helpers/application_helper.rb
|
67
|
+
- test/dummy/app/views/layouts/application.html.erb
|
68
|
+
- test/dummy/bin/bundle
|
69
|
+
- test/dummy/bin/rails
|
70
|
+
- test/dummy/bin/rake
|
71
|
+
- test/dummy/bin/setup
|
72
|
+
- test/dummy/config.ru
|
73
|
+
- test/dummy/config/application.rb
|
74
|
+
- test/dummy/config/boot.rb
|
75
|
+
- test/dummy/config/environment.rb
|
76
|
+
- test/dummy/config/environments/development.rb
|
77
|
+
- test/dummy/config/environments/production.rb
|
78
|
+
- test/dummy/config/environments/test.rb
|
79
|
+
- test/dummy/config/initializers/assets.rb
|
80
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
81
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
82
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
83
|
+
- test/dummy/config/initializers/inflections.rb
|
84
|
+
- test/dummy/config/initializers/mime_types.rb
|
85
|
+
- test/dummy/config/initializers/session_store.rb
|
86
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
87
|
+
- test/dummy/config/locales/en.yml
|
88
|
+
- test/dummy/config/routes.rb
|
89
|
+
- test/dummy/config/secrets.yml
|
90
|
+
- test/dummy/log/development.log
|
91
|
+
- test/dummy/log/test.log
|
92
|
+
- test/dummy/public/404.html
|
93
|
+
- test/dummy/public/422.html
|
94
|
+
- test/dummy/public/500.html
|
95
|
+
- test/dummy/public/favicon.ico
|
96
|
+
- test/dummy/tmp/app/assets/javascripts/behaviors/validate.js
|
97
|
+
- test/generators/behavior_generator_test.rb
|
98
|
+
- test/generators/bootstrap_generator_test.rb
|
99
|
+
- test/generators/module_generator_test.rb
|
100
|
+
- test/generators/service_generator_test.rb
|
101
|
+
- test/t3_rails_test.rb
|
102
|
+
- test/test_helper.rb
|
103
|
+
- vendor/assets/javascripts/t3-testing.js
|
104
|
+
- vendor/assets/javascripts/t3.js
|
105
|
+
- vendor/assets/javascripts/t3.min.js
|
106
|
+
homepage:
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
metadata: {}
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
requirements: []
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 2.4.5
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: Use the T3 framework with Rails 4+
|
130
|
+
test_files:
|
131
|
+
- test/dummy/app/assets/javascripts/application.js
|
132
|
+
- test/dummy/app/assets/stylesheets/application.css
|
133
|
+
- test/dummy/app/controllers/application_controller.rb
|
134
|
+
- test/dummy/app/helpers/application_helper.rb
|
135
|
+
- test/dummy/app/views/layouts/application.html.erb
|
136
|
+
- test/dummy/bin/bundle
|
137
|
+
- test/dummy/bin/rails
|
138
|
+
- test/dummy/bin/rake
|
139
|
+
- test/dummy/bin/setup
|
140
|
+
- test/dummy/config/application.rb
|
141
|
+
- test/dummy/config/boot.rb
|
142
|
+
- test/dummy/config/environment.rb
|
143
|
+
- test/dummy/config/environments/development.rb
|
144
|
+
- test/dummy/config/environments/production.rb
|
145
|
+
- test/dummy/config/environments/test.rb
|
146
|
+
- test/dummy/config/initializers/assets.rb
|
147
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
148
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
149
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
150
|
+
- test/dummy/config/initializers/inflections.rb
|
151
|
+
- test/dummy/config/initializers/mime_types.rb
|
152
|
+
- test/dummy/config/initializers/session_store.rb
|
153
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
154
|
+
- test/dummy/config/locales/en.yml
|
155
|
+
- test/dummy/config/routes.rb
|
156
|
+
- test/dummy/config/secrets.yml
|
157
|
+
- test/dummy/config.ru
|
158
|
+
- test/dummy/log/development.log
|
159
|
+
- test/dummy/log/test.log
|
160
|
+
- test/dummy/public/404.html
|
161
|
+
- test/dummy/public/422.html
|
162
|
+
- test/dummy/public/500.html
|
163
|
+
- test/dummy/public/favicon.ico
|
164
|
+
- test/dummy/Rakefile
|
165
|
+
- test/dummy/README.rdoc
|
166
|
+
- test/dummy/tmp/app/assets/javascripts/behaviors/validate.js
|
167
|
+
- test/generators/behavior_generator_test.rb
|
168
|
+
- test/generators/bootstrap_generator_test.rb
|
169
|
+
- test/generators/module_generator_test.rb
|
170
|
+
- test/generators/service_generator_test.rb
|
171
|
+
- test/t3_rails_test.rb
|
172
|
+
- test/test_helper.rb
|