joosy 1.2.0.alpha.20 → 1.2.0.alpha.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bower.json +1 -1
- data/lib/joosy.js +19 -15
- data/package.json +1 -1
- data/src/joosy/core/joosy.coffee +4 -1
- data/src/joosy/core/modules/container.coffee +23 -18
- data/src/joosy/core/modules/events.coffee +2 -0
- data/src/joosy/core/modules/filters.coffee +2 -0
- data/src/joosy/core/modules/log.coffee +2 -0
- data/src/joosy/core/modules/renderer.coffee +1 -0
- data/src/joosy/core/modules/time_manager.coffee +2 -0
- data/src/joosy/core/modules/widgets_manager.coffee +2 -0
- data/tasks/joosy.coffee +23 -9
- data/templates/application/standalone/Gruntfile.coffee +4 -1
- data/templates/application/standalone/package.json +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9faeb080979ca702273c6e5eb971899925e2056e
|
4
|
+
data.tar.gz: d17e7c30af87b1ec7ee2df13d9b3a96dd9cf28c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20d5d31fe50f9a65076aeb087e178bb498d4d14d8bd9cc5f962ca0403827b474ec5c0bd01d43736e3650fc7cc3e1472f28e33aa8390462de51abde4363ef09e4
|
7
|
+
data.tar.gz: 5c426d803a35ba1a1d16fe19fa5ff93c9963bd9819958d833e8cf862dd007874bcd8ac2c5fd994f7034ce081bb151a85cb9f8554bc90ca9a79c33af55c2572ef
|
data/bower.json
CHANGED
data/lib/joosy.js
CHANGED
@@ -38,7 +38,11 @@ this.Joosy = {
|
|
38
38
|
},
|
39
39
|
synchronize: function() {
|
40
40
|
var _ref;
|
41
|
-
|
41
|
+
if (!Joosy.Modules.Events) {
|
42
|
+
return console.error("Events module is required to use `Joosy.synchronize'!");
|
43
|
+
} else {
|
44
|
+
return (_ref = Joosy.Modules.Events).synchronize.apply(_ref, arguments);
|
45
|
+
}
|
42
46
|
},
|
43
47
|
uuid: function() {
|
44
48
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
@@ -542,20 +546,6 @@ Joosy.Modules.Container = {
|
|
542
546
|
return this.__onRefreshes = [];
|
543
547
|
}
|
544
548
|
},
|
545
|
-
__assignElements: function(root, entries) {
|
546
|
-
var _this = this;
|
547
|
-
root || (root = this);
|
548
|
-
entries || (entries = this.__collectElements());
|
549
|
-
return Object.each(entries, function(key, value) {
|
550
|
-
if (Object.isObject(value)) {
|
551
|
-
return _this.__assignElements(root['$' + key] = {}, value);
|
552
|
-
} else {
|
553
|
-
value = _this.__extractSelector(value);
|
554
|
-
root['$' + key] = _this.$(value);
|
555
|
-
return root['$' + key].selector = value;
|
556
|
-
}
|
557
|
-
});
|
558
|
-
},
|
559
549
|
reloadContainer: function(htmlCallback) {
|
560
550
|
if (typeof this.__removeMetamorphs === "function") {
|
561
551
|
this.__removeMetamorphs();
|
@@ -601,6 +591,20 @@ Joosy.Modules.Container = {
|
|
601
591
|
});
|
602
592
|
return selector.trim();
|
603
593
|
},
|
594
|
+
__assignElements: function(root, entries) {
|
595
|
+
var _this = this;
|
596
|
+
root || (root = this);
|
597
|
+
entries || (entries = this.__collectElements());
|
598
|
+
return Object.each(entries, function(key, value) {
|
599
|
+
if (Object.isObject(value)) {
|
600
|
+
return _this.__assignElements(root['$' + key] = {}, value);
|
601
|
+
} else {
|
602
|
+
value = _this.__extractSelector(value);
|
603
|
+
root['$' + key] = _this.$(value);
|
604
|
+
return root['$' + key].selector = value;
|
605
|
+
}
|
606
|
+
});
|
607
|
+
},
|
604
608
|
__delegateEvents: function() {
|
605
609
|
var events, module,
|
606
610
|
_this = this;
|
data/package.json
CHANGED
data/src/joosy/core/joosy.coffee
CHANGED
@@ -69,7 +69,10 @@
|
|
69
69
|
# @param [Function] block Configuration block (see example)
|
70
70
|
#
|
71
71
|
synchronize: ->
|
72
|
-
Joosy.Modules.Events
|
72
|
+
unless Joosy.Modules.Events
|
73
|
+
console.error "Events module is required to use `Joosy.synchronize'!"
|
74
|
+
else
|
75
|
+
Joosy.Modules.Events.synchronize arguments...
|
73
76
|
|
74
77
|
#
|
75
78
|
# Generates UUID
|
@@ -1,3 +1,5 @@
|
|
1
|
+
#= require joosy/core/joosy
|
2
|
+
|
1
3
|
#
|
2
4
|
# DOM container handling, DOM elements and DOM events bindings
|
3
5
|
#
|
@@ -21,11 +23,6 @@ Joosy.Modules.Container =
|
|
21
23
|
#
|
22
24
|
# Rebinds selectors defined in 'elements' hash to object properties
|
23
25
|
#
|
24
|
-
# @example Sample elements
|
25
|
-
# elements:
|
26
|
-
# foo: '.foo'
|
27
|
-
# bar: '.bar'
|
28
|
-
#
|
29
26
|
refreshElements: ->
|
30
27
|
@__assignElements()
|
31
28
|
|
@@ -33,18 +30,6 @@ Joosy.Modules.Container =
|
|
33
30
|
@__onRefreshes.each (callback) => callback.apply @
|
34
31
|
@__onRefreshes = []
|
35
32
|
|
36
|
-
__assignElements: (root, entries) ->
|
37
|
-
root ||= @
|
38
|
-
entries ||= @__collectElements()
|
39
|
-
|
40
|
-
Object.each entries, (key, value) =>
|
41
|
-
if Object.isObject(value)
|
42
|
-
@__assignElements root['$'+key]={}, value
|
43
|
-
else
|
44
|
-
value = @__extractSelector value
|
45
|
-
root['$'+key] = @$(value)
|
46
|
-
root['$'+key].selector = value
|
47
|
-
|
48
33
|
#
|
49
34
|
# Clears old HTML links, set the new HTML from the callback and refreshes elements
|
50
35
|
#
|
@@ -108,7 +93,27 @@ Joosy.Modules.Container =
|
|
108
93
|
selector.trim()
|
109
94
|
|
110
95
|
#
|
111
|
-
#
|
96
|
+
# Assigns elements defined in 'elements'
|
97
|
+
#
|
98
|
+
# @example Sample elements
|
99
|
+
# elements:
|
100
|
+
# foo: '.foo'
|
101
|
+
# bar: '.bar'
|
102
|
+
#
|
103
|
+
__assignElements: (root, entries) ->
|
104
|
+
root ||= @
|
105
|
+
entries ||= @__collectElements()
|
106
|
+
|
107
|
+
Object.each entries, (key, value) =>
|
108
|
+
if Object.isObject(value)
|
109
|
+
@__assignElements root['$'+key]={}, value
|
110
|
+
else
|
111
|
+
value = @__extractSelector value
|
112
|
+
root['$'+key] = @$(value)
|
113
|
+
root['$'+key].selector = value
|
114
|
+
|
115
|
+
#
|
116
|
+
# Binds events defined in 'events' to container
|
112
117
|
#
|
113
118
|
# @example Sample events
|
114
119
|
# events:
|
data/tasks/joosy.coffee
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
module.exports = (grunt) ->
|
2
2
|
|
3
|
-
Path = require('path')
|
4
|
-
|
5
3
|
grunt.loadNpmTasks 'grunt-mincer'
|
6
4
|
grunt.loadNpmTasks 'grunt-contrib-connect'
|
7
5
|
grunt.loadNpmTasks 'grunt-contrib-uglify'
|
@@ -14,16 +12,20 @@ module.exports = (grunt) ->
|
|
14
12
|
|
15
13
|
grunt.registerTask 'joosy:compile:playground', ->
|
16
14
|
hamlc = require 'haml-coffee'
|
17
|
-
grunt.file.write 'public/index.html', hamlc.compile(grunt.file.read 'source/index.haml')(
|
15
|
+
grunt.file.write 'public/index.html', hamlc.compile(grunt.file.read 'source/index.haml')(
|
16
|
+
environment: 'production'
|
17
|
+
config: grunt.config.get('joosy.config') || {}
|
18
|
+
)
|
18
19
|
|
19
20
|
grunt.registerTask 'joosy:server', ->
|
20
21
|
@async()
|
21
|
-
connect = require
|
22
|
-
mincer = require
|
23
|
-
hamlc = require
|
22
|
+
connect = require 'connect'
|
23
|
+
mincer = require 'mincer'
|
24
|
+
hamlc = require 'haml-coffee'
|
25
|
+
path = require 'path'
|
24
26
|
|
25
27
|
mincer.StylusEngine.registerConfigurator (stylus) ->
|
26
|
-
stylus.options.paths.push
|
28
|
+
stylus.options.paths.push path.join(process.cwd(), 'public')
|
27
29
|
stylus.use require('nib')()
|
28
30
|
|
29
31
|
server = connect()
|
@@ -38,12 +40,24 @@ module.exports = (grunt) ->
|
|
38
40
|
|
39
41
|
server.use '/', (req, res, next) ->
|
40
42
|
if req.url == '/'
|
41
|
-
res.end hamlc.compile(grunt.file.read 'source/index.haml')(
|
43
|
+
res.end hamlc.compile(grunt.file.read 'source/index.haml')(
|
44
|
+
environment: 'development'
|
45
|
+
config: grunt.config.get('joosy.config') || {}
|
46
|
+
)
|
42
47
|
else
|
43
48
|
next()
|
44
|
-
|
49
|
+
|
50
|
+
if grunt.config.get('joosy.proxy')
|
51
|
+
proxy = require 'proxy-middleware'
|
52
|
+
url = require 'url'
|
53
|
+
|
54
|
+
for from, to of grunt.config.get('joosy.proxy')
|
55
|
+
console.log "-> Proxying #{from} to #{to}"
|
56
|
+
server.use from, proxy(url.parse to)
|
57
|
+
|
45
58
|
server.use connect.static('public')
|
46
59
|
server.listen 4000
|
60
|
+
console.log "-> Started on 4000\n"
|
47
61
|
|
48
62
|
grunt.registerTask 'joosy:server:production', ->
|
49
63
|
@async()
|