lanes 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -0
- data/Gemfile +2 -2
- data/client/lanes/components/Base.coffee +12 -11
- data/client/lanes/components/enabled.js.erb +1 -1
- data/client/lanes/components/grid/Editor.coffee +2 -2
- data/client/lanes/components/grid/Grid.coffee +60 -58
- data/client/lanes/components/grid/PopOverEditor.coffee +3 -3
- data/client/lanes/components/grid/RowEditor.coffee +1 -1
- data/client/lanes/components/grid/{grid.scss → _index.scss} +0 -0
- data/client/lanes/components/grid/template.html +1 -1
- data/client/lanes/components/modal/ModalDialog.coffee +1 -1
- data/client/lanes/components/modal/{modal.scss → _index.scss} +1 -1
- data/client/lanes/components/modal/index.js +1 -1
- data/client/lanes/components/popover/PopOver.coffee +1 -1
- data/client/lanes/components/popover/_index.scss +1 -0
- data/client/lanes/components/popover/index.js +1 -1
- data/client/lanes/components/select_field/{select_field.scss → _index.scss} +0 -0
- data/client/lanes/extension/Extensions.coffee +3 -2
- data/client/lanes/lib/Templates.coffee +7 -0
- data/client/lanes/minimal.js +1 -1
- data/client/lanes/minimal.scss.erb +1 -1
- data/client/lanes/models/Base.coffee +16 -19
- data/client/lanes/models/Bootstrap.coffee +1 -2
- data/client/lanes/models/Collection.coffee +37 -25
- data/client/lanes/models/Screens.coffee +6 -18
- data/client/lanes/models/Sync.coffee +12 -5
- data/client/lanes/screens/Base.coffee +1 -2
- data/client/lanes/screens/Instance.coffee +2 -5
- data/client/lanes/screens/screen-definitions.js.erb +10 -2
- data/client/{styles → lanes/styles}/components/all.scss +0 -0
- data/client/{styles → lanes/styles}/components/changes-notification.scss +0 -0
- data/client/{styles → lanes/styles}/components/record-finder.scss +0 -0
- data/client/{styles → lanes/styles}/components/suggest.scss +0 -0
- data/client/{styles → lanes/styles}/fonts/icomoon.eot +0 -0
- data/client/{styles → lanes/styles}/fonts/icomoon.svg +0 -0
- data/client/{styles → lanes/styles}/fonts/icomoon.ttf +0 -0
- data/client/{styles → lanes/styles}/fonts/icomoon.woff +0 -0
- data/client/{styles → lanes/styles}/fonts/selection.json +0 -0
- data/client/{styles → lanes/styles}/fonts/style.scss +0 -0
- data/client/{styles → lanes/styles}/fonts.scss +5 -5
- data/client/{styles → lanes/styles}/forms.scss +0 -0
- data/client/{styles → lanes/styles}/index.css +0 -0
- data/client/{styles → lanes/styles}/keybindings.scss +0 -0
- data/client/{styles → lanes/styles}/layout.scss +0 -0
- data/client/{styles → lanes/styles}/plugins/all.scss +0 -0
- data/client/{styles → lanes/styles}/plugins/overlay.scss +0 -0
- data/client/{styles → lanes/styles}/plugins/resize-sensor.scss +0 -0
- data/client/{styles → lanes/styles}/screens.scss +0 -0
- data/client/{styles → lanes/styles}/tabs.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_alerts.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_badges.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_breadcrumbs.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_button-groups.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_buttons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_carousel.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_close.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_code.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_component-animations.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_dropdowns.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_forms.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_glyphicons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_grid.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_input-groups.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_jumbotron.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_labels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_list-group.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_media.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_mixins.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_modals.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_navbar.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_navs.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_normalize.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_pager.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_pagination.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_panels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_popovers.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_print.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_progress-bars.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_responsive-embed.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_responsive-utilities.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_scaffolding.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_tables.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_theme.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_thumbnails.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_tooltip.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_type.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_utilities.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_variables.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/_wells.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_alerts.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_background-variant.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_border-radius.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_buttons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_center-block.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_clearfix.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_forms.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_gradients.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_grid-framework.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_grid.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_hide-text.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_image.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_labels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_list-group.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_nav-divider.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_nav-vertical-align.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_opacity.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_pagination.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_panels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_progress-bar.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_reset-filter.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_resize.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_responsive-visibility.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_size.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_tab-focus.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_table-row.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_text-emphasis.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_text-overflow.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/mixins/_vendor-prefixes.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_alerts.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_badges.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_breadcrumbs.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_button-groups.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_buttons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_carousel.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_close.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_code.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_component-animations.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_dropdowns.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_forms.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_glyphicons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_grid.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_input-groups.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_jumbotron.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_labels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_list-group.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_media.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_mixins.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_modals.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_navbar.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_navs.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_normalize.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_pager.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_pagination.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_panels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_popovers.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_print.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_progress-bars.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_responsive-embed.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_responsive-utilities.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_scaffolding.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_tables.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_theme.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_thumbnails.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_tooltip.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_type.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_utilities.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_variables.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/_wells.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/bootstrap.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_alerts.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_background-variant.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_border-radius.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_buttons.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_center-block.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_clearfix.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_forms.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_gradients.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_grid-framework.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_grid.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_hide-text.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_image.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_labels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_list-group.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_nav-divider.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_nav-vertical-align.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_opacity.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_pagination.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_panels.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_progress-bar.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_reset-filter.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_resize.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_responsive-visibility.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_size.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_tab-focus.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_table-row.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_text-emphasis.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_text-overflow.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap/old/mixins/_vendor-prefixes.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap-custom-grid.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap-custom-modals.scss +0 -0
- data/client/{styles → lanes/styles}/vendor/bootstrap.scss +2 -2
- data/client/{styles → lanes/styles}/vendor/dataTables.scss +0 -0
- data/client/lanes/views/Base.coffee +34 -49
- data/client/lanes/views/FormBindings.coffee +22 -20
- data/client/lanes/views/Helpers.coffee +1 -1
- data/client/lanes/views/empty-span.html +1 -0
- data/client/lanes/workspace/ActiveScreensSwitcher.coffee +8 -1
- data/client/lanes/workspace/Layout.coffee +7 -4
- data/client/lanes/workspace/Navbar.coffee +6 -2
- data/client/lanes/workspace/Pages.coffee +5 -1
- data/client/lanes/workspace/ScreensMenu.coffee +14 -2
- data/client/lanes/workspace/WorkspaceView.coffee +5 -0
- data/client/lanes/workspace/index.js +1 -0
- data/client/lanes/workspace.scss.erb +6 -1
- data/lanes.gemspec +1 -1
- data/lib/lanes/api/controller.rb +5 -7
- data/lib/lanes/api/helper_methods.rb +1 -1
- data/lib/lanes/api/javascript_processor.rb +3 -2
- data/lib/lanes/command/app.rb +8 -4
- data/lib/lanes/command/generate_model.rb +13 -11
- data/lib/lanes/command/generate_screen.rb +9 -2
- data/lib/lanes/command/generate_view.rb +15 -3
- data/lib/lanes/command/generate_view.usage +7 -7
- data/lib/lanes/command/named_command.rb +2 -2
- data/lib/lanes/command/templates/client/index.js +3 -0
- data/lib/lanes/command/templates/client/models/BaseModel.coffee +5 -0
- data/lib/lanes/command/templates/client/models/Model.coffee +1 -1
- data/lib/lanes/command/templates/client/views/BaseView.coffee +5 -0
- data/lib/lanes/command/templates/client/views/View.coffee +1 -1
- data/lib/lanes/command/templates/config/screen.rb +8 -0
- data/lib/lanes/command/templates/lib/namespace/base_model.rb +9 -0
- data/lib/lanes/command/templates/lib/namespace/model.rb +1 -1
- data/lib/lanes/command/templates/spec/client/models/ModelSpec.coffee +1 -1
- data/lib/lanes/command/templates/spec/client/views/ViewSpec.coffee +1 -1
- data/lib/lanes/command.rb +1 -2
- data/lib/lanes/components.rb +5 -4
- data/lib/lanes/concerns/all.rb +0 -5
- data/lib/lanes/concerns/attr_accessor_with_default.rb +5 -3
- data/lib/lanes/concerns/set_attribute_data.rb +6 -23
- data/lib/lanes/configuration.rb +1 -0
- data/lib/lanes/extension.rb +19 -10
- data/lib/lanes/guard_tasks.rb +1 -1
- data/lib/lanes/model.rb +1 -6
- data/lib/lanes/{screens.rb → screen.rb} +40 -23
- data/lib/lanes/spec_helper.rb +4 -2
- data/lib/lanes/version.rb +1 -1
- data/lib/lanes.rb +1 -1
- data/spec/api/javascript_processor_spec.rb +3 -3
- data/spec/command_spec.rb +49 -0
- data/spec/concerns/attr_accessor_with_default_spec.rb +7 -0
- data/spec/helpers/lanes-helpers.coffee +46 -22
- data/spec/helpers/minitest_assertions.rb +23 -0
- data/spec/lanes/models/BaseSpec.coffee +57 -56
- data/spec/lanes/models/CollectionSpec.coffee +14 -0
- data/spec/lanes/models/PubSubSpec.coffee +5 -5
- data/spec/lanes/views/BaseSpec.coffee +32 -31
- data/spec/lanes/views/FormBindingsSpec.coffee +32 -0
- metadata +183 -179
- data/client/lanes/components/popover/popover.scss +0 -1
- data/lib/lanes/command/templates/lib/namespace/screen.rb +0 -17
- data/lib/lanes/concerns/code_identifier.rb +0 -43
- data/lib/lanes/concerns/immutable_model.rb +0 -32
- data/lib/lanes/concerns/locked_fields.rb +0 -84
- data/lib/lanes/concerns/random_hash_code.rb +0 -40
- data/lib/lanes/concerns/visible_id_identifier.rb +0 -53
- data/spec/concerns/code_identifier_spec.rb +0 -45
@@ -10,6 +10,9 @@ CommonMethods = {
|
|
10
10
|
break if found != -1
|
11
11
|
found
|
12
12
|
|
13
|
+
# convenience method to create a new subCollection
|
14
|
+
subcollection: (options)->
|
15
|
+
new Lanes.Models.SubCollection(this, options)
|
13
16
|
|
14
17
|
destroyAll: (options={})->
|
15
18
|
success = options.success
|
@@ -21,7 +24,6 @@ CommonMethods = {
|
|
21
24
|
success.apply(@,arguments) if success
|
22
25
|
})
|
23
26
|
Lanes.Models.Sync.perform('delete', this, options)
|
24
|
-
|
25
27
|
}
|
26
28
|
|
27
29
|
class ModelsCollection
|
@@ -31,56 +33,66 @@ class ModelsCollection
|
|
31
33
|
@errors=[]
|
32
34
|
Lanes.Vendor.Ampersand.Collection.apply(this, arguments)
|
33
35
|
|
36
|
+
# convenience method to instantiate a collection
|
37
|
+
# then call fetch on it with the options provided
|
34
38
|
@fetch: (options)->
|
35
39
|
collection = new this
|
36
40
|
collection.fetch(options)
|
37
41
|
collection
|
38
|
-
|
42
|
+
|
43
|
+
# Fetch the a set of models for the collection, replacing all
|
44
|
+
# current models whith them when the call completes
|
39
45
|
fetch: (options={})->
|
40
|
-
|
41
|
-
|
42
|
-
|
46
|
+
handlers = Lanes.Models.Sync.wrapRequest(this,options)
|
47
|
+
if options.force || !@_isLoaded
|
48
|
+
this.sync('read', this, options)
|
49
|
+
else
|
50
|
+
handlers.resolvePromise( record: this, reply: {} )
|
51
|
+
handlers.promise
|
52
|
+
|
53
|
+
# Call the callback function when the current fetch succeeds
|
54
|
+
# If the collection is not currently being loaded,
|
55
|
+
# the callback is immediatly invoked
|
56
|
+
whenLoaded: (cb)->
|
57
|
+
if this.requestInProgress
|
58
|
+
cb(this)
|
59
|
+
else
|
60
|
+
this._loaded_callbacks ||= []
|
61
|
+
this._loaded_callbacks.push(cb)
|
62
|
+
this
|
43
63
|
|
44
64
|
# Sets the attribute data from a server respose
|
45
65
|
setFromServer: (data, options)->
|
66
|
+
@_isLoaded = true
|
46
67
|
method = if options.reset then 'reset' else 'set'
|
47
68
|
this[method](data, options)
|
48
|
-
this.
|
49
|
-
|
50
|
-
|
51
|
-
@_isLoaded
|
69
|
+
if this._loaded_callbacks
|
70
|
+
cb(this) for cb in this._loaded_callbacks
|
71
|
+
delete this._loaded_callbacks
|
52
72
|
|
53
|
-
|
54
|
-
if ! @_isLoaded && ! this.length
|
55
|
-
this.fetch({ success: callback })
|
56
|
-
else if callback
|
57
|
-
callback()
|
73
|
+
isLoaded:-> @_isLoaded
|
58
74
|
|
75
|
+
# true if any models have unsaved data
|
59
76
|
isDirty: ->
|
60
77
|
for model in @models
|
61
78
|
return true if model.isDirty()
|
62
79
|
false
|
63
80
|
|
64
|
-
|
65
|
-
resp['data']
|
66
|
-
|
67
|
-
viewJSON: (options)->
|
68
|
-
this.map( (model) ->
|
69
|
-
model.viewJSON(options)
|
70
|
-
)
|
71
|
-
|
72
|
-
url: ->
|
73
|
-
@model::urlRoot()
|
81
|
+
url: -> @model::urlRoot()
|
74
82
|
|
75
83
|
sync: Lanes.Models.Sync.perform
|
76
84
|
|
77
85
|
save: (options)->
|
78
86
|
Lanes.Models.Sync.perform('update', this, options)
|
79
87
|
|
88
|
+
# returns data to save to server. If options.saveAll is true,
|
89
|
+
# all attributes from all models data is returned.
|
90
|
+
# Otherwise only unsaved attributes are returned.
|
80
91
|
dataForSave: (options)->
|
81
92
|
unsaved = []
|
82
93
|
for model in @models
|
83
|
-
|
94
|
+
if options.saveAll || model.isDirty()
|
95
|
+
unsaved.push( model.dataForSave(options) )
|
84
96
|
unsaved
|
85
97
|
|
86
98
|
_prepareModel: (attrs, options={})->
|
@@ -38,9 +38,11 @@ class ScreenDefinition extends Lanes.Models.BasicModel
|
|
38
38
|
view: 'string'
|
39
39
|
icon: 'string'
|
40
40
|
group_id: 'string'
|
41
|
-
files: 'array'
|
42
41
|
loading: 'boolean'
|
43
42
|
model: 'string'
|
43
|
+
assets: 'array'
|
44
|
+
js: 'string'
|
45
|
+
css: 'string'
|
44
46
|
|
45
47
|
derived:
|
46
48
|
model_type:
|
@@ -54,7 +56,7 @@ class ScreenDefinition extends Lanes.Models.BasicModel
|
|
54
56
|
@views.push( new ScreenView( screen: this, viewport: viewport ) )
|
55
57
|
|
56
58
|
getScreen: ->
|
57
|
-
@viewModel ||= Lanes.getPath(this.view
|
59
|
+
@viewModel ||= Lanes.getPath(this.view)
|
58
60
|
if @viewModel?
|
59
61
|
_.Promise.resolve(@viewMOdel)
|
60
62
|
else
|
@@ -62,9 +64,9 @@ class ScreenDefinition extends Lanes.Models.BasicModel
|
|
62
64
|
|
63
65
|
loadScreen: ->
|
64
66
|
me=this
|
65
|
-
return new _.Promise(
|
67
|
+
return new _.Promise( (resolve,reject)->
|
66
68
|
me.loading=true
|
67
|
-
Lanes.lib.Request(me.
|
69
|
+
Lanes.lib.Request(me.assets)
|
68
70
|
.then ->
|
69
71
|
me.loading=false
|
70
72
|
me.viewModel = Lanes.getPath(me.view)
|
@@ -80,20 +82,6 @@ class ScreenDefinition extends Lanes.Models.BasicModel
|
|
80
82
|
display: (ui)->
|
81
83
|
this.getScreen().then => @_setDisplaying(ui)
|
82
84
|
|
83
|
-
# @viewModel ||= Lanes.Screens[this.view]
|
84
|
-
# if @viewModel?
|
85
|
-
# this._setDisplaying(ui)
|
86
|
-
# else
|
87
|
-
# this.loading=true
|
88
|
-
# Lanes.lib.Request(this.files)
|
89
|
-
# .then =>
|
90
|
-
# @viewModel = Lanes.Screens[this.view]
|
91
|
-
# @_setDisplaying(ui)
|
92
|
-
# @loading=false
|
93
|
-
# .catch (failures)=>
|
94
|
-
# @loading=false
|
95
|
-
# Lanes.warn(failures)
|
96
|
-
|
97
85
|
|
98
86
|
class ScreenViewSet extends Lanes.Models.BasicCollection
|
99
87
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# a simple reimplentation
|
3
2
|
# to use traffic cop
|
4
3
|
methodMap = {
|
@@ -46,13 +45,20 @@ Lanes.Models.Sync = {
|
|
46
45
|
options.resolvePromise = resolve
|
47
46
|
options.rejectPromise = reject
|
48
47
|
)
|
49
|
-
options.error = (reply,
|
50
|
-
options.rejectPromise(
|
48
|
+
options.error = (reply, status, req)->
|
49
|
+
options.rejectPromise(
|
50
|
+
Lanes.Models.Sync.copyServerReply( record,
|
51
|
+
resp.responseJSON || {error: resp.responseText}
|
52
|
+
)
|
53
|
+
)
|
54
|
+
delete record.requestInProgress
|
51
55
|
error?.apply(options.scope, arguments)
|
52
56
|
|
53
|
-
options.success = (reply,
|
57
|
+
options.success = (reply, status, req)->
|
54
58
|
record.setFromServer( reply.data, options ) if reply?.data?
|
59
|
+
record.trigger("sync", record, reply, status)
|
55
60
|
options.resolvePromise( Lanes.Models.Sync.copyServerReply(record,reply) )
|
61
|
+
delete record.requestInProgress
|
56
62
|
success?.apply(options.scope, arguments)
|
57
63
|
options
|
58
64
|
|
@@ -81,6 +87,7 @@ Lanes.Models.Sync = {
|
|
81
87
|
|
82
88
|
# Make the request, allowing the user to override any Ajax options.
|
83
89
|
xhr = options.xhr = Lanes.$.ajax(_.extend(params, options))
|
84
|
-
model.
|
90
|
+
model.requestInProgress = true
|
91
|
+
model.trigger("request", model, xhr, options)
|
85
92
|
xhr
|
86
93
|
}
|
@@ -16,8 +16,7 @@ class ScreenBase
|
|
16
16
|
|
17
17
|
reset: Lanes.emptyFn
|
18
18
|
|
19
|
-
|
20
|
-
this.FILE.extension.toLowerCase() + "/screens/" + _.underscore( this.FILE.file ) + "/layout";
|
19
|
+
templatePrefix: -> this.FILE.extensionName.toLowerCase() + "/screens/"
|
21
20
|
|
22
21
|
render: ->
|
23
22
|
previouslyRendered = this.rendered
|
@@ -22,11 +22,11 @@ class Lanes.Screens.Instance
|
|
22
22
|
this.root.tooltip({
|
23
23
|
viewport: '.lanes'
|
24
24
|
selector: '[data-tooltip-message]'
|
25
|
-
title:
|
25
|
+
title: -> this.getAttribute('data-tooltip-message')
|
26
26
|
});
|
27
27
|
Lanes.Views.Keys.initialize();
|
28
28
|
Lanes.Models.PubSub.initialize() if options.pub_sub;
|
29
|
-
|
29
|
+
|
30
30
|
view = Lanes.getPath(options.root_view);
|
31
31
|
if view
|
32
32
|
this.displayInitialView(view);
|
@@ -45,8 +45,5 @@ class Lanes.Screens.Instance
|
|
45
45
|
displayInitialView:(view)->
|
46
46
|
this.view = new view({parent: this, model: this.viewport}).render();
|
47
47
|
this.viewport.el = this.view.$el;
|
48
|
-
|
49
48
|
this.root.append( this.view.el );
|
50
49
|
Lanes.Extensions.fireOnAvailable(this);
|
51
|
-
|
52
|
-
|
@@ -1,7 +1,15 @@
|
|
1
|
-
<% Lanes
|
1
|
+
<% if !Lanes.config.initial_workspace_screen_id.blank? &&
|
2
|
+
screen = Lanes::Screen[Lanes.config.initial_workspace_screen_id]
|
3
|
+
require_asset screen.js
|
4
|
+
end %>
|
5
|
+
|
6
|
+
<% Lanes::Screen.each_group do | spec | %>
|
2
7
|
Lanes.Models.Screens.groups.add( <%= spec.to_json %> );
|
3
8
|
<% end %>
|
4
9
|
|
5
|
-
<% Lanes::
|
10
|
+
<% Lanes::Screen.each do | spec | %>
|
6
11
|
Lanes.Models.Screens.register( <%= spec.to_json %> );
|
7
12
|
<% end %>
|
13
|
+
|
14
|
+
<% depend_on "/Users/nas/code/lanes-access/config/screens.rb" %>
|
15
|
+
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@font-face {
|
2
2
|
font-family: 'skr-icon';
|
3
|
-
src:url(font-path('styles/fonts/icomoon.eot') + '?-7u8s0f');
|
4
|
-
src:url(font-path('styles/fonts/icomoon.eot') + '?#iefix-7u8s0f') format('embedded-opentype'),
|
5
|
-
url(font-path('styles/fonts/icomoon.woff') + '?-7u8s0f') format('woff'),
|
6
|
-
url(font-path('styles/fonts/icomoon.ttf') + '?-7u8s0f') format('truetype'),
|
7
|
-
url(font-path('styles/fonts/icomoon.svg') + '?-7u8s0f#icomoon') format('svg');
|
3
|
+
src:url(font-path('lanes/styles/fonts/icomoon.eot') + '?-7u8s0f');
|
4
|
+
src:url(font-path('lanes/styles/fonts/icomoon.eot') + '?#iefix-7u8s0f') format('embedded-opentype'),
|
5
|
+
url(font-path('lanes/styles/fonts/icomoon.woff') + '?-7u8s0f') format('woff'),
|
6
|
+
url(font-path('lanes/styles/fonts/icomoon.ttf') + '?-7u8s0f') format('truetype'),
|
7
|
+
url(font-path('lanes/styles/fonts/icomoon.svg') + '?-7u8s0f#icomoon') format('svg');
|
8
8
|
font-weight: normal;
|
9
9
|
font-style: normal;
|
10
10
|
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|