joosy 1.2.0.alpha.59 → 1.2.0.alpha.62
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/.travis.yml +2 -1
- data/Gruntfile.coffee +50 -217
- data/bin/joosy +1 -1
- data/bower.json +1 -1
- data/build/joosy.js +5 -5
- data/{generators → lib/generators}/base.coffee +1 -1
- data/{generators → lib/generators}/command/command.coffee +1 -1
- data/{generators → lib/generators}/command/help.coffee +0 -0
- data/{generators → lib/generators}/layout.coffee +0 -0
- data/{generators → lib/generators}/page.coffee +0 -0
- data/{generators → lib/generators}/project.coffee +1 -1
- data/{generators → lib/generators}/project/base.coffee +0 -0
- data/{generators → lib/generators}/project/standalone.coffee +9 -4
- data/{generators → lib/generators}/templates/application/base/application.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/helpers/application.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/layouts/application.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/pages/application.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/pages/welcome/index.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/routes.coffee +0 -0
- data/{generators → lib/generators}/templates/application/base/templates/layouts/application.jst.hamlc +0 -0
- data/{generators → lib/generators}/templates/application/base/templates/pages/welcome/index.jst.hamlc +0 -0
- data/{generators → lib/generators}/templates/application/standalone/Gruntfile.coffee +11 -25
- data/{generators → lib/generators}/templates/application/standalone/Procfile +0 -0
- data/{generators → lib/generators}/templates/application/standalone/_gitignore +2 -2
- data/{generators/templates/application/standalone/source → lib/generators/templates/application/standalone/app}/haml/index.haml +0 -0
- data/{generators/templates/application/standalone/source → lib/generators/templates/application/standalone/app}/stylesheets/application.styl +0 -0
- data/{generators → lib/generators}/templates/application/standalone/bower.json +0 -0
- data/{generators → lib/generators}/templates/application/standalone/package.json +3 -0
- data/{generators → lib/generators}/templates/application/standalone/spec/application_spec.coffee +0 -0
- data/{generators → lib/generators}/templates/application/standalone/spec/helpers/environment.coffee +0 -0
- data/{generators → lib/generators}/templates/application/standalone/tasks/spec.coffee +0 -0
- data/{generators → lib/generators}/templates/layout/basic.coffee +0 -0
- data/{generators → lib/generators}/templates/layout/namespaced.coffee +0 -0
- data/{generators → lib/generators}/templates/page/basic.coffee +0 -0
- data/{generators → lib/generators}/templates/page/namespaced.coffee +0 -0
- data/{generators → lib/generators}/templates/widget/basic.coffee +0 -0
- data/{generators → lib/generators}/templates/widget/namespaced.coffee +0 -0
- data/{generators → lib/generators}/widget.coffee +0 -0
- data/lib/joosy.rb +2 -2
- data/lib/tasks/build.coffee +16 -0
- data/lib/tasks/doc.coffee +80 -0
- data/lib/tasks/publish.coffee +29 -0
- data/lib/tasks/testem.coffee +58 -0
- data/package.json +10 -15
- data/source/joosy/helpers/widgets.coffee +1 -1
- data/source/joosy/modules/events.coffee +1 -1
- data/source/joosy/router.coffee +2 -2
- data/source/joosy/templaters/jst.coffee +1 -1
- data/source/joosy/widget.coffee +2 -2
- data/spec/joosy/core/helpers/routes_spec.coffee +8 -2
- data/spec/joosy/core/router_spec.coffee +4 -4
- data/tasks/joosy.coffee +2 -0
- metadata +39 -42
- data/Gemfile +0 -6
- data/build/joosy/extensions/preloaders.js +0 -189
- data/source/joosy/extensions/preloaders/caching.coffee +0 -169
- data/source/joosy/extensions/preloaders/index.coffee +0 -1
- data/source/joosy/extensions/preloaders/inline.coffee +0 -56
- data/spec/joosy/extensions/preloaders/caching_spec.coffee +0 -36
- data/spec/joosy/extensions/preloaders/inline_spec.coffee +0 -16
@@ -1 +0,0 @@
|
|
1
|
-
#= require_tree ./
|
@@ -1,56 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Preloader for libraries using `script src` without any caching magic
|
3
|
-
#
|
4
|
-
# @example Basic usage
|
5
|
-
# libraries = [['/test1.js'], ['/test2.js']]
|
6
|
-
#
|
7
|
-
# InlinePreloader.load libraries,
|
8
|
-
# start: -> console.log 'preloading started'
|
9
|
-
# complete: -> console.log 'preloading finished'
|
10
|
-
#
|
11
|
-
# @mixin
|
12
|
-
#
|
13
|
-
@InlinePreloader =
|
14
|
-
#
|
15
|
-
# Loads set of libraries by adding `script src` to DOM head
|
16
|
-
# See class description for example of usage
|
17
|
-
#
|
18
|
-
# @param [Array] 2-levels array of libraries URLs i.e. [['/test1.js'],['/test2.js']]
|
19
|
-
# @param [Hash] Available options:
|
20
|
-
# * start: `() -> null` to call before load starts:
|
21
|
-
# * complete: `() -> null` to call after load completes
|
22
|
-
#
|
23
|
-
load: (libraries, options) ->
|
24
|
-
@[key] = val for key, val of options
|
25
|
-
@start?()
|
26
|
-
|
27
|
-
if libraries.length > 0
|
28
|
-
@receive libraries.shift()[0], => @load(libraries)
|
29
|
-
else
|
30
|
-
@complete?()
|
31
|
-
|
32
|
-
#
|
33
|
-
# Loads one script by adding `script src` to DOM head
|
34
|
-
#
|
35
|
-
# @param [String] url to load script from
|
36
|
-
# @param [Function] `() -> null` to call after script was loaded and executed
|
37
|
-
#
|
38
|
-
receive: (url, callback) ->
|
39
|
-
head = document.getElementsByTagName("head")[0]
|
40
|
-
script = document.createElement "script"
|
41
|
-
script.src = url
|
42
|
-
|
43
|
-
done = false
|
44
|
-
|
45
|
-
proceed = ->
|
46
|
-
if !done && (!@readyState? || @readyState == "loaded" || @readyState == "complete")
|
47
|
-
done = true
|
48
|
-
callback?()
|
49
|
-
script.onload = script.onreadystatechange = null
|
50
|
-
|
51
|
-
script.onload = script.onreadystatechange = proceed
|
52
|
-
|
53
|
-
head.appendChild script
|
54
|
-
return undefined
|
55
|
-
|
56
|
-
@Preloader = @InlinePreloader
|
@@ -1,36 +0,0 @@
|
|
1
|
-
describe "CachingPreloader", ->
|
2
|
-
|
3
|
-
it "should load JS", ->
|
4
|
-
window.variable_assigned_on_load = undefined
|
5
|
-
localStorage.clear()
|
6
|
-
|
7
|
-
callback = sinon.spy()
|
8
|
-
server = sinon.fakeServer.create()
|
9
|
-
|
10
|
-
load = ->
|
11
|
-
CachingPreloader.load [['/test.js']],
|
12
|
-
complete: callback
|
13
|
-
|
14
|
-
load()
|
15
|
-
|
16
|
-
expect(server.requests.length).toEqual 1
|
17
|
-
target = server.requests[0]
|
18
|
-
expect(target.method).toEqual 'GET'
|
19
|
-
expect(target.url).toMatch /^\/test.js$/
|
20
|
-
target.respond 200, 'Content-Type': 'application/javascript',
|
21
|
-
"window.variable_assigned_on_load = 'yapyap';"
|
22
|
-
|
23
|
-
expect(callback.callCount).toEqual 1
|
24
|
-
expect(window.variable_assigned_on_load).toEqual 'yapyap'
|
25
|
-
window.variable_assigned_on_load = undefined
|
26
|
-
|
27
|
-
load()
|
28
|
-
|
29
|
-
expect(server.requests.length).toEqual 1
|
30
|
-
expect(callback.callCount).toEqual 2
|
31
|
-
expect(window.variable_assigned_on_load).toEqual 'yapyap'
|
32
|
-
|
33
|
-
server.restore()
|
34
|
-
|
35
|
-
window.variable_assigned_on_load = undefined
|
36
|
-
localStorage.clear()
|
@@ -1,16 +0,0 @@
|
|
1
|
-
describe "InlinePreloader", ->
|
2
|
-
|
3
|
-
it "should load JS", ->
|
4
|
-
window.variable_assigned_on_load = undefined
|
5
|
-
callback = sinon.spy()
|
6
|
-
|
7
|
-
runs ->
|
8
|
-
InlinePreloader.load [['/spec/support/test.js']],
|
9
|
-
complete: callback
|
10
|
-
|
11
|
-
waits 100
|
12
|
-
|
13
|
-
runs ->
|
14
|
-
expect(callback.callCount).toEqual 1
|
15
|
-
expect(window.variable_assigned_on_load).toEqual 'yapyap'
|
16
|
-
window.variable_assigned_on_load = undefined
|