lanes 0.1.9.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Rakefile +1 -1
- data/client/lanes/Boot.cjsx +3 -3
- data/client/lanes/Config.coffee +38 -3
- data/client/lanes/access/Extension.coffee +1 -1
- data/client/lanes/access/LoginDialog.cjsx +57 -47
- data/client/lanes/access/Roles.coffee +2 -2
- data/client/lanes/access/User.coffee +4 -3
- data/client/lanes/access/screens/user-management/UserManagement.cjsx +12 -11
- data/client/lanes/components/calendar/Calendar.cjsx +16 -0
- data/client/lanes/components/calendar/index.js +3 -0
- data/client/lanes/components/calendar/styles.scss +3 -0
- data/client/lanes/components/grid/Body.cjsx +86 -0
- data/client/lanes/components/grid/CellStyles.coffee +20 -0
- data/client/lanes/components/grid/EditingMixin.cjsx +84 -24
- data/client/lanes/components/grid/Editor.cjsx +45 -0
- data/client/lanes/components/grid/Grid.cjsx +62 -104
- data/client/lanes/components/grid/Header.cjsx +35 -0
- data/client/lanes/components/grid/PopOverMixin.cjsx +19 -9
- data/client/lanes/components/grid/PopoverEditor.cjsx +7 -1
- data/client/lanes/components/grid/RowEditor.cjsx +1 -1
- data/client/lanes/components/grid/Selections.cjsx +39 -0
- data/client/lanes/components/grid/Toolbar.cjsx +24 -5
- data/client/lanes/components/grid/editors.scss +22 -50
- data/client/lanes/components/grid/index.js +0 -1
- data/client/lanes/components/grid/row-editor.scss +68 -0
- data/client/lanes/components/grid/styles.scss +79 -3
- data/client/lanes/components/modal/Modal.cjsx +64 -24
- data/client/lanes/components/modal/styles.scss +12 -0
- data/client/lanes/components/record-finder/Clause.cjsx +11 -4
- data/client/lanes/components/record-finder/Dialog.cjsx +23 -24
- data/client/lanes/components/record-finder/RecordFinder.cjsx +45 -14
- data/client/lanes/components/record-finder/styles.scss +9 -6
- data/client/lanes/components/select-field/SelectField.cjsx +108 -53
- data/client/lanes/components/select-field/styles.scss +19 -0
- data/client/lanes/components/shared/ControlLabel.cjsx +45 -0
- data/client/lanes/components/shared/DateTime.cjsx +48 -0
- data/client/lanes/components/shared/DisplayValue.cjsx +16 -0
- data/client/lanes/components/shared/FieldMixin.cjsx +54 -23
- data/client/lanes/components/shared/FieldSet.cjsx +12 -35
- data/client/lanes/components/shared/FieldWrapper.cjsx +13 -0
- data/client/lanes/components/shared/FormGroup.cjsx +37 -0
- data/client/lanes/components/shared/Icon.cjsx +20 -0
- data/client/lanes/components/shared/ImageSaver.cjsx +33 -0
- data/client/lanes/components/shared/Input.cjsx +19 -0
- data/client/lanes/components/shared/InputFieldMixin.cjsx +48 -0
- data/client/lanes/components/shared/JobProgress.cjsx +27 -0
- data/client/lanes/components/shared/NetworkActivityOverlay.cjsx +58 -0
- data/client/lanes/components/shared/NumberInput.cjsx +29 -0
- data/client/lanes/components/shared/ResizeSensor.cjsx +11 -0
- data/client/lanes/components/shared/ScreenWrapper.cjsx +13 -0
- data/client/lanes/components/shared/Throbber.cjsx +3 -0
- data/client/lanes/components/shared/ToggleField.cjsx +33 -0
- data/client/lanes/components/shared/Tooltip.cjsx +2 -2
- data/client/lanes/components/shared/fields.scss +75 -13
- data/client/lanes/components/shared/fieldset.scss +3 -5
- data/client/lanes/components/shared/image-saver.scss +38 -0
- data/client/lanes/components/shared/index.js +2 -0
- data/client/lanes/{styles/plugins → components/shared}/overlay.scss +17 -4
- data/client/lanes/components/shared/resize-sensor.scss +30 -0
- data/client/lanes/components/shared/styles.scss +13 -0
- data/client/lanes/components/shared/throbber.scss +53 -0
- data/client/lanes/components/toolbar/RemoteChangeSets.cjsx +21 -48
- data/client/lanes/components/toolbar/SaveButton.cjsx +24 -0
- data/client/lanes/components/toolbar/Toolbar.cjsx +24 -37
- data/client/lanes/components/toolbar/changes-notification.scss +10 -6
- data/client/lanes/components/toolbar/styles.scss +29 -9
- data/client/lanes/extension/Base.coffee +4 -5
- data/client/lanes/index.js +0 -1
- data/client/lanes/index.scss.erb +10 -1
- data/client/lanes/lib/HotReload.coffee +13 -15
- data/client/lanes/lib/MakeBaseClass.coffee +6 -1
- data/client/lanes/lib/development.coffee +2 -0
- data/client/lanes/lib/dom-polyfills.coffee +5 -0
- data/client/lanes/lib/dom.coffee +38 -9
- data/client/lanes/lib/format.coffee +11 -0
- data/client/lanes/lib/index.js.erb +2 -0
- data/client/lanes/lib/production.coffee +6 -0
- data/client/lanes/lib/utilFunctions.coffee +50 -15
- data/client/lanes/models/AssociationMap.coffee +122 -46
- data/client/lanes/models/AssociationProxy.coffee +147 -0
- data/client/lanes/models/Base.coffee +97 -85
- data/client/lanes/models/ChangeMonitor.coffee +7 -3
- data/client/lanes/models/ChangeSet.coffee +2 -2
- data/client/lanes/models/Collection.coffee +49 -6
- data/client/lanes/models/JobStatus.coffee +32 -0
- data/client/lanes/models/PubSub.coffee +7 -5
- data/client/lanes/models/Query.coffee +115 -34
- data/client/lanes/models/ServerCache.coffee +67 -52
- data/client/lanes/models/State.coffee +97 -0
- data/client/lanes/models/Sync.coffee +18 -13
- data/client/lanes/models/SystemSettings.coffee +0 -0
- data/client/lanes/models/index.js +1 -0
- data/client/lanes/models/mixins/FileSupport.coffee +60 -0
- data/client/lanes/models/mixins/HasCodeField.coffee +13 -6
- data/client/lanes/models/query/ArrayResult.coffee +188 -0
- data/client/lanes/models/query/CollectionResult.coffee +71 -0
- data/client/lanes/models/query/Result.coffee +9 -0
- data/client/lanes/react/Component.coffee +7 -3
- data/client/lanes/react/PubSub.coffee +7 -7
- data/client/lanes/react/Root.cjsx +1 -4
- data/client/lanes/react/Screen.coffee +1 -0
- data/client/lanes/react/TypeValidators.coffee +3 -3
- data/client/lanes/react/Viewport.coffee +41 -7
- data/client/lanes/react/index.js +0 -1
- data/client/lanes/react/mixins/Access.coffee +4 -1
- data/client/lanes/react/mixins/Data.coffee +40 -25
- data/client/lanes/react/mixins/FieldErrors.coffee +27 -0
- data/client/lanes/react/mixins/RelayEditingState.coffee +4 -0
- data/client/lanes/react/mixins/Screen.coffee +14 -0
- data/client/lanes/react/mixins/Viewport.coffee +9 -3
- data/client/lanes/screens/ChangeListener.coffee +3 -3
- data/client/lanes/screens/Commands.coffee +14 -7
- data/client/lanes/screens/CommonComponents.cjsx +20 -0
- data/client/lanes/screens/Definitions.coffee +64 -20
- data/client/lanes/screens/SystemSettings.cjsx +56 -0
- data/client/lanes/screens/UserPreferences.cjsx +38 -0
- data/client/lanes/screens/index.js +3 -0
- data/client/lanes/screens/styles.scss +2 -1
- data/client/lanes/styles/fonts.scss +1 -0
- data/client/lanes/styles/global.scss +2 -1
- data/client/lanes/styles/global/flexbox.scss +16 -0
- data/client/lanes/styles/global/styles.scss +1 -0
- data/client/lanes/styles/mixins/_dropdown.scss +21 -0
- data/client/lanes/styles/mixins/_flexbox.scss +394 -0
- data/client/lanes/styles/mixins/all.scss +2 -0
- data/client/lanes/styles/variables.scss +28 -0
- data/client/lanes/testing/BeforeEach.coffee +15 -14
- data/client/lanes/testing/Helpers.coffee +14 -5
- data/client/lanes/testing/TestObjects.coffee +10 -2
- data/client/lanes/testing/index.js +1 -0
- data/client/lanes/testing/jasmine-react.js +125 -0
- data/client/lanes/vendor/base.js +56049 -74987
- data/client/lanes/vendor/calendar.js +17301 -0
- data/client/lanes/vendor/calendar.scss +303 -0
- data/client/lanes/vendor/commons.js +14990 -15847
- data/client/lanes/vendor/development.js +4912 -1952
- data/client/lanes/vendor/grid.js +14246 -5551
- data/client/lanes/vendor/grid.scss +876 -335
- data/client/lanes/vendor/index.js +1 -0
- data/client/lanes/vendor/message-bus-ajax.js +44 -0
- data/client/lanes/vendor/message-bus.js +414 -0
- data/client/lanes/vendor/rw-widgets.eot +0 -0
- data/client/lanes/vendor/rw-widgets.svg +18 -0
- data/client/lanes/vendor/rw-widgets.ttf +0 -0
- data/client/lanes/vendor/rw-widgets.woff +0 -0
- data/client/lanes/vendor/toggle.js +345 -0
- data/client/lanes/vendor/toggle.scss +138 -0
- data/client/lanes/vendor/widgets.js +21245 -6839
- data/client/lanes/vendor/widgets.scss +83 -67
- data/client/lanes/workspace/Layout.cjsx +18 -8
- data/client/lanes/workspace/Modal.cjsx +47 -0
- data/client/lanes/workspace/Navbar.cjsx +16 -2
- data/client/lanes/workspace/ScreenView.cjsx +10 -3
- data/client/lanes/workspace/ScreensMenu.cjsx +23 -7
- data/client/lanes/workspace/Tabs.cjsx +55 -0
- data/client/lanes/workspace/UIState.coffee +7 -8
- data/client/lanes/workspace/index.js +2 -1
- data/client/lanes/workspace/mixin.coffee +11 -0
- data/client/lanes/workspace/mixins/UIState.coffee +8 -0
- data/client/lanes/workspace/mixins/index.js +3 -0
- data/client/lanes/workspace/styles.scss +2 -1
- data/client/lanes/workspace/styles/header.scss +23 -1
- data/client/lanes/workspace/styles/layout.scss +26 -24
- data/client/lanes/workspace/styles/screens.scss +0 -4
- data/client/lanes/workspace/styles/tabs.scss +3 -10
- data/config/routes.rb +10 -4
- data/config/screens.rb +25 -0
- data/db/migrate/01_create_system_settings.rb +10 -0
- data/docs/todo-example-part-1.md +18 -20
- data/lanes.gemspec +15 -6
- data/lib/lanes.rb +4 -2
- data/lib/lanes/access/config/routes.rb +5 -3
- data/lib/lanes/access/config/screens.rb +1 -0
- data/lib/lanes/access/db/migrate/20140615031600_create_lanes_users.rb +1 -1
- data/lib/lanes/access/user.rb +1 -1
- data/lib/lanes/api.rb +2 -1
- data/lib/lanes/api/controller.rb +32 -71
- data/lib/lanes/api/default_routes.rb +10 -8
- data/lib/lanes/api/formatted_reply.rb +53 -0
- data/lib/lanes/api/handlers/file.rb +26 -0
- data/lib/lanes/api/helper_methods.rb +29 -5
- data/lib/lanes/api/javascript_processor.rb +36 -17
- data/lib/lanes/api/pub_sub.rb +6 -9
- data/lib/lanes/api/request_wrapper.rb +1 -2
- data/lib/lanes/api/root.rb +11 -43
- data/lib/lanes/api/routing.rb +63 -0
- data/lib/lanes/api/sprockets_extension.rb +15 -7
- data/lib/lanes/api/updates.rb +1 -2
- data/lib/lanes/command.rb +0 -1
- data/lib/lanes/command/app.rb +6 -5
- data/lib/lanes/command/console.rb +1 -0
- data/lib/lanes/command/generate.rb +3 -0
- data/lib/lanes/command/generate_migration.rb +33 -0
- data/lib/lanes/command/generate_model.rb +4 -26
- data/lib/lanes/command/migration_support.rb +29 -0
- data/lib/lanes/command/update_model.rb +14 -5
- data/lib/lanes/concerns/all.rb +2 -0
- data/lib/lanes/concerns/api_path.rb +4 -2
- data/lib/lanes/concerns/association_extensions.rb +1 -1
- data/lib/lanes/concerns/attr_accessor_with_default.rb +3 -1
- data/lib/lanes/concerns/code_identifier.rb +1 -1
- data/lib/lanes/concerns/image_uploader.rb +42 -0
- data/lib/lanes/concerns/pub_sub.rb +0 -1
- data/lib/lanes/concerns/queries.rb +2 -2
- data/lib/lanes/concerns/set_attribute_data.rb +4 -13
- data/lib/lanes/concerns/sorting_expressions.rb +34 -0
- data/lib/lanes/configuration.rb +48 -9
- data/lib/lanes/extension.rb +16 -7
- data/lib/lanes/extension/definition.rb +8 -2
- data/lib/lanes/job.rb +78 -0
- data/lib/lanes/job/failure_logger.rb +33 -0
- data/lib/lanes/model.rb +4 -0
- data/lib/lanes/rake_tasks.rb +6 -0
- data/lib/lanes/redis.rb +13 -0
- data/lib/lanes/screen.rb +34 -18
- data/lib/lanes/system_settings.rb +66 -0
- data/lib/lanes/version.rb +1 -1
- data/lib/lanes/workspace/extension.rb +1 -1
- data/npm-build/base.js +10 -3
- data/npm-build/calendar.js +6 -0
- data/npm-build/development.js +4 -5
- data/npm-build/grid.js +3 -5
- data/npm-build/package.json +40 -29
- data/npm-build/react-toggle.js +5 -0
- data/npm-build/react-widgets.js +6 -0
- data/npm-build/update-dayz +14 -0
- data/npm-build/webpack.config.js +5 -2
- data/spec/command-reference-files/initial/Gemfile +1 -1
- data/spec/command-reference-files/initial/config/routes.rb +2 -0
- data/spec/command-reference-files/initial/lib/appy-app.rb +4 -0
- data/spec/command-reference-files/initial/lib/appy-app/extension.rb +2 -0
- data/spec/command-reference-files/initial/spec/server/{spec_helpers.rb → spec_helper.rb} +0 -0
- data/spec/command-reference-files/model/config/routes.rb +2 -0
- data/spec/command-reference-files/model/spec/server/test_test_spec.rb +1 -1
- data/spec/command-reference-files/screen/client/appy-app/screens/ready-set-go/ReadySetGo.cjsx +6 -4
- data/spec/command-reference-files/screen/client/appy-app/screens/ready-set-go/index.scss +4 -3
- data/spec/command-reference-files/screen/config/screens.rb +4 -2
- data/spec/command-reference-files/screen/spec/appy-app/screens/ready-set-go/ReadySetGoSpec.coffee +1 -1
- data/spec/fixtures/system_settings.yml +1 -0
- data/spec/lanes/components/grid/GridSpec.coffee +56 -31
- data/spec/lanes/components/grid/RowEditorSpec.coffee +96 -0
- data/spec/lanes/components/select-field/SelectFieldSpec.coffee +99 -0
- data/spec/lanes/components/shared/NetworkActivityOverlaySpec.coffee +34 -0
- data/spec/lanes/models/AssociationMapSpec.coffee +36 -2
- data/spec/lanes/models/AssociationProxySpec.coffee +77 -0
- data/spec/lanes/models/BaseSpec.coffee +37 -4
- data/spec/lanes/models/CollectionSpec.coffee +11 -17
- data/spec/lanes/models/PubSubSpec.coffee +1 -1
- data/spec/lanes/models/ServerCacheSpec.coffee +65 -0
- data/spec/server/api/coffeescript_processor_spec.rb +1 -1
- data/spec/server/concerns/pub_sub_spec.rb +9 -10
- data/spec/server/concerns/sorting_expressions_spec.rb +34 -0
- data/spec/server/configuration_spec.rb +3 -3
- data/spec/server/job_spec.rb +54 -0
- data/spec/server/spec_helper.rb +0 -5
- data/spec/server/system_settings_spec.rb +23 -0
- data/templates/client/screens/Screen.cjsx +6 -4
- data/templates/client/screens/styles.scss +4 -3
- data/templates/config/routes.rb +2 -0
- data/templates/config/screen.rb +4 -2
- data/templates/lib/namespace.rb +4 -0
- data/templates/lib/namespace/extension.rb +2 -0
- data/templates/spec/client/Screen.coffee +1 -1
- data/templates/spec/server/model_spec.rb +1 -1
- data/templates/spec/server/{spec_helpers.rb → spec_helper.rb} +0 -0
- data/views/lanes_root_view.erb +70 -0
- data/views/specs.erb +2 -2
- metadata +207 -68
- data/client/images/lanes/dataTables/Sorting icons.psd +0 -0
- data/client/images/lanes/dataTables/back_disabled.png +0 -0
- data/client/images/lanes/dataTables/back_enabled.png +0 -0
- data/client/images/lanes/dataTables/back_enabled_hover.png +0 -0
- data/client/images/lanes/dataTables/favicon.ico +0 -0
- data/client/images/lanes/dataTables/forward_disabled.png +0 -0
- data/client/images/lanes/dataTables/forward_enabled.png +0 -0
- data/client/images/lanes/dataTables/forward_enabled_hover.png +0 -0
- data/client/images/lanes/dataTables/loading-background.png +0 -0
- data/client/images/lanes/dataTables/sort_asc.png +0 -0
- data/client/images/lanes/dataTables/sort_asc_disabled.png +0 -0
- data/client/images/lanes/dataTables/sort_both.png +0 -0
- data/client/images/lanes/dataTables/sort_desc.png +0 -0
- data/client/images/lanes/dataTables/sort_desc_disabled.png +0 -0
- data/client/lanes/components/shared/Resize.cjsx +0 -152
- data/client/lanes/components/shared/TextArea.cjsx +0 -19
- data/client/lanes/components/shared/TextField.cjsx +0 -25
- data/client/lanes/models/Bootstrap.coffee +0 -5
- data/client/lanes/models/QueryResults.coffee +0 -93
- data/client/lanes/react/FormBindings.coffee +0 -103
- data/client/lanes/react/Router.cjsx +0 -18
- data/client/lanes/styles/dataTables.scss +0 -4
- data/client/lanes/styles/plugins/all.scss +0 -2
- data/client/lanes/styles/plugins/resize-sensor.scss +0 -24
- data/client/lanes/vendor/jquery-2.js +0 -9190
- data/client/lanes/vendor/jquery.tap.js +0 -401
- data/client/lanes/vendor/magicsuggest.js +0 -1565
- data/client/lanes/vendor/message-bus.coffee +0 -264
- data/client/lanes/workspace/ActiveScreenSwitcher.cjsx +0 -38
- data/client/lanes/workspace/styles/toolbar.scss +0 -4
- data/lib/lanes/api/eco.js +0 -516
- data/lib/lanes/api/sprockets_compressor.rb +0 -39
- data/spec/command-reference-files/model/lib/appy-app.rb +0 -11
- data/views/index.erb +0 -19
@@ -1,264 +0,0 @@
|
|
1
|
-
###jshint bitwise: false###
|
2
|
-
|
3
|
-
###*
|
4
|
-
Message Bus functionality.
|
5
|
-
|
6
|
-
@class MessageBus
|
7
|
-
@namespace Discourse
|
8
|
-
@module Discourse
|
9
|
-
*
|
10
|
-
###
|
11
|
-
|
12
|
-
Lanes.Vendor.MessageBus = do ->
|
13
|
-
# http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
|
14
|
-
callbacks = undefined
|
15
|
-
clientId = undefined
|
16
|
-
failCount = undefined
|
17
|
-
shouldLongPoll = undefined
|
18
|
-
queue = undefined
|
19
|
-
responseCallbacks = undefined
|
20
|
-
uniqueId = undefined
|
21
|
-
baseUrl = undefined
|
22
|
-
me = undefined
|
23
|
-
started = undefined
|
24
|
-
stopped = undefined
|
25
|
-
longPoller = undefined
|
26
|
-
pollTimeout = undefined
|
27
|
-
|
28
|
-
uniqueId = ->
|
29
|
-
'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace /[xy]/g, (c) ->
|
30
|
-
r = undefined
|
31
|
-
v = undefined
|
32
|
-
r = Math.random() * 16 | 0
|
33
|
-
v = if c == 'x' then r else r & 0x3 | 0x8
|
34
|
-
v.toString 16
|
35
|
-
|
36
|
-
clientId = uniqueId()
|
37
|
-
responseCallbacks = {}
|
38
|
-
callbacks = []
|
39
|
-
queue = []
|
40
|
-
interval = null
|
41
|
-
failCount = 0
|
42
|
-
baseUrl = '/'
|
43
|
-
|
44
|
-
### TODO: The plan is to force a long poll as soon as page becomes visible
|
45
|
-
// MIT based off https://github.com/mathiasbynens/jquery-visibility/blob/master/jquery-visibility.js
|
46
|
-
initVisibilityTracking = function(window, document, $, undefined) {
|
47
|
-
var prefix;
|
48
|
-
var property;
|
49
|
-
// In Opera, `'onfocusin' in document == true`, hence the extra `hasFocus` check to detect IE-like behavior
|
50
|
-
var eventName = 'onfocusin' in document && 'hasFocus' in document ? 'focusin focusout' : 'focus blur';
|
51
|
-
var prefixes = ['webkit', 'o', 'ms', 'moz', ''];
|
52
|
-
var $event = $.event;
|
53
|
-
|
54
|
-
while ((prefix = prefixes.pop()) !== undefined) {
|
55
|
-
property = (prefix ? prefix + 'H': 'h') + 'idden';
|
56
|
-
var supportsVisibility = typeof document[property] === 'boolean';
|
57
|
-
if (supportsVisibility) {
|
58
|
-
eventName = prefix + 'visibilitychange';
|
59
|
-
break;
|
60
|
-
}
|
61
|
-
}
|
62
|
-
|
63
|
-
$(/blur$/.test(eventName) ? window : document).on(eventName, function(event) {
|
64
|
-
var type = event.type;
|
65
|
-
var originalEvent = event.originalEvent;
|
66
|
-
|
67
|
-
// Avoid errors from triggered native events for which `originalEvent` is
|
68
|
-
// not available.
|
69
|
-
if (!originalEvent) {
|
70
|
-
return;
|
71
|
-
}
|
72
|
-
|
73
|
-
var toElement = originalEvent.toElement;
|
74
|
-
|
75
|
-
// If it's a `{focusin,focusout}` event (IE), `fromElement` and `toElement`
|
76
|
-
// should both be `null` or `undefined`; else, the page visibility hasn't
|
77
|
-
// changed, but the user just clicked somewhere in the doc. In IE9, we need
|
78
|
-
// to check the `relatedTarget` property instead.
|
79
|
-
if (
|
80
|
-
!/^focus./.test(type) || (
|
81
|
-
toElement === undefined &&
|
82
|
-
originalEvent.fromElement === undefined &&
|
83
|
-
originalEvent.relatedTarget === undefined
|
84
|
-
)
|
85
|
-
) {
|
86
|
-
visibilityChanged(property && document[property] || /^(?:blur|focusout)$/.test(type) ? 'hide' : 'show');
|
87
|
-
}
|
88
|
-
});
|
89
|
-
|
90
|
-
};
|
91
|
-
###
|
92
|
-
|
93
|
-
hiddenProperty = undefined
|
94
|
-
_.each ['', 'webkit', 'ms', 'moz', 'ms'], (index, prefix) ->
|
95
|
-
check = prefix + (if prefix == '' then 'hidden' else 'Hidden')
|
96
|
-
if document[check] != undefined
|
97
|
-
hiddenProperty = check
|
98
|
-
return
|
99
|
-
|
100
|
-
isHidden = ->
|
101
|
-
if hiddenProperty != undefined
|
102
|
-
document[hiddenProperty]
|
103
|
-
else
|
104
|
-
!document.hasFocus
|
105
|
-
|
106
|
-
shouldLongPoll = ->
|
107
|
-
me.alwaysLongPoll or !isHidden()
|
108
|
-
|
109
|
-
totalAjaxFailures = 0
|
110
|
-
totalAjaxCalls = 0
|
111
|
-
lastAjax = undefined
|
112
|
-
|
113
|
-
longPoller = (poll, data) ->
|
114
|
-
gotData = false
|
115
|
-
aborted = false
|
116
|
-
lastAjax = new Date
|
117
|
-
totalAjaxCalls += 1
|
118
|
-
|
119
|
-
error = (err, resp, body) ->
|
120
|
-
if me.aborted
|
121
|
-
aborted = true
|
122
|
-
me.aborted = false
|
123
|
-
else
|
124
|
-
failCount += 1
|
125
|
-
totalAjaxFailures += 1
|
126
|
-
|
127
|
-
success = (body) ->
|
128
|
-
messages = JSON.parse(body)
|
129
|
-
failCount = 0
|
130
|
-
if messages == null
|
131
|
-
return
|
132
|
-
# server unexpectedly closed connection
|
133
|
-
_.each messages, (message) ->
|
134
|
-
gotData = true
|
135
|
-
_.each callbacks, (callback) ->
|
136
|
-
if callback.channel == message.channel
|
137
|
-
callback.last_id = message.message_id
|
138
|
-
try
|
139
|
-
callback.func message.data
|
140
|
-
catch e
|
141
|
-
if console.log
|
142
|
-
console.log 'MESSAGE BUS FAIL: callback ' +
|
143
|
-
callback.channel + ' caused exception ' +
|
144
|
-
e.message
|
145
|
-
if message.channel == '/__status'
|
146
|
-
if message.data[callback.channel] != undefined
|
147
|
-
callback.last_id = message.data[callback.channel]
|
148
|
-
return
|
149
|
-
return
|
150
|
-
|
151
|
-
complete = ->
|
152
|
-
interval = undefined
|
153
|
-
try
|
154
|
-
if gotData or aborted
|
155
|
-
interval = 100
|
156
|
-
else
|
157
|
-
interval = me.callbackInterval
|
158
|
-
if failCount > 2
|
159
|
-
interval = interval * failCount
|
160
|
-
else if !shouldLongPoll()
|
161
|
-
# slowing down stuff a lot when hidden
|
162
|
-
# we will need to fine tune this
|
163
|
-
interval = interval * 4
|
164
|
-
if interval > me.maxPollInterval
|
165
|
-
interval = me.maxPollInterval
|
166
|
-
interval -= new Date - lastAjax
|
167
|
-
if interval < 100
|
168
|
-
interval = 100
|
169
|
-
catch e
|
170
|
-
if console.log and e.message
|
171
|
-
console.log 'MESSAGE BUS FAIL: ' + e.message
|
172
|
-
_.delay(poll, interval)
|
173
|
-
me.longPoll = null
|
174
|
-
|
175
|
-
options = {
|
176
|
-
url: me.baseUrl + 'message-bus/' + me.clientId + '/poll?'
|
177
|
-
body: Lanes.lib.objToParam(data)
|
178
|
-
timeout: pollTimeout
|
179
|
-
method: 'POST'
|
180
|
-
headers:
|
181
|
-
'Content-Type': 'multipart/form-data'
|
182
|
-
'X_CSRF_TOKEN': Lanes.config.csrf_token
|
183
|
-
'X-SILENCE-LOGGER': 'true'
|
184
|
-
}
|
185
|
-
if !shouldLongPoll() or !me.enableLongPolling
|
186
|
-
options.url += 'dlp=t'
|
187
|
-
Lanes.Vendor.xhr(options, (err, resp, body) ->
|
188
|
-
if err then error(err, resp, body) else success(body)
|
189
|
-
complete()
|
190
|
-
)
|
191
|
-
|
192
|
-
me =
|
193
|
-
enableLongPolling: true
|
194
|
-
callbackInterval: 15000
|
195
|
-
maxPollInterval: 3 * 60 * 1000
|
196
|
-
callbacks: callbacks
|
197
|
-
clientId: clientId
|
198
|
-
alwaysLongPoll: false
|
199
|
-
baseUrl: baseUrl
|
200
|
-
diagnostics: ->
|
201
|
-
console.log 'Stopped: ' + stopped + ' Started: ' + started
|
202
|
-
console.log 'Current callbacks'
|
203
|
-
console.log callbacks
|
204
|
-
console.log 'Total ajax calls: ' + totalAjaxCalls + ' Recent failure count: ' + failCount + ' Total failures: ' + totalAjaxFailures
|
205
|
-
console.log 'Last ajax call: ' + (new Date - lastAjax) / 1000 + ' seconds ago'
|
206
|
-
return
|
207
|
-
stop: ->
|
208
|
-
stopped = true
|
209
|
-
started = false
|
210
|
-
return
|
211
|
-
start: (opts) ->
|
212
|
-
poll = undefined
|
213
|
-
if started
|
214
|
-
return
|
215
|
-
started = true
|
216
|
-
stopped = false
|
217
|
-
if !opts
|
218
|
-
opts = {}
|
219
|
-
|
220
|
-
poll = ->
|
221
|
-
data = undefined
|
222
|
-
if stopped
|
223
|
-
return
|
224
|
-
if callbacks.length == 0
|
225
|
-
setTimeout poll, 500
|
226
|
-
return
|
227
|
-
data = {}
|
228
|
-
_.each callbacks, (callback) ->
|
229
|
-
data[callback.channel] = callback.last_id
|
230
|
-
return
|
231
|
-
me.longPoll = longPoller(poll, data)
|
232
|
-
return
|
233
|
-
|
234
|
-
poll()
|
235
|
-
return
|
236
|
-
subscribe: (channel, func, lastId) ->
|
237
|
-
if !started and !stopped
|
238
|
-
me.start()
|
239
|
-
if typeof lastId != 'number' or lastId < -1
|
240
|
-
lastId = -1
|
241
|
-
callbacks.push
|
242
|
-
channel: channel
|
243
|
-
func: func
|
244
|
-
last_id: lastId
|
245
|
-
if me.longPoll
|
246
|
-
me.aborted = true
|
247
|
-
return me.longPoll.abort()
|
248
|
-
return
|
249
|
-
unsubscribe: (channel) ->
|
250
|
-
# TODO proper globbing
|
251
|
-
glob = undefined
|
252
|
-
if channel.indexOf('*', channel.length - 1) != -1
|
253
|
-
channel = channel.substr(0, channel.length - 1)
|
254
|
-
glob = true
|
255
|
-
_.remove(callbacks, (callback) ->
|
256
|
-
if glob
|
257
|
-
callback.channel.substr(0, channel.length) == channel
|
258
|
-
else
|
259
|
-
callback.channel == channel
|
260
|
-
)
|
261
|
-
if me.longPoll
|
262
|
-
me.longPoll.abort()
|
263
|
-
me.longPoll = false
|
264
|
-
me
|
@@ -1,38 +0,0 @@
|
|
1
|
-
class TabView extends Lanes.React.Component
|
2
|
-
|
3
|
-
activate: ->
|
4
|
-
@model.active = true
|
5
|
-
null
|
6
|
-
|
7
|
-
close: ->
|
8
|
-
@model.remove()
|
9
|
-
|
10
|
-
render: ->
|
11
|
-
<li key={@model.cid} className={_.classnames(active: @model.active)}>
|
12
|
-
<a onClick={@activate} className='tab'>{@model.screen.title}</a>
|
13
|
-
<span onClick={@close} className='close'>×</span>
|
14
|
-
</li>
|
15
|
-
|
16
|
-
|
17
|
-
class Lanes.Workspace.ActiveScreenSwitcher extends Lanes.React.Component
|
18
|
-
|
19
|
-
dataObjects:
|
20
|
-
collection: -> Lanes.Screens.Definitions.displaying
|
21
|
-
|
22
|
-
render: ->
|
23
|
-
<div className="menu-container">
|
24
|
-
<div className="active-screens">
|
25
|
-
<div className="scroller scroller-left">
|
26
|
-
<i className="glyphicon glyphicon-chevron-left"/>
|
27
|
-
</div>
|
28
|
-
<div className="scroller scroller-right">
|
29
|
-
<i className="glyphicon glyphicon-chevron-right"/>
|
30
|
-
</div>
|
31
|
-
<div className="wrapper">
|
32
|
-
<ul className="nav nav-tabs">
|
33
|
-
{ @collection.map (view) ->
|
34
|
-
<TabView key={view.id} model=view /> }
|
35
|
-
</ul>
|
36
|
-
</div>
|
37
|
-
</div>
|
38
|
-
</div>
|
data/lib/lanes/api/eco.js
DELETED
@@ -1,516 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Eco Compiler v1.1.0-rc-3
|
3
|
-
* http://github.com/sstephenson/eco
|
4
|
-
*
|
5
|
-
* Copyright (c) 2011 Sam Stephenson
|
6
|
-
* Released under the MIT License
|
7
|
-
*/
|
8
|
-
this.eco = (function(modules) {
|
9
|
-
return function require(name) {
|
10
|
-
var fn, module = {id: name, exports: {}};
|
11
|
-
if (fn = modules[name]) {
|
12
|
-
fn(module, require, module.exports);
|
13
|
-
return module.exports;
|
14
|
-
} else {
|
15
|
-
throw 'Cannot find module \'' + name + '\'';
|
16
|
-
}
|
17
|
-
};
|
18
|
-
})({
|
19
|
-
'eco': function(module, require, exports) {
|
20
|
-
// Generated by CoffeeScript 1.6.3
|
21
|
-
(function() {
|
22
|
-
var compile, eco, precompile, preprocess, _ref;
|
23
|
-
|
24
|
-
_ref = require("./compiler"), compile = _ref.compile, precompile = _ref.precompile;
|
25
|
-
|
26
|
-
preprocess = require("./preprocessor").preprocess;
|
27
|
-
|
28
|
-
module.exports = eco = function(source) {
|
29
|
-
var _base;
|
30
|
-
if (eco.cache) {
|
31
|
-
return (_base = eco.cache)[source] != null ? (_base = eco.cache)[source] : _base[source] = compile(source);
|
32
|
-
} else {
|
33
|
-
return compile(source);
|
34
|
-
}
|
35
|
-
};
|
36
|
-
|
37
|
-
eco.cache = {};
|
38
|
-
|
39
|
-
eco.preprocess = preprocess;
|
40
|
-
|
41
|
-
eco.precompile = precompile;
|
42
|
-
|
43
|
-
eco.compile = compile;
|
44
|
-
|
45
|
-
eco.render = function(source, data) {
|
46
|
-
return (eco(source))(data);
|
47
|
-
};
|
48
|
-
|
49
|
-
if (require.extensions) {
|
50
|
-
require.extensions[".eco"] = function(module, filename) {
|
51
|
-
var source;
|
52
|
-
source = require("fs").readFileSync(filename, "utf-8");
|
53
|
-
return module._compile("module.exports = " + (precompile(source)), filename);
|
54
|
-
};
|
55
|
-
}
|
56
|
-
|
57
|
-
}).call(this);
|
58
|
-
|
59
|
-
},
|
60
|
-
'./compiler': function(module, require, exports) {
|
61
|
-
// Generated by CoffeeScript 1.6.3
|
62
|
-
(function() {
|
63
|
-
var CoffeeScript, indent, precompile, preprocess;
|
64
|
-
|
65
|
-
CoffeeScript = require("coffee-script");
|
66
|
-
|
67
|
-
preprocess = require("./preprocessor").preprocess;
|
68
|
-
|
69
|
-
indent = require("./util").indent;
|
70
|
-
|
71
|
-
exports.precompile = precompile = function(source, functions_ns, helpers) {
|
72
|
-
var script;
|
73
|
-
if (helpers == null) {
|
74
|
-
helpers = "ECO";
|
75
|
-
}
|
76
|
-
script = CoffeeScript.compile(preprocess(source), {
|
77
|
-
noWrap: true
|
78
|
-
});
|
79
|
-
return "function(__obj) {\n if (!__obj) __obj = {};\n var __out = [],\n __capture = " + functions_ns + ".capture(__out),__sanitize = " + functions_ns + ".sanitize,\n __safe, __objSafe = __obj.safe, __escape = __obj.escape,__safe = __obj.safe = " + functions_ns + ".safe,\n __escape = __obj.escape = " + functions_ns + ".escape, h = " + helpers + ";\n (function() {\n " + (indent(script, 4)) + "\n }).call(__obj);\n __obj.safe = __objSafe, __obj.escape = __escape;\n return __out.join('');\n}";
|
80
|
-
};
|
81
|
-
|
82
|
-
exports.compile = function(source) {
|
83
|
-
return new Function("return " + (precompile(source)))();
|
84
|
-
};
|
85
|
-
|
86
|
-
}).call(this);
|
87
|
-
|
88
|
-
},
|
89
|
-
'./preprocessor': function(module, require, exports) {
|
90
|
-
// Generated by CoffeeScript 1.6.3
|
91
|
-
(function() {
|
92
|
-
var Preprocessor, Scanner, util;
|
93
|
-
|
94
|
-
Scanner = require("./scanner");
|
95
|
-
|
96
|
-
util = require("./util");
|
97
|
-
|
98
|
-
module.exports = Preprocessor = (function() {
|
99
|
-
Preprocessor.preprocess = function(source) {
|
100
|
-
var preprocessor;
|
101
|
-
preprocessor = new Preprocessor(source);
|
102
|
-
return preprocessor.preprocess();
|
103
|
-
};
|
104
|
-
|
105
|
-
function Preprocessor(source) {
|
106
|
-
this.scanner = new Scanner(source);
|
107
|
-
this.output = "";
|
108
|
-
this.level = 0;
|
109
|
-
this.options = {};
|
110
|
-
this.captures = [];
|
111
|
-
}
|
112
|
-
|
113
|
-
Preprocessor.prototype.preprocess = function() {
|
114
|
-
var _this = this;
|
115
|
-
while (!this.scanner.done) {
|
116
|
-
this.scanner.scan(function(token) {
|
117
|
-
return _this[token[0]].apply(_this, token.slice(1));
|
118
|
-
});
|
119
|
-
}
|
120
|
-
return this.output;
|
121
|
-
};
|
122
|
-
|
123
|
-
Preprocessor.prototype.record = function(line) {
|
124
|
-
this.output += util.repeat(" ", this.level);
|
125
|
-
return this.output += line + "\n";
|
126
|
-
};
|
127
|
-
|
128
|
-
Preprocessor.prototype.printString = function(string) {
|
129
|
-
if (string.length) {
|
130
|
-
return this.record("__out.push " + (util.inspectString(string)));
|
131
|
-
}
|
132
|
-
};
|
133
|
-
|
134
|
-
Preprocessor.prototype.beginCode = function(options) {
|
135
|
-
return this.options = options;
|
136
|
-
};
|
137
|
-
|
138
|
-
Preprocessor.prototype.recordCode = function(code) {
|
139
|
-
if (code !== "end") {
|
140
|
-
if (this.options.print) {
|
141
|
-
if (this.options.safe) {
|
142
|
-
return this.record("__out.push " + code);
|
143
|
-
} else {
|
144
|
-
return this.record("__out.push __sanitize " + code);
|
145
|
-
}
|
146
|
-
} else {
|
147
|
-
return this.record(code);
|
148
|
-
}
|
149
|
-
}
|
150
|
-
};
|
151
|
-
|
152
|
-
Preprocessor.prototype.indent = function(capture) {
|
153
|
-
this.level++;
|
154
|
-
if (capture) {
|
155
|
-
this.record("__capture " + capture);
|
156
|
-
this.captures.unshift(this.level);
|
157
|
-
return this.indent();
|
158
|
-
}
|
159
|
-
};
|
160
|
-
|
161
|
-
Preprocessor.prototype.dedent = function() {
|
162
|
-
this.level--;
|
163
|
-
if (this.level < 0) {
|
164
|
-
this.fail("unexpected dedent");
|
165
|
-
}
|
166
|
-
if (this.captures[0] === this.level) {
|
167
|
-
this.captures.shift();
|
168
|
-
return this.dedent();
|
169
|
-
}
|
170
|
-
};
|
171
|
-
|
172
|
-
Preprocessor.prototype.fail = function(message) {
|
173
|
-
throw "Parse error on line " + this.scanner.lineNo + ": " + message;
|
174
|
-
};
|
175
|
-
|
176
|
-
return Preprocessor;
|
177
|
-
|
178
|
-
})();
|
179
|
-
|
180
|
-
}).call(this);
|
181
|
-
|
182
|
-
},
|
183
|
-
'./scanner': function(module, require, exports) {
|
184
|
-
// Generated by CoffeeScript 1.6.3
|
185
|
-
(function() {
|
186
|
-
var Scanner, StringScanner, trim;
|
187
|
-
|
188
|
-
StringScanner = require("strscan").StringScanner;
|
189
|
-
|
190
|
-
trim = require("./util").trim;
|
191
|
-
|
192
|
-
module.exports = Scanner = (function() {
|
193
|
-
Scanner.modePatterns = {
|
194
|
-
data: /(.*?)(<%%|%%>|<%\s*(\#)|<%(([=-])?)|\n|$)/,
|
195
|
-
code: /(.*?)((((:|(->|=>))\s*))?%>|\n|$)/,
|
196
|
-
comment: /(.*?)(%>|\n|$)/
|
197
|
-
};
|
198
|
-
|
199
|
-
Scanner.dedentablePattern = /^(end|when|else|catch|finally)(?:\W|$)/;
|
200
|
-
|
201
|
-
Scanner.scan = function(source) {
|
202
|
-
var scanner, tokens;
|
203
|
-
tokens = [];
|
204
|
-
scanner = new Scanner(source);
|
205
|
-
while (!scanner.done) {
|
206
|
-
scanner.scan(function(token) {
|
207
|
-
return tokens.push(token);
|
208
|
-
});
|
209
|
-
}
|
210
|
-
return tokens;
|
211
|
-
};
|
212
|
-
|
213
|
-
function Scanner(source) {
|
214
|
-
this.source = source.replace(/\r\n?/g, "\n");
|
215
|
-
this.scanner = new StringScanner(this.source);
|
216
|
-
this.mode = "data";
|
217
|
-
this.buffer = "";
|
218
|
-
this.lineNo = 1;
|
219
|
-
this.done = false;
|
220
|
-
}
|
221
|
-
|
222
|
-
Scanner.prototype.scan = function(callback) {
|
223
|
-
if (this.done) {
|
224
|
-
return callback();
|
225
|
-
} else if (this.scanner.hasTerminated()) {
|
226
|
-
this.done = true;
|
227
|
-
switch (this.mode) {
|
228
|
-
case "data":
|
229
|
-
return callback(["printString", this.flush()]);
|
230
|
-
case "code":
|
231
|
-
return callback(["fail", "unexpected end of template"]);
|
232
|
-
}
|
233
|
-
} else {
|
234
|
-
this.advance();
|
235
|
-
switch (this.mode) {
|
236
|
-
case "data":
|
237
|
-
return this.scanData(callback);
|
238
|
-
case "code":
|
239
|
-
return this.scanCode(callback);
|
240
|
-
case "comment":
|
241
|
-
return this.scanComment(callback);
|
242
|
-
}
|
243
|
-
}
|
244
|
-
};
|
245
|
-
|
246
|
-
Scanner.prototype.advance = function() {
|
247
|
-
this.scanner.scanUntil(Scanner.modePatterns[this.mode]);
|
248
|
-
this.buffer += this.scanner.getCapture(0);
|
249
|
-
this.tail = this.scanner.getCapture(1);
|
250
|
-
this.comment = this.scanner.getCapture(2);
|
251
|
-
this.directive = this.scanner.getCapture(4);
|
252
|
-
return this.arrow = this.scanner.getCapture(5);
|
253
|
-
};
|
254
|
-
|
255
|
-
Scanner.prototype.scanData = function(callback) {
|
256
|
-
if (this.tail === "<%%") {
|
257
|
-
this.buffer += "<%";
|
258
|
-
return this.scan(callback);
|
259
|
-
} else if (this.tail === "%%>") {
|
260
|
-
this.buffer += "%>";
|
261
|
-
return this.scan(callback);
|
262
|
-
} else if (this.tail === "\n") {
|
263
|
-
this.buffer += this.tail;
|
264
|
-
this.lineNo++;
|
265
|
-
return this.scan(callback);
|
266
|
-
} else if (this.tail) {
|
267
|
-
callback(["printString", this.flush()]);
|
268
|
-
if (this.comment) {
|
269
|
-
return this.mode = "comment";
|
270
|
-
} else {
|
271
|
-
this.mode = "code";
|
272
|
-
return callback([
|
273
|
-
"beginCode", {
|
274
|
-
print: this.directive != null,
|
275
|
-
safe: this.directive === "-"
|
276
|
-
}
|
277
|
-
]);
|
278
|
-
}
|
279
|
-
}
|
280
|
-
};
|
281
|
-
|
282
|
-
Scanner.prototype.scanCode = function(callback) {
|
283
|
-
var code;
|
284
|
-
if (this.tail === "\n") {
|
285
|
-
return callback(["fail", "unexpected newline in code block"]);
|
286
|
-
} else if (this.tail) {
|
287
|
-
this.mode = "data";
|
288
|
-
code = trim(this.flush());
|
289
|
-
if (this.arrow) {
|
290
|
-
code += " " + this.arrow;
|
291
|
-
}
|
292
|
-
if (this.isDedentable(code)) {
|
293
|
-
callback(["dedent"]);
|
294
|
-
}
|
295
|
-
callback(["recordCode", code]);
|
296
|
-
if (this.directive) {
|
297
|
-
return callback(["indent", this.arrow]);
|
298
|
-
}
|
299
|
-
}
|
300
|
-
};
|
301
|
-
|
302
|
-
Scanner.prototype.scanComment = function(callback) {
|
303
|
-
if (this.tail === "\n") {
|
304
|
-
return callback(["fail", "unexpected newline in code block"]);
|
305
|
-
} else if (this.tail) {
|
306
|
-
this.mode = "data";
|
307
|
-
return this.buffer = "";
|
308
|
-
}
|
309
|
-
};
|
310
|
-
|
311
|
-
Scanner.prototype.flush = function() {
|
312
|
-
var buffer;
|
313
|
-
buffer = this.buffer;
|
314
|
-
this.buffer = "";
|
315
|
-
return buffer;
|
316
|
-
};
|
317
|
-
|
318
|
-
Scanner.prototype.isDedentable = function(code) {
|
319
|
-
return code.match(Scanner.dedentablePattern);
|
320
|
-
};
|
321
|
-
|
322
|
-
return Scanner;
|
323
|
-
|
324
|
-
})();
|
325
|
-
|
326
|
-
}).call(this);
|
327
|
-
|
328
|
-
},
|
329
|
-
'./util': function(module, require, exports) {
|
330
|
-
// Generated by CoffeeScript 1.6.3
|
331
|
-
(function() {
|
332
|
-
var repeat, specialCharacters;
|
333
|
-
|
334
|
-
exports.repeat = repeat = function(string, count) {
|
335
|
-
return Array(count + 1).join(string);
|
336
|
-
};
|
337
|
-
|
338
|
-
exports.indent = function(string, width) {
|
339
|
-
var line, lines, space;
|
340
|
-
space = repeat(" ", width);
|
341
|
-
lines = (function() {
|
342
|
-
var _i, _len, _ref, _results;
|
343
|
-
_ref = string.split("\n");
|
344
|
-
_results = [];
|
345
|
-
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
346
|
-
line = _ref[_i];
|
347
|
-
_results.push(space + line);
|
348
|
-
}
|
349
|
-
return _results;
|
350
|
-
})();
|
351
|
-
return lines.join("\n");
|
352
|
-
};
|
353
|
-
|
354
|
-
exports.trim = function(string) {
|
355
|
-
return string.replace(/^\s+/, "").replace(/\s+$/, "");
|
356
|
-
};
|
357
|
-
|
358
|
-
specialCharacters = {
|
359
|
-
'\\': '\\\\',
|
360
|
-
'\b': '\\b',
|
361
|
-
'\f': '\\f',
|
362
|
-
'\n': '\\n',
|
363
|
-
'\r': '\\r',
|
364
|
-
'\t': '\\t'
|
365
|
-
};
|
366
|
-
|
367
|
-
exports.inspectString = function(string) {
|
368
|
-
var contents;
|
369
|
-
contents = string.replace(/[\x00-\x1f\\]/g, function(character) {
|
370
|
-
var code;
|
371
|
-
if (character in specialCharacters) {
|
372
|
-
return specialCharacters[character];
|
373
|
-
} else {
|
374
|
-
code = character.charCodeAt(0).toString(16);
|
375
|
-
if (code.length === 1) {
|
376
|
-
code = "0" + code;
|
377
|
-
}
|
378
|
-
return "\\u00" + code;
|
379
|
-
}
|
380
|
-
});
|
381
|
-
return "'" + contents.replace(/'/g, '\\\'') + "'";
|
382
|
-
};
|
383
|
-
|
384
|
-
}).call(this);
|
385
|
-
|
386
|
-
},
|
387
|
-
'strscan': function(module, require, exports) {
|
388
|
-
(function() {
|
389
|
-
var StringScanner;
|
390
|
-
((typeof exports !== "undefined" && exports !== null) ? exports : this).StringScanner = (function() {
|
391
|
-
StringScanner = function(source) {
|
392
|
-
this.source = source.toString();
|
393
|
-
this.reset();
|
394
|
-
return this;
|
395
|
-
};
|
396
|
-
StringScanner.prototype.scan = function(regexp) {
|
397
|
-
var matches;
|
398
|
-
return (matches = regexp.exec(this.getRemainder())) && matches.index === 0 ? this.setState(matches, {
|
399
|
-
head: this.head + matches[0].length,
|
400
|
-
last: this.head
|
401
|
-
}) : this.setState([]);
|
402
|
-
};
|
403
|
-
StringScanner.prototype.scanUntil = function(regexp) {
|
404
|
-
var matches;
|
405
|
-
if (matches = regexp.exec(this.getRemainder())) {
|
406
|
-
this.setState(matches, {
|
407
|
-
head: this.head + matches.index + matches[0].length,
|
408
|
-
last: this.head
|
409
|
-
});
|
410
|
-
return this.source.slice(this.last, this.head);
|
411
|
-
} else {
|
412
|
-
return this.setState([]);
|
413
|
-
}
|
414
|
-
};
|
415
|
-
StringScanner.prototype.scanChar = function() {
|
416
|
-
return this.scan(/[\s\S]/);
|
417
|
-
};
|
418
|
-
StringScanner.prototype.skip = function(regexp) {
|
419
|
-
if (this.scan(regexp)) {
|
420
|
-
return this.match.length;
|
421
|
-
}
|
422
|
-
};
|
423
|
-
StringScanner.prototype.skipUntil = function(regexp) {
|
424
|
-
if (this.scanUntil(regexp)) {
|
425
|
-
return this.head - this.last;
|
426
|
-
}
|
427
|
-
};
|
428
|
-
StringScanner.prototype.check = function(regexp) {
|
429
|
-
var matches;
|
430
|
-
return (matches = regexp.exec(this.getRemainder())) && matches.index === 0 ? this.setState(matches) : this.setState([]);
|
431
|
-
};
|
432
|
-
StringScanner.prototype.checkUntil = function(regexp) {
|
433
|
-
var matches;
|
434
|
-
if (matches = regexp.exec(this.getRemainder())) {
|
435
|
-
this.setState(matches);
|
436
|
-
return this.source.slice(this.head, this.head + matches.index + matches[0].length);
|
437
|
-
} else {
|
438
|
-
return this.setState([]);
|
439
|
-
}
|
440
|
-
};
|
441
|
-
StringScanner.prototype.peek = function(length) {
|
442
|
-
return this.source.substr(this.head, (typeof length !== "undefined" && length !== null) ? length : 1);
|
443
|
-
};
|
444
|
-
StringScanner.prototype.getSource = function() {
|
445
|
-
return this.source;
|
446
|
-
};
|
447
|
-
StringScanner.prototype.getRemainder = function() {
|
448
|
-
return this.source.slice(this.head);
|
449
|
-
};
|
450
|
-
StringScanner.prototype.getPosition = function() {
|
451
|
-
return this.head;
|
452
|
-
};
|
453
|
-
StringScanner.prototype.hasTerminated = function() {
|
454
|
-
return this.head === this.source.length;
|
455
|
-
};
|
456
|
-
StringScanner.prototype.getPreMatch = function() {
|
457
|
-
if (this.match) {
|
458
|
-
return this.source.slice(0, this.head - this.match.length);
|
459
|
-
}
|
460
|
-
};
|
461
|
-
StringScanner.prototype.getMatch = function() {
|
462
|
-
return this.match;
|
463
|
-
};
|
464
|
-
StringScanner.prototype.getPostMatch = function() {
|
465
|
-
if (this.match) {
|
466
|
-
return this.source.slice(this.head);
|
467
|
-
}
|
468
|
-
};
|
469
|
-
StringScanner.prototype.getCapture = function(index) {
|
470
|
-
return this.captures[index];
|
471
|
-
};
|
472
|
-
StringScanner.prototype.reset = function() {
|
473
|
-
return this.setState([], {
|
474
|
-
head: 0,
|
475
|
-
last: 0
|
476
|
-
});
|
477
|
-
};
|
478
|
-
StringScanner.prototype.terminate = function() {
|
479
|
-
return this.setState([], {
|
480
|
-
head: this.source.length,
|
481
|
-
last: this.head
|
482
|
-
});
|
483
|
-
};
|
484
|
-
StringScanner.prototype.concat = function(string) {
|
485
|
-
return this.source += string;
|
486
|
-
};
|
487
|
-
StringScanner.prototype.unscan = function() {
|
488
|
-
if (this.match) {
|
489
|
-
return this.setState([], {
|
490
|
-
head: this.last,
|
491
|
-
last: 0
|
492
|
-
});
|
493
|
-
} else {
|
494
|
-
throw "nothing to unscan";
|
495
|
-
}
|
496
|
-
};
|
497
|
-
StringScanner.prototype.setState = function(matches, values) {
|
498
|
-
var _a, _b;
|
499
|
-
this.head = (typeof (_a = ((typeof values === "undefined" || values === null) ? undefined : values.head)) !== "undefined" && _a !== null) ? _a : this.head;
|
500
|
-
this.last = (typeof (_b = ((typeof values === "undefined" || values === null) ? undefined : values.last)) !== "undefined" && _b !== null) ? _b : this.last;
|
501
|
-
this.captures = matches.slice(1);
|
502
|
-
return (this.match = matches[0]);
|
503
|
-
};
|
504
|
-
return StringScanner;
|
505
|
-
})();
|
506
|
-
})();
|
507
|
-
|
508
|
-
},
|
509
|
-
'coffee-script': function(module, require, exports) {
|
510
|
-
if (typeof CoffeeScript !== 'undefined' && CoffeeScript != null) {
|
511
|
-
module.exports = CoffeeScript;
|
512
|
-
} else {
|
513
|
-
throw 'Cannot require \'' + module.id + '\': CoffeeScript not found';
|
514
|
-
}
|
515
|
-
}
|
516
|
-
})('eco');
|