lanes 0.1.9 → 0.1.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/client/fonts/fontawesome-webfont.woff +0 -0
- data/client/fonts/fontawesome-webfont.woff2 +0 -0
- data/client/lanes/Boot.cjsx +9 -0
- data/client/lanes/access/Extension.coffee +18 -4
- data/client/lanes/access/LoginDialog.cjsx +78 -0
- data/client/lanes/access/Roles.coffee +22 -28
- data/client/lanes/access/User.coffee +16 -16
- data/client/lanes/access/index.js +4 -5
- data/client/lanes/access/screens/user-management/Editor.cjsx +20 -0
- data/client/lanes/access/screens/user-management/UserManagement.cjsx +41 -0
- data/client/lanes/access/screens/user-management/index.js +0 -1
- data/client/lanes/components/grid/EditingMixin.cjsx +64 -0
- data/client/lanes/components/grid/Grid.cjsx +139 -0
- data/client/lanes/components/grid/PopOverMixin.cjsx +28 -0
- data/client/lanes/components/grid/PopoverEditor.cjsx +8 -0
- data/client/lanes/components/grid/RowEditor.cjsx +10 -0
- data/client/lanes/components/grid/Toolbar.cjsx +14 -0
- data/client/lanes/components/grid/config.json +1 -1
- data/client/lanes/components/grid/editors.scss +94 -53
- data/client/lanes/components/grid/index.js +2 -7
- data/client/lanes/components/grid/styles.scss +8 -296
- data/client/lanes/components/helpers.coffee +2 -0
- data/client/lanes/components/index.js +2 -1
- data/client/lanes/components/modal/Modal.cjsx +36 -0
- data/client/lanes/components/modal/index.js +1 -2
- data/client/lanes/components/modal/styles.scss +0 -19
- data/client/lanes/components/record-finder/Clause.cjsx +80 -0
- data/client/lanes/components/record-finder/Dialog.cjsx +54 -0
- data/client/lanes/components/record-finder/RecordFinder.cjsx +38 -0
- data/client/lanes/components/record-finder/config.json +1 -1
- data/client/lanes/components/record-finder/index.js +1 -2
- data/client/lanes/components/request-spinner/index.js +1 -0
- data/client/lanes/components/select-field/SelectField.cjsx +78 -0
- data/client/lanes/components/select-field/index.js +2 -1
- data/client/lanes/components/select-field/styles.scss +1 -0
- data/client/lanes/components/shared/CountBadge.cjsx +9 -0
- data/client/lanes/components/shared/ErrorDisplay.cjsx +21 -0
- data/client/lanes/components/shared/FieldMixin.cjsx +71 -0
- data/client/lanes/components/shared/FieldSet.cjsx +58 -0
- data/client/lanes/components/shared/GenericField.cjsx +5 -0
- data/client/lanes/components/shared/Helpers.coffee +9 -0
- data/client/lanes/components/shared/RadioField.cjsx +14 -0
- data/client/lanes/components/shared/Resize.cjsx +152 -0
- data/client/lanes/components/shared/TextArea.cjsx +19 -0
- data/client/lanes/components/shared/TextField.cjsx +25 -0
- data/client/lanes/components/shared/Tooltip.cjsx +10 -0
- data/client/lanes/components/shared/fields.scss +35 -0
- data/client/lanes/components/shared/fieldset.scss +29 -0
- data/client/lanes/components/shared/index.js +3 -0
- data/client/lanes/components/shared/styles.scss +32 -0
- data/client/lanes/components/toolbar/RemoteChangeSets.cjsx +75 -0
- data/client/lanes/components/toolbar/SaveButton.cjsx +3 -0
- data/client/lanes/components/toolbar/Toolbar.cjsx +58 -0
- data/client/lanes/{workspace/styles → components/toolbar}/changes-notification.scss +10 -23
- data/client/lanes/components/toolbar/index.js +3 -0
- data/client/lanes/components/toolbar/styles.scss +51 -0
- data/client/lanes/extension/Extensions.coffee +19 -10
- data/client/lanes/extension/LateLoaded.js.erb +4 -3
- data/client/lanes/index.js +3 -5
- data/client/lanes/index.scss.erb +6 -14
- data/client/lanes/lib/HotReload.coffee +35 -0
- data/client/lanes/lib/MakeBaseClass.coffee +10 -11
- data/client/lanes/lib/development.coffee +3 -0
- data/client/lanes/lib/dom.coffee +49 -0
- data/client/lanes/lib/el.coffee +23 -0
- data/client/lanes/lib/index.js.erb +16 -0
- data/client/lanes/lib/loader.coffee +34 -34
- data/client/lanes/lib/namespace.coffee +1 -1
- data/client/lanes/lib/objToParam.coffee +37 -0
- data/client/lanes/{access/views/.gitkeep → lib/production.coffee} +0 -0
- data/client/lanes/lib/utilFunctions.coffee +44 -26
- data/client/lanes/models/AssociationMap.coffee +51 -38
- data/client/lanes/models/Base.coffee +89 -88
- data/client/lanes/models/ChangeMonitor.coffee +10 -10
- data/client/lanes/models/ChangeSet.coffee +14 -24
- data/client/lanes/models/Collection.coffee +40 -41
- data/client/lanes/models/PubSub.coffee +28 -19
- data/client/lanes/models/Query.coffee +78 -45
- data/client/lanes/models/QueryResults.coffee +93 -0
- data/client/lanes/models/ServerCache.coffee +12 -12
- data/client/lanes/models/Sync.coffee +53 -50
- data/client/lanes/models/User.coffee +31 -17
- data/client/lanes/react/Component.coffee +31 -0
- data/client/lanes/react/DefaultComponentNotFound.cjsx +9 -0
- data/client/lanes/{views → react}/FormBindings.coffee +0 -0
- data/client/lanes/{views → react}/ModelObserver.coffee +0 -0
- data/client/lanes/{views → react}/ModelUpdate.coffee +0 -0
- data/client/lanes/{views → react}/PubSub.coffee +0 -0
- data/client/lanes/react/Root.cjsx +14 -0
- data/client/lanes/react/Router.cjsx +18 -0
- data/client/lanes/react/Screen.coffee +15 -0
- data/client/lanes/{views → react}/TimedHighlight.coffee +0 -0
- data/client/lanes/{views → react}/TimedMask.coffee +0 -0
- data/client/lanes/react/TypeValidators.coffee +21 -0
- data/client/lanes/{lib/create-namespace.js → react/Utils.coffee} +0 -0
- data/client/lanes/react/Viewport.coffee +30 -0
- data/client/lanes/react/index.js +8 -0
- data/client/lanes/react/mixins/Access.coffee +27 -0
- data/client/lanes/react/mixins/Component.coffee +4 -0
- data/client/lanes/react/mixins/Data.coffee +136 -0
- data/client/lanes/react/mixins/MonitorSize.coffee +11 -0
- data/client/lanes/react/mixins/ReadEditingState.coffee +11 -0
- data/client/lanes/react/mixins/RelayEditingState.coffee +17 -0
- data/client/lanes/react/mixins/RelayFieldChange.coffee +11 -0
- data/client/lanes/react/mixins/Screen.coffee +7 -0
- data/client/lanes/react/mixins/Viewport.coffee +11 -0
- data/client/lanes/screens/ChangeListener.coffee +3 -3
- data/client/lanes/screens/Commands.coffee +27 -0
- data/client/lanes/screens/Definitions.coffee +74 -65
- data/client/lanes/screens/all.js.erb +1 -1
- data/client/lanes/screens/index.js +1 -2
- data/client/lanes/screens/mixins/index.js +0 -1
- data/client/lanes/screens/register.js.erb +0 -1
- data/client/lanes/screens/styles.scss +7 -0
- data/client/lanes/styles/bootstrap-custom-grid.scss +67 -37
- data/client/lanes/styles/bootstrap.scss +4 -5
- data/client/lanes/styles/fonts.scss +10 -23
- data/client/lanes/styles/fonts/_animated.scss +34 -0
- data/client/lanes/styles/fonts/_bordered-pulled.scss +16 -0
- data/client/lanes/styles/fonts/_core.scss +13 -0
- data/client/lanes/styles/fonts/_fixed-width.scss +6 -0
- data/client/lanes/styles/fonts/_icons.scss +596 -0
- data/client/lanes/styles/fonts/_larger.scss +13 -0
- data/client/lanes/styles/fonts/_list.scss +19 -0
- data/client/lanes/styles/fonts/_mixins.scss +27 -0
- data/client/lanes/styles/fonts/_path.scss +10 -0
- data/client/lanes/styles/fonts/_rotated-flipped.scss +20 -0
- data/client/lanes/styles/fonts/_stacked.scss +20 -0
- data/client/lanes/styles/fonts/_variables.scss +606 -0
- data/client/lanes/styles/fonts/font-awesome.scss +16 -0
- data/client/lanes/styles/fonts/index.scss +2 -0
- data/client/lanes/styles/global.scss +2 -0
- data/client/lanes/styles/global/fancy-header.scss +14 -0
- data/client/lanes/testing/BeforeEach.coffee +15 -40
- data/client/lanes/testing/Helpers.coffee +27 -0
- data/client/lanes/testing/ModelSaver.coffee +14 -24
- data/client/lanes/testing/StubRouter.coffee +27 -0
- data/client/lanes/testing/TestObjects.coffee +27 -0
- data/client/lanes/testing/index.js +3 -1
- data/client/lanes/vendor/base.js +85256 -0
- data/client/lanes/vendor/commons.js +20579 -0
- data/client/lanes/vendor/development.js +2511 -0
- data/client/lanes/vendor/grid.js +6689 -0
- data/client/lanes/vendor/grid.scss +387 -0
- data/client/lanes/vendor/index.js +3 -0
- data/client/lanes/vendor/message-bus.coffee +264 -0
- data/client/lanes/vendor/widgets.js +8798 -0
- data/client/lanes/vendor/widgets.scss +723 -0
- data/client/lanes/workspace/ActiveScreenSwitcher.cjsx +38 -0
- data/client/lanes/workspace/Extension.coffee +6 -0
- data/client/lanes/workspace/Layout.cjsx +28 -0
- data/client/lanes/workspace/Navbar.cjsx +25 -0
- data/client/lanes/workspace/ScreenView.cjsx +27 -0
- data/client/lanes/workspace/ScreensMenu.cjsx +57 -0
- data/client/lanes/workspace/UIState.coffee +17 -16
- data/client/lanes/workspace/index.js +7 -2
- data/client/lanes/workspace/styles.scss +0 -3
- data/client/lanes/workspace/styles/forms.scss +2 -73
- data/client/lanes/workspace/styles/header.scss +0 -2
- data/client/lanes/workspace/styles/layout.scss +9 -2
- data/client/lanes/workspace/styles/screens.scss +0 -59
- data/client/lanes/workspace/styles/tabs.scss +16 -15
- data/coffeelint.json +49 -0
- data/config.ru +1 -0
- data/config/database.yml +2 -2
- data/config/routes.rb +7 -0
- data/docs/command.md +11 -8
- data/docs/model.md +2 -5
- data/docs/react.md +137 -0
- data/lanes.gemspec +1 -0
- data/lib/lanes.rb +1 -1
- data/lib/lanes/access/authentication_provider.rb +1 -0
- data/lib/lanes/access/config/routes.rb +2 -0
- data/lib/lanes/access/config/screens.rb +15 -12
- data/lib/lanes/access/extension.rb +2 -1
- data/lib/lanes/access/role.rb +8 -4
- data/lib/lanes/api.rb +4 -3
- data/lib/lanes/api/coffeescript_processor.rb +47 -6
- data/lib/lanes/api/controller.rb +4 -3
- data/lib/lanes/api/default_routes.rb +16 -0
- data/lib/lanes/api/javascript_processor.rb +14 -68
- data/lib/lanes/api/pub_sub.rb +17 -3
- data/lib/lanes/api/request_wrapper.rb +2 -2
- data/lib/lanes/api/root.rb +16 -13
- data/lib/lanes/api/routing.rb +0 -18
- data/lib/lanes/api/sprockets_extension.rb +10 -4
- data/lib/lanes/api/test_specs.rb +3 -3
- data/lib/lanes/cli.rb +6 -1
- data/lib/lanes/command/app.rb +7 -11
- data/lib/lanes/command/generate.rb +3 -3
- data/lib/lanes/command/generate_component.rb +28 -0
- data/lib/lanes/command/generate_component.usage +11 -0
- data/lib/lanes/command/generate_screen.rb +24 -7
- data/lib/lanes/command/generate_screen.usage +5 -8
- data/lib/lanes/configuration.rb +3 -2
- data/lib/lanes/extension.rb +12 -18
- data/lib/lanes/extension/definition.rb +20 -8
- data/lib/lanes/guard_tasks.rb +22 -5
- data/lib/lanes/hot_reload_plugin.rb +47 -0
- data/lib/lanes/logger.rb +41 -5
- data/lib/lanes/screen.rb +40 -16
- data/lib/lanes/spec_helper.rb +6 -3
- data/lib/lanes/version.rb +1 -1
- data/lib/lanes/workspace/extension.rb +1 -0
- data/npm-build/{template.js → base.js} +17 -17
- data/{client/lanes/workspace/tab.html → npm-build/common.js} +0 -0
- data/npm-build/compile.coffee +13 -4
- data/npm-build/development.js +7 -0
- data/npm-build/grid.js +11 -0
- data/npm-build/package.json +62 -58
- data/npm-build/react-widgets.js +5 -0
- data/npm-build/react-widgets.less +35 -0
- data/npm-build/webpack.config.js +39 -0
- data/spec/command-reference-files/component/client/appy-app/components/Big.cjsx +4 -0
- data/spec/command-reference-files/component/spec/appy-app/components/BigSpec.coffee +5 -0
- data/spec/command-reference-files/initial/.rubocop.yml +7 -0
- data/spec/command-reference-files/initial/Gemfile +1 -1
- data/spec/command-reference-files/initial/client/appy-app/Extension.coffee +17 -5
- data/spec/command-reference-files/initial/client/appy-app/components/Base.coffee +9 -0
- data/spec/command-reference-files/initial/client/appy-app/index.js +1 -3
- data/spec/command-reference-files/initial/client/appy-app/screens/Base.coffee +8 -2
- data/spec/command-reference-files/initial/coffeelint.json +49 -0
- data/spec/command-reference-files/initial/config.ru +2 -0
- data/spec/command-reference-files/initial/config/screens.rb +10 -0
- data/spec/command-reference-files/initial/lib/appy-app/extension.rb +7 -0
- data/spec/command-reference-files/model/client/appy-app/models/TestTest.coffee +0 -1
- data/spec/command-reference-files/screen/client/appy-app/Extension.coffee +34 -0
- data/spec/command-reference-files/screen/client/appy-app/screens/ready-set-go/ReadySetGo.cjsx +7 -0
- data/spec/command-reference-files/screen/config/screens.rb +19 -9
- data/spec/command-reference-files/screen/spec/appy-app/screens/ready-set-go/ReadySetGoSpec.coffee +3 -3
- data/spec/lanes/components/grid/GridSpec.coffee +26 -26
- data/spec/lanes/models/AssociationMapSpec.coffee +6 -6
- data/spec/lanes/models/BaseSpec.coffee +24 -35
- data/spec/lanes/models/CollectionSpec.coffee +19 -18
- data/spec/lanes/models/EnumMapSpec.coffee +1 -1
- data/spec/lanes/models/PubSubSpec.coffee +17 -15
- data/spec/lanes/models/SyncSpec.coffee +28 -0
- data/spec/lanes/models/UserSpec.coffee +17 -0
- data/spec/lanes/react/mixins/DataSpec.coffee +72 -0
- data/spec/lanes/screens/DefinitionsSpec.coffee +33 -0
- data/spec/lanes/views/BaseSpec.coffee +133 -133
- data/spec/lanes/views/FormBindingsSpec.coffee +30 -30
- data/spec/server/api/coffeescript_processor_spec.rb +2 -2
- data/spec/server/command_spec.rb +3 -3
- data/templates/client/Extension.coffee +17 -5
- data/templates/client/components/BaseComponent.coffee +9 -0
- data/templates/client/components/Component.cjsx +4 -0
- data/templates/client/{views → components}/template.html +0 -0
- data/templates/client/index.js +1 -3
- data/templates/client/models/Model.coffee +0 -1
- data/templates/client/screens/BaseScreen.coffee +9 -0
- data/templates/client/screens/Screen.cjsx +7 -0
- data/templates/config.ru +2 -0
- data/templates/config/screen.rb +10 -10
- data/templates/config/screens.rb +10 -0
- data/templates/lib/namespace/extension.rb +7 -0
- data/templates/spec/client/Screen.coffee +4 -4
- data/templates/spec/client/components/ComponentSpec.coffee +5 -0
- metadata +157 -201
- data/client/fonts/lanes/icomoon.eot +0 -0
- data/client/fonts/lanes/icomoon.svg +0 -160
- data/client/fonts/lanes/icomoon.ttf +0 -0
- data/client/fonts/lanes/icomoon.woff +0 -0
- data/client/fonts/lanes/selection.json +0 -3565
- data/client/lanes/Boot.coffee +0 -50
- data/client/lanes/access/LoginDialog.coffee +0 -46
- data/client/lanes/access/login-dialog.html +0 -16
- data/client/lanes/access/screens/user-management/GridUserEditor.coffee +0 -26
- data/client/lanes/access/screens/user-management/UserManagement.coffee +0 -23
- data/client/lanes/access/screens/user-management/grid-popover-editor.html +0 -33
- data/client/lanes/access/screens/user-management/screen.html +0 -7
- data/client/lanes/components/Base.coffee +0 -39
- data/client/lanes/components/ChoicesInput.coffee +0 -47
- data/client/lanes/components/grid/Editor.coffee +0 -62
- data/client/lanes/components/grid/Grid.coffee +0 -205
- data/client/lanes/components/grid/PopOverEditor.coffee +0 -29
- data/client/lanes/components/grid/RowEditor.coffee +0 -30
- data/client/lanes/components/grid/popover-editor.html +0 -18
- data/client/lanes/components/grid/row-editor.html +0 -16
- data/client/lanes/components/grid/template.html +0 -4
- data/client/lanes/components/grid/vendor/dataTables.scroller.js +0 -1262
- data/client/lanes/components/grid/vendor/index.js +0 -2
- data/client/lanes/components/grid/vendor/jquery.dataTables.js +0 -14839
- data/client/lanes/components/modal/ModalDialog.coffee +0 -68
- data/client/lanes/components/modal/template.html +0 -18
- data/client/lanes/components/multi-select/MultiSelect.coffee +0 -65
- data/client/lanes/components/popover/PopOver.coffee +0 -55
- data/client/lanes/components/popover/index.js +0 -2
- data/client/lanes/components/popover/styles.scss +0 -2
- data/client/lanes/components/popover/template.html +0 -5
- data/client/lanes/components/radio-group/RadioGroup.coffee +0 -47
- data/client/lanes/components/radio-group/index.js +0 -1
- data/client/lanes/components/radio-group/styles.scss +0 -1
- data/client/lanes/components/record-finder/Clause.coffee +0 -37
- data/client/lanes/components/record-finder/Dialog.coffee +0 -45
- data/client/lanes/components/record-finder/RecordFinder.coffee +0 -61
- data/client/lanes/components/record-finder/clause.html +0 -37
- data/client/lanes/components/record-finder/dialog.html +0 -4
- data/client/lanes/components/record-finder/field.html +0 -8
- data/client/lanes/components/select-field/SelectField.coffee +0 -63
- data/client/lanes/components/select2/Select2.coffee +0 -8
- data/client/lanes/components/select2/index.js +0 -2
- data/client/lanes/lib/Templates.coffee +0 -51
- data/client/lanes/lib/debounce.coffee +0 -15
- data/client/lanes/lib/defer.coffee +0 -7
- data/client/lanes/lib/el.js +0 -115
- data/client/lanes/lib/index.js +0 -5
- data/client/lanes/plugins/overlay.coffee +0 -41
- data/client/lanes/screens/Base.coffee +0 -35
- data/client/lanes/screens/Router.coffee +0 -4
- data/client/lanes/screens/mixins/Editing.coffee +0 -38
- data/client/lanes/styles/bootstrap/old/_alerts.scss +0 -68
- data/client/lanes/styles/bootstrap/old/_badges.scss +0 -57
- data/client/lanes/styles/bootstrap/old/_breadcrumbs.scss +0 -26
- data/client/lanes/styles/bootstrap/old/_button-groups.scss +0 -240
- data/client/lanes/styles/bootstrap/old/_buttons.scss +0 -157
- data/client/lanes/styles/bootstrap/old/_carousel.scss +0 -243
- data/client/lanes/styles/bootstrap/old/_close.scss +0 -35
- data/client/lanes/styles/bootstrap/old/_code.scss +0 -68
- data/client/lanes/styles/bootstrap/old/_component-animations.scss +0 -35
- data/client/lanes/styles/bootstrap/old/_dropdowns.scss +0 -215
- data/client/lanes/styles/bootstrap/old/_forms.scss +0 -538
- data/client/lanes/styles/bootstrap/old/_glyphicons.scss +0 -237
- data/client/lanes/styles/bootstrap/old/_grid.scss +0 -84
- data/client/lanes/styles/bootstrap/old/_input-groups.scss +0 -166
- data/client/lanes/styles/bootstrap/old/_jumbotron.scss +0 -48
- data/client/lanes/styles/bootstrap/old/_labels.scss +0 -66
- data/client/lanes/styles/bootstrap/old/_list-group.scss +0 -132
- data/client/lanes/styles/bootstrap/old/_media.scss +0 -56
- data/client/lanes/styles/bootstrap/old/_mixins.scss +0 -39
- data/client/lanes/styles/bootstrap/old/_modals.scss +0 -150
- data/client/lanes/styles/bootstrap/old/_navbar.scss +0 -659
- data/client/lanes/styles/bootstrap/old/_navs.scss +0 -242
- data/client/lanes/styles/bootstrap/old/_normalize.scss +0 -425
- data/client/lanes/styles/bootstrap/old/_pager.scss +0 -55
- data/client/lanes/styles/bootstrap/old/_pagination.scss +0 -88
- data/client/lanes/styles/bootstrap/old/_panels.scss +0 -243
- data/client/lanes/styles/bootstrap/old/_popovers.scss +0 -133
- data/client/lanes/styles/bootstrap/old/_print.scss +0 -101
- data/client/lanes/styles/bootstrap/old/_progress-bars.scss +0 -105
- data/client/lanes/styles/bootstrap/old/_responsive-embed.scss +0 -34
- data/client/lanes/styles/bootstrap/old/_responsive-utilities.scss +0 -174
- data/client/lanes/styles/bootstrap/old/_scaffolding.scss +0 -150
- data/client/lanes/styles/bootstrap/old/_tables.scss +0 -233
- data/client/lanes/styles/bootstrap/old/_theme.scss +0 -258
- data/client/lanes/styles/bootstrap/old/_thumbnails.scss +0 -38
- data/client/lanes/styles/bootstrap/old/_tooltip.scss +0 -95
- data/client/lanes/styles/bootstrap/old/_type.scss +0 -304
- data/client/lanes/styles/bootstrap/old/_utilities.scss +0 -57
- data/client/lanes/styles/bootstrap/old/_variables.scss +0 -850
- data/client/lanes/styles/bootstrap/old/_wells.scss +0 -29
- data/client/lanes/styles/bootstrap/old/bootstrap.scss +0 -50
- data/client/lanes/styles/bootstrap/old/mixins/_alerts.scss +0 -14
- data/client/lanes/styles/bootstrap/old/mixins/_background-variant.scss +0 -11
- data/client/lanes/styles/bootstrap/old/mixins/_border-radius.scss +0 -18
- data/client/lanes/styles/bootstrap/old/mixins/_buttons.scss +0 -50
- data/client/lanes/styles/bootstrap/old/mixins/_center-block.scss +0 -7
- data/client/lanes/styles/bootstrap/old/mixins/_clearfix.scss +0 -22
- data/client/lanes/styles/bootstrap/old/mixins/_forms.scss +0 -84
- data/client/lanes/styles/bootstrap/old/mixins/_gradients.scss +0 -58
- data/client/lanes/styles/bootstrap/old/mixins/_grid-framework.scss +0 -81
- data/client/lanes/styles/bootstrap/old/mixins/_grid.scss +0 -122
- data/client/lanes/styles/bootstrap/old/mixins/_hide-text.scss +0 -21
- data/client/lanes/styles/bootstrap/old/mixins/_image.scss +0 -34
- data/client/lanes/styles/bootstrap/old/mixins/_labels.scss +0 -12
- data/client/lanes/styles/bootstrap/old/mixins/_list-group.scss +0 -31
- data/client/lanes/styles/bootstrap/old/mixins/_nav-divider.scss +0 -10
- data/client/lanes/styles/bootstrap/old/mixins/_nav-vertical-align.scss +0 -9
- data/client/lanes/styles/bootstrap/old/mixins/_opacity.scss +0 -8
- data/client/lanes/styles/bootstrap/old/mixins/_pagination.scss +0 -23
- data/client/lanes/styles/bootstrap/old/mixins/_panels.scss +0 -24
- data/client/lanes/styles/bootstrap/old/mixins/_progress-bar.scss +0 -10
- data/client/lanes/styles/bootstrap/old/mixins/_reset-filter.scss +0 -8
- data/client/lanes/styles/bootstrap/old/mixins/_resize.scss +0 -6
- data/client/lanes/styles/bootstrap/old/mixins/_responsive-visibility.scss +0 -21
- data/client/lanes/styles/bootstrap/old/mixins/_size.scss +0 -10
- data/client/lanes/styles/bootstrap/old/mixins/_tab-focus.scss +0 -9
- data/client/lanes/styles/bootstrap/old/mixins/_table-row.scss +0 -28
- data/client/lanes/styles/bootstrap/old/mixins/_text-emphasis.scss +0 -11
- data/client/lanes/styles/bootstrap/old/mixins/_text-overflow.scss +0 -8
- data/client/lanes/styles/bootstrap/old/mixins/_vendor-prefixes.scss +0 -219
- data/client/lanes/styles/font-definitions.scss +0 -451
- data/client/lanes/testing/TestModels.coffee +0 -23
- data/client/lanes/vendor/bootstrap/affix.js +0 -162
- data/client/lanes/vendor/bootstrap/alert.js +0 -94
- data/client/lanes/vendor/bootstrap/button.js +0 -116
- data/client/lanes/vendor/bootstrap/carousel.js +0 -240
- data/client/lanes/vendor/bootstrap/collapse.js +0 -211
- data/client/lanes/vendor/bootstrap/dropdown.js +0 -161
- data/client/lanes/vendor/bootstrap/modal.js +0 -324
- data/client/lanes/vendor/bootstrap/popover.js +0 -119
- data/client/lanes/vendor/bootstrap/scrollspy.js +0 -175
- data/client/lanes/vendor/bootstrap/tab.js +0 -153
- data/client/lanes/vendor/bootstrap/tooltip.js +0 -478
- data/client/lanes/vendor/bootstrap/transition.js +0 -59
- data/client/lanes/vendor/message-bus.js +0 -285
- data/client/lanes/vendor/modern-stack.js +0 -27
- data/client/lanes/vendor/packaged.js +0 -19533
- data/client/lanes/views/Assets.coffee +0 -9
- data/client/lanes/views/Base.coffee +0 -426
- data/client/lanes/views/Functions.coffee +0 -13
- data/client/lanes/views/Helpers.coffee +0 -76
- data/client/lanes/views/Keys.coffee +0 -59
- data/client/lanes/views/RenderContext.coffee +0 -32
- data/client/lanes/views/SaveNotify.coffee +0 -32
- data/client/lanes/views/Viewport.coffee +0 -18
- data/client/lanes/views/_button.html +0 -3
- data/client/lanes/views/_toolbar.html +0 -23
- data/client/lanes/views/empty-span.html +0 -1
- data/client/lanes/views/index.js +0 -2
- data/client/lanes/views/model-update.html +0 -15
- data/client/lanes/workspace/ActiveScreensSwitcher.coffee +0 -112
- data/client/lanes/workspace/Layout.coffee +0 -29
- data/client/lanes/workspace/Navbar.coffee +0 -31
- data/client/lanes/workspace/Pages.coffee +0 -39
- data/client/lanes/workspace/ScreensMenu.coffee +0 -126
- data/client/lanes/workspace/WorkspaceView.coffee +0 -8
- data/client/lanes/workspace/layout.html +0 -4
- data/client/lanes/workspace/menu.html +0 -356
- data/client/lanes/workspace/menu_toggle.html +0 -9
- data/client/lanes/workspace/navbar.html +0 -17
- data/client/lanes/workspace/pages.html +0 -6
- data/client/lanes/workspace/screens-menu.html +0 -11
- data/client/lanes/workspace/screens-switcher.html +0 -7
- data/docs/view.md +0 -292
- data/lib/lanes/command/generate_view.rb +0 -38
- data/lib/lanes/command/generate_view.usage +0 -13
- data/spec/command-reference-files/initial/client/appy-app/Router.coffee +0 -4
- data/spec/command-reference-files/initial/client/appy-app/controllers/.gitkeep +0 -0
- data/spec/command-reference-files/initial/client/appy-app/views/.gitkeep +0 -0
- data/spec/command-reference-files/initial/client/appy-app/views/Base.coffee +0 -5
- data/spec/command-reference-files/initial/spec/appy-app/screens/Base.coffee +0 -5
- data/spec/command-reference-files/screen/client/appy-app/screens/ready-set-go/ReadySetGo.coffee +0 -6
- data/spec/command-reference-files/screen/client/appy-app/screens/ready-set-go/layout.html +0 -3
- data/spec/command-reference-files/view/client/appy-app/views/BigView.coffee +0 -10
- data/spec/command-reference-files/view/spec/appy-app/views/BigViewSpec.coffee +0 -5
- data/templates/client/Router.coffee +0 -4
- data/templates/client/components/Component.coffee +0 -1
- data/templates/client/screens/Base.coffee +0 -3
- data/templates/client/screens/Screen.coffee +0 -11
- data/templates/client/screens/layout.html +0 -3
- data/templates/client/views/.gitkeep +0 -0
- data/templates/client/views/BaseView.coffee +0 -5
- data/templates/client/views/View.coffee +0 -10
- data/templates/spec/client/views/ViewSpec.coffee +0 -5
@@ -1,29 +0,0 @@
|
|
1
|
-
class Lanes.Components.Grid.PopOverEditor extends Lanes.Components.Grid.Editor
|
2
|
-
|
3
|
-
template: 'grid/popover-editor'
|
4
|
-
templateModels: ->
|
5
|
-
{ columns: this.grid.columnDefinitions }
|
6
|
-
|
7
|
-
session:
|
8
|
-
view: 'object'
|
9
|
-
title: 'string'
|
10
|
-
|
11
|
-
move: (row,ev)->
|
12
|
-
super
|
13
|
-
if @popover
|
14
|
-
@popover.destroy()
|
15
|
-
@popover = new Lanes.Components.PopOver({
|
16
|
-
parent: this
|
17
|
-
className: 'grid-popover-editor'
|
18
|
-
target: Lanes.$(ev.target)
|
19
|
-
title: this.title || this.calculatedTitle()
|
20
|
-
content: this.el
|
21
|
-
autoShow: true
|
22
|
-
})
|
23
|
-
|
24
|
-
calculatedTitle: ->
|
25
|
-
(if this.model.isNew() then "Create: " else "Edit: ") + this.model.constructor.name
|
26
|
-
|
27
|
-
cancelEditing: ->
|
28
|
-
@popover.destroy()
|
29
|
-
super
|
@@ -1,30 +0,0 @@
|
|
1
|
-
class Lanes.Components.Grid.RowEditor extends Lanes.Components.Grid.Editor
|
2
|
-
|
3
|
-
template: 'grid/row-editor'
|
4
|
-
|
5
|
-
move: (row)->
|
6
|
-
super
|
7
|
-
pos = this.row.position()
|
8
|
-
this.$el.css({
|
9
|
-
left: pos.left, top: pos.top, width: this.row.width()
|
10
|
-
})
|
11
|
-
this.$('form').css({
|
12
|
-
height: this.row.height()
|
13
|
-
})
|
14
|
-
inputs = this.form.children()
|
15
|
-
for input, index in inputs
|
16
|
-
column = Lanes.$(this.row[0].cells[index])
|
17
|
-
definition = this.grid.columnDefinitions[index]
|
18
|
-
Lanes.$(input)
|
19
|
-
.width(column.width())
|
20
|
-
.css("left", column.position().left)
|
21
|
-
.val(this.model.get(definition.field))
|
22
|
-
this.form.find('.edit').first().focus()
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
render: ->
|
27
|
-
super
|
28
|
-
for cell in this.row[0].cells
|
29
|
-
this.form.append('<input class="edit">')
|
30
|
-
this
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<form class="form-horizontal" role="form">
|
2
|
-
<% for field in @columns: %>
|
3
|
-
<div class="form-group">
|
4
|
-
<label for="field-<%= field.field %>" class="col-sm-2 control-label"><%= field.title %></label>
|
5
|
-
<div class="col-sm-10">
|
6
|
-
<input type="text" name="<%= field.field %>" class="form-control" id="field-<%= field.field %>" placeholder="">
|
7
|
-
</div>
|
8
|
-
</div>
|
9
|
-
<% end %>
|
10
|
-
<div class= buttons"">
|
11
|
-
<button type="button" class="btn btn-default cancel">
|
12
|
-
<i class="icon-cancel-circle"> Cancel</i>
|
13
|
-
</button>
|
14
|
-
<button type="button" class="btn btn-primary save">
|
15
|
-
<i class="icon-save"> Save</i>
|
16
|
-
</button>
|
17
|
-
</div>
|
18
|
-
</form>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<div class="grid-row-editor">
|
2
|
-
<form>
|
3
|
-
</form>
|
4
|
-
<div class="controls">
|
5
|
-
|
6
|
-
<div class="buttons">
|
7
|
-
<button type="button" class="btn cancel">
|
8
|
-
<i class="icon-cancel-circle">Cancel</i>
|
9
|
-
</button>
|
10
|
-
<button type="button" class="btn save">
|
11
|
-
<i class="icon-save">Save</i>
|
12
|
-
</button>
|
13
|
-
</div>
|
14
|
-
|
15
|
-
</div>
|
16
|
-
</div>
|
@@ -1,1262 +0,0 @@
|
|
1
|
-
/*! Scroller 1.2.2
|
2
|
-
* ©2011-2014 SpryMedia Ltd - datatables.net/license
|
3
|
-
*/
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @summary Scroller
|
7
|
-
* @description Virtual rendering for DataTables
|
8
|
-
* @version 1.2.2
|
9
|
-
* @file dataTables.scroller.js
|
10
|
-
* @author SpryMedia Ltd (www.sprymedia.co.uk)
|
11
|
-
* @contact www.sprymedia.co.uk/contact
|
12
|
-
* @copyright Copyright 2011-2014 SpryMedia Ltd.
|
13
|
-
*
|
14
|
-
* This source file is free software, available under the following license:
|
15
|
-
* MIT license - http://datatables.net/license/mit
|
16
|
-
*
|
17
|
-
* This source file is distributed in the hope that it will be useful, but
|
18
|
-
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
19
|
-
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
|
20
|
-
*
|
21
|
-
* For details please refer to: http://www.datatables.net
|
22
|
-
*/
|
23
|
-
|
24
|
-
(function(window, document, undefined){
|
25
|
-
|
26
|
-
|
27
|
-
var factory = function( $, DataTable ) {
|
28
|
-
"use strict";
|
29
|
-
|
30
|
-
/**
|
31
|
-
* Scroller is a virtual rendering plug-in for DataTables which allows large
|
32
|
-
* datasets to be drawn on screen every quickly. What the virtual rendering means
|
33
|
-
* is that only the visible portion of the table (and a bit to either side to make
|
34
|
-
* the scrolling smooth) is drawn, while the scrolling container gives the
|
35
|
-
* visual impression that the whole table is visible. This is done by making use
|
36
|
-
* of the pagination abilities of DataTables and moving the table around in the
|
37
|
-
* scrolling container DataTables adds to the page. The scrolling container is
|
38
|
-
* forced to the height it would be for the full table display using an extra
|
39
|
-
* element.
|
40
|
-
*
|
41
|
-
* Note that rows in the table MUST all be the same height. Information in a cell
|
42
|
-
* which expands on to multiple lines will cause some odd behaviour in the scrolling.
|
43
|
-
*
|
44
|
-
* Scroller is initialised by simply including the letter 'S' in the sDom for the
|
45
|
-
* table you want to have this feature enabled on. Note that the 'S' must come
|
46
|
-
* AFTER the 't' parameter in `dom`.
|
47
|
-
*
|
48
|
-
* Key features include:
|
49
|
-
* <ul class="limit_length">
|
50
|
-
* <li>Speed! The aim of Scroller for DataTables is to make rendering large data sets fast</li>
|
51
|
-
* <li>Full compatibility with deferred rendering in DataTables 1.9 for maximum speed</li>
|
52
|
-
* <li>Display millions of rows</li>
|
53
|
-
* <li>Integration with state saving in DataTables (scrolling position is saved)</li>
|
54
|
-
* <li>Easy to use</li>
|
55
|
-
* </ul>
|
56
|
-
*
|
57
|
-
* @class
|
58
|
-
* @constructor
|
59
|
-
* @global
|
60
|
-
* @param {object} oDT DataTables settings object
|
61
|
-
* @param {object} [oOpts={}] Configuration object for FixedColumns. Options
|
62
|
-
* are defined by {@link Scroller.defaults}
|
63
|
-
*
|
64
|
-
* @requires jQuery 1.7+
|
65
|
-
* @requires DataTables 1.9.0+
|
66
|
-
*
|
67
|
-
* @example
|
68
|
-
* $(document).ready(function() {
|
69
|
-
* $('#example').dataTable( {
|
70
|
-
* "sScrollY": "200px",
|
71
|
-
* "sAjaxSource": "media/dataset/large.txt",
|
72
|
-
* "sDom": "frtiS",
|
73
|
-
* "bDeferRender": true
|
74
|
-
* } );
|
75
|
-
* } );
|
76
|
-
*/
|
77
|
-
var Scroller = function ( oDTSettings, oOpts ) {
|
78
|
-
/* Sanity check - you just know it will happen */
|
79
|
-
if ( ! this instanceof Scroller )
|
80
|
-
{
|
81
|
-
alert( "Scroller warning: Scroller must be initialised with the 'new' keyword." );
|
82
|
-
return;
|
83
|
-
}
|
84
|
-
|
85
|
-
if ( typeof oOpts == 'undefined' )
|
86
|
-
{
|
87
|
-
oOpts = {};
|
88
|
-
}
|
89
|
-
|
90
|
-
/**
|
91
|
-
* Settings object which contains customisable information for the Scroller instance
|
92
|
-
* @namespace
|
93
|
-
* @private
|
94
|
-
* @extends Scroller.defaults
|
95
|
-
*/
|
96
|
-
this.s = {
|
97
|
-
/**
|
98
|
-
* DataTables settings object
|
99
|
-
* @type object
|
100
|
-
* @default Passed in as first parameter to constructor
|
101
|
-
*/
|
102
|
-
"dt": oDTSettings,
|
103
|
-
|
104
|
-
/**
|
105
|
-
* Pixel location of the top of the drawn table in the viewport
|
106
|
-
* @type int
|
107
|
-
* @default 0
|
108
|
-
*/
|
109
|
-
"tableTop": 0,
|
110
|
-
|
111
|
-
/**
|
112
|
-
* Pixel location of the bottom of the drawn table in the viewport
|
113
|
-
* @type int
|
114
|
-
* @default 0
|
115
|
-
*/
|
116
|
-
"tableBottom": 0,
|
117
|
-
|
118
|
-
/**
|
119
|
-
* Pixel location of the boundary for when the next data set should be loaded and drawn
|
120
|
-
* when scrolling up the way.
|
121
|
-
* @type int
|
122
|
-
* @default 0
|
123
|
-
* @private
|
124
|
-
*/
|
125
|
-
"redrawTop": 0,
|
126
|
-
|
127
|
-
/**
|
128
|
-
* Pixel location of the boundary for when the next data set should be loaded and drawn
|
129
|
-
* when scrolling down the way. Note that this is actually calculated as the offset from
|
130
|
-
* the top.
|
131
|
-
* @type int
|
132
|
-
* @default 0
|
133
|
-
* @private
|
134
|
-
*/
|
135
|
-
"redrawBottom": 0,
|
136
|
-
|
137
|
-
/**
|
138
|
-
* Auto row height or not indicator
|
139
|
-
* @type bool
|
140
|
-
* @default 0
|
141
|
-
*/
|
142
|
-
"autoHeight": true,
|
143
|
-
|
144
|
-
/**
|
145
|
-
* Number of rows calculated as visible in the visible viewport
|
146
|
-
* @type int
|
147
|
-
* @default 0
|
148
|
-
*/
|
149
|
-
"viewportRows": 0,
|
150
|
-
|
151
|
-
/**
|
152
|
-
* setTimeout reference for state saving, used when state saving is enabled in the DataTable
|
153
|
-
* and when the user scrolls the viewport in order to stop the cookie set taking too much
|
154
|
-
* CPU!
|
155
|
-
* @type int
|
156
|
-
* @default 0
|
157
|
-
*/
|
158
|
-
"stateTO": null,
|
159
|
-
|
160
|
-
/**
|
161
|
-
* setTimeout reference for the redraw, used when server-side processing is enabled in the
|
162
|
-
* DataTables in order to prevent DoSing the server
|
163
|
-
* @type int
|
164
|
-
* @default null
|
165
|
-
*/
|
166
|
-
"drawTO": null,
|
167
|
-
|
168
|
-
heights: {
|
169
|
-
jump: null,
|
170
|
-
page: null,
|
171
|
-
virtual: null,
|
172
|
-
scroll: null,
|
173
|
-
|
174
|
-
/**
|
175
|
-
* Height of rows in the table
|
176
|
-
* @type int
|
177
|
-
* @default 0
|
178
|
-
*/
|
179
|
-
row: null,
|
180
|
-
|
181
|
-
/**
|
182
|
-
* Pixel height of the viewport
|
183
|
-
* @type int
|
184
|
-
* @default 0
|
185
|
-
*/
|
186
|
-
viewport: null
|
187
|
-
},
|
188
|
-
|
189
|
-
topRowFloat: 0,
|
190
|
-
scrollDrawDiff: null,
|
191
|
-
loaderVisible: false
|
192
|
-
};
|
193
|
-
|
194
|
-
// @todo The defaults should extend a `c` property and the internal settings
|
195
|
-
// only held in the `s` property. At the moment they are mixed
|
196
|
-
this.s = $.extend( this.s, Scroller.oDefaults, oOpts );
|
197
|
-
|
198
|
-
// Workaround for row height being read from height object (see above comment)
|
199
|
-
this.s.heights.row = this.s.rowHeight;
|
200
|
-
|
201
|
-
/**
|
202
|
-
* DOM elements used by the class instance
|
203
|
-
* @private
|
204
|
-
* @namespace
|
205
|
-
*
|
206
|
-
*/
|
207
|
-
this.dom = {
|
208
|
-
"force": document.createElement('div'),
|
209
|
-
"scroller": null,
|
210
|
-
"table": null,
|
211
|
-
"loader": null
|
212
|
-
};
|
213
|
-
|
214
|
-
/* Attach the instance to the DataTables instance so it can be accessed */
|
215
|
-
this.s.dt.oScroller = this;
|
216
|
-
|
217
|
-
/* Let's do it */
|
218
|
-
this._fnConstruct();
|
219
|
-
};
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
Scroller.prototype = /** @lends Scroller.prototype */{
|
224
|
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
225
|
-
* Public methods
|
226
|
-
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
227
|
-
|
228
|
-
/**
|
229
|
-
* Calculate the pixel position from the top of the scrolling container for
|
230
|
-
* a given row
|
231
|
-
* @param {int} iRow Row number to calculate the position of
|
232
|
-
* @returns {int} Pixels
|
233
|
-
* @example
|
234
|
-
* $(document).ready(function() {
|
235
|
-
* $('#example').dataTable( {
|
236
|
-
* "sScrollY": "200px",
|
237
|
-
* "sAjaxSource": "media/dataset/large.txt",
|
238
|
-
* "sDom": "frtiS",
|
239
|
-
* "bDeferRender": true,
|
240
|
-
* "fnInitComplete": function (o) {
|
241
|
-
* // Find where row 25 is
|
242
|
-
* alert( o.oScroller.fnRowToPixels( 25 ) );
|
243
|
-
* }
|
244
|
-
* } );
|
245
|
-
* } );
|
246
|
-
*/
|
247
|
-
"fnRowToPixels": function ( rowIdx, intParse, virtual )
|
248
|
-
{
|
249
|
-
var pixels;
|
250
|
-
|
251
|
-
if ( virtual ) {
|
252
|
-
pixels = this._domain( 'virtualToPhysical', rowIdx * this.s.heights.row );
|
253
|
-
}
|
254
|
-
else {
|
255
|
-
var diff = rowIdx - this.s.baseRowTop;
|
256
|
-
pixels = this.s.baseScrollTop + (diff * this.s.heights.row);
|
257
|
-
}
|
258
|
-
|
259
|
-
return intParse || intParse === undefined ?
|
260
|
-
parseInt( pixels, 10 ) :
|
261
|
-
pixels;
|
262
|
-
},
|
263
|
-
|
264
|
-
|
265
|
-
/**
|
266
|
-
* Calculate the row number that will be found at the given pixel position
|
267
|
-
* (y-scroll).
|
268
|
-
*
|
269
|
-
* Please note that when the height of the full table exceeds 1 million
|
270
|
-
* pixels, Scroller switches into a non-linear mode for the scrollbar to fit
|
271
|
-
* all of the records into a finite area, but this function returns a linear
|
272
|
-
* value (relative to the last non-linear positioning).
|
273
|
-
* @param {int} iPixels Offset from top to calculate the row number of
|
274
|
-
* @param {int} [intParse=true] If an integer value should be returned
|
275
|
-
* @param {int} [virtual=false] Perform the calculations in the virtual domain
|
276
|
-
* @returns {int} Row index
|
277
|
-
* @example
|
278
|
-
* $(document).ready(function() {
|
279
|
-
* $('#example').dataTable( {
|
280
|
-
* "sScrollY": "200px",
|
281
|
-
* "sAjaxSource": "media/dataset/large.txt",
|
282
|
-
* "sDom": "frtiS",
|
283
|
-
* "bDeferRender": true,
|
284
|
-
* "fnInitComplete": function (o) {
|
285
|
-
* // Find what row number is at 500px
|
286
|
-
* alert( o.oScroller.fnPixelsToRow( 500 ) );
|
287
|
-
* }
|
288
|
-
* } );
|
289
|
-
* } );
|
290
|
-
*/
|
291
|
-
"fnPixelsToRow": function ( pixels, intParse, virtual )
|
292
|
-
{
|
293
|
-
var diff = pixels - this.s.baseScrollTop;
|
294
|
-
var row = virtual ?
|
295
|
-
this._domain( 'physicalToVirtual', pixels ) / this.s.heights.row :
|
296
|
-
( diff / this.s.heights.row ) + this.s.baseRowTop;
|
297
|
-
|
298
|
-
return intParse || intParse === undefined ?
|
299
|
-
parseInt( row, 10 ) :
|
300
|
-
row;
|
301
|
-
},
|
302
|
-
|
303
|
-
|
304
|
-
/**
|
305
|
-
* Calculate the row number that will be found at the given pixel position (y-scroll)
|
306
|
-
* @param {int} iRow Row index to scroll to
|
307
|
-
* @param {bool} [bAnimate=true] Animate the transition or not
|
308
|
-
* @returns {void}
|
309
|
-
* @example
|
310
|
-
* $(document).ready(function() {
|
311
|
-
* $('#example').dataTable( {
|
312
|
-
* "sScrollY": "200px",
|
313
|
-
* "sAjaxSource": "media/dataset/large.txt",
|
314
|
-
* "sDom": "frtiS",
|
315
|
-
* "bDeferRender": true,
|
316
|
-
* "fnInitComplete": function (o) {
|
317
|
-
* // Immediately scroll to row 1000
|
318
|
-
* o.oScroller.fnScrollToRow( 1000 );
|
319
|
-
* }
|
320
|
-
* } );
|
321
|
-
*
|
322
|
-
* // Sometime later on use the following to scroll to row 500...
|
323
|
-
* var oSettings = $('#example').dataTable().fnSettings();
|
324
|
-
* oSettings.oScroller.fnScrollToRow( 500 );
|
325
|
-
* } );
|
326
|
-
*/
|
327
|
-
"fnScrollToRow": function ( iRow, bAnimate )
|
328
|
-
{
|
329
|
-
var that = this;
|
330
|
-
var ani = false;
|
331
|
-
var px = this.fnRowToPixels( iRow );
|
332
|
-
|
333
|
-
// We need to know if the table will redraw or not before doing the
|
334
|
-
// scroll. If it will not redraw, then we need to use the currently
|
335
|
-
// displayed table, and scroll with the physical pixels. Otherwise, we
|
336
|
-
// need to calculate the table's new position from the virtual
|
337
|
-
// transform.
|
338
|
-
var preRows = ((this.s.displayBuffer-1)/2) * this.s.viewportRows;
|
339
|
-
var drawRow = iRow - preRows;
|
340
|
-
if ( drawRow < 0 ) {
|
341
|
-
drawRow = 0;
|
342
|
-
}
|
343
|
-
|
344
|
-
if ( (px > this.s.redrawBottom || px < this.s.redrawTop) && this.s.dt._iDisplayStart !== drawRow ) {
|
345
|
-
ani = true;
|
346
|
-
px = this.fnRowToPixels( iRow, false, true );
|
347
|
-
}
|
348
|
-
|
349
|
-
if ( typeof bAnimate == 'undefined' || bAnimate )
|
350
|
-
{
|
351
|
-
this.s.ani = ani;
|
352
|
-
$(this.dom.scroller).animate( {
|
353
|
-
"scrollTop": px
|
354
|
-
}, function () {
|
355
|
-
// This needs to happen after the animation has completed and
|
356
|
-
// the final scroll event fired
|
357
|
-
setTimeout( function () {
|
358
|
-
that.s.ani = false;
|
359
|
-
}, 25 );
|
360
|
-
} );
|
361
|
-
}
|
362
|
-
else
|
363
|
-
{
|
364
|
-
$(this.dom.scroller).scrollTop( px );
|
365
|
-
}
|
366
|
-
},
|
367
|
-
|
368
|
-
|
369
|
-
/**
|
370
|
-
* Calculate and store information about how many rows are to be displayed
|
371
|
-
* in the scrolling viewport, based on current dimensions in the browser's
|
372
|
-
* rendering. This can be particularly useful if the table is initially
|
373
|
-
* drawn in a hidden element - for example in a tab.
|
374
|
-
* @param {bool} [bRedraw=true] Redraw the table automatically after the recalculation, with
|
375
|
-
* the new dimensions forming the basis for the draw.
|
376
|
-
* @returns {void}
|
377
|
-
* @example
|
378
|
-
* $(document).ready(function() {
|
379
|
-
* // Make the example container hidden to throw off the browser's sizing
|
380
|
-
* document.getElementById('container').style.display = "none";
|
381
|
-
* var oTable = $('#example').dataTable( {
|
382
|
-
* "sScrollY": "200px",
|
383
|
-
* "sAjaxSource": "media/dataset/large.txt",
|
384
|
-
* "sDom": "frtiS",
|
385
|
-
* "bDeferRender": true,
|
386
|
-
* "fnInitComplete": function (o) {
|
387
|
-
* // Immediately scroll to row 1000
|
388
|
-
* o.oScroller.fnScrollToRow( 1000 );
|
389
|
-
* }
|
390
|
-
* } );
|
391
|
-
*
|
392
|
-
* setTimeout( function () {
|
393
|
-
* // Make the example container visible and recalculate the scroller sizes
|
394
|
-
* document.getElementById('container').style.display = "block";
|
395
|
-
* oTable.fnSettings().oScroller.fnMeasure();
|
396
|
-
* }, 3000 );
|
397
|
-
*/
|
398
|
-
"fnMeasure": function ( bRedraw )
|
399
|
-
{
|
400
|
-
if ( this.s.autoHeight )
|
401
|
-
{
|
402
|
-
this._fnCalcRowHeight();
|
403
|
-
}
|
404
|
-
|
405
|
-
var heights = this.s.heights;
|
406
|
-
|
407
|
-
heights.viewport = $(this.dom.scroller).height();
|
408
|
-
this.s.viewportRows = parseInt( heights.viewport / heights.row, 10 )+1;
|
409
|
-
this.s.dt._iDisplayLength = this.s.viewportRows * this.s.displayBuffer;
|
410
|
-
|
411
|
-
if ( bRedraw === undefined || bRedraw )
|
412
|
-
{
|
413
|
-
this.s.dt.oInstance.fnDraw();
|
414
|
-
}
|
415
|
-
},
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
420
|
-
* Private methods (they are of course public in JS, but recommended as private)
|
421
|
-
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
422
|
-
|
423
|
-
/**
|
424
|
-
* Initialisation for Scroller
|
425
|
-
* @returns {void}
|
426
|
-
* @private
|
427
|
-
*/
|
428
|
-
"_fnConstruct": function ()
|
429
|
-
{
|
430
|
-
var that = this;
|
431
|
-
|
432
|
-
/* Sanity check */
|
433
|
-
if ( !this.s.dt.oFeatures.bPaginate ) {
|
434
|
-
this.s.dt.oApi._fnLog( this.s.dt, 0, 'Pagination must be enabled for Scroller' );
|
435
|
-
return;
|
436
|
-
}
|
437
|
-
|
438
|
-
/* Insert a div element that we can use to force the DT scrolling container to
|
439
|
-
* the height that would be required if the whole table was being displayed
|
440
|
-
*/
|
441
|
-
this.dom.force.style.position = "absolute";
|
442
|
-
this.dom.force.style.top = "0px";
|
443
|
-
this.dom.force.style.left = "0px";
|
444
|
-
this.dom.force.style.width = "1px";
|
445
|
-
|
446
|
-
this.dom.scroller = $('div.'+this.s.dt.oClasses.sScrollBody, this.s.dt.nTableWrapper)[0];
|
447
|
-
this.dom.scroller.appendChild( this.dom.force );
|
448
|
-
this.dom.scroller.style.position = "relative";
|
449
|
-
|
450
|
-
this.dom.table = $('>table', this.dom.scroller)[0];
|
451
|
-
this.dom.table.style.position = "absolute";
|
452
|
-
this.dom.table.style.top = "0px";
|
453
|
-
this.dom.table.style.left = "0px";
|
454
|
-
|
455
|
-
// Add class to 'announce' that we are a Scroller table
|
456
|
-
$(this.s.dt.nTableWrapper).addClass('DTS');
|
457
|
-
|
458
|
-
// Add a 'loading' indicator
|
459
|
-
if ( this.s.loadingIndicator )
|
460
|
-
{
|
461
|
-
this.dom.loader = $('<div class="DTS_Loading">'+this.s.dt.oLanguage.sLoadingRecords+'</div>')
|
462
|
-
.css('display', 'none');
|
463
|
-
|
464
|
-
$(this.dom.scroller.parentNode)
|
465
|
-
.css('position', 'relative')
|
466
|
-
.append( this.dom.loader );
|
467
|
-
}
|
468
|
-
|
469
|
-
/* Initial size calculations */
|
470
|
-
if ( this.s.heights.row && this.s.heights.row != 'auto' )
|
471
|
-
{
|
472
|
-
this.s.autoHeight = false;
|
473
|
-
}
|
474
|
-
this.fnMeasure( false );
|
475
|
-
|
476
|
-
/* Scrolling callback to see if a page change is needed - use a throttled
|
477
|
-
* function for the save save callback so we aren't hitting it on every
|
478
|
-
* scroll
|
479
|
-
*/
|
480
|
-
this.s.ingnoreScroll = true;
|
481
|
-
this.s.stateSaveThrottle = this.s.dt.oApi._fnThrottle( function () {
|
482
|
-
that.s.dt.oApi._fnSaveState( that.s.dt );
|
483
|
-
}, 500 );
|
484
|
-
$(this.dom.scroller).on( 'scroll.DTS', function (e) {
|
485
|
-
that._fnScroll.call( that );
|
486
|
-
} );
|
487
|
-
|
488
|
-
/* In iOS we catch the touchstart event in case the user tries to scroll
|
489
|
-
* while the display is already scrolling
|
490
|
-
*/
|
491
|
-
$(this.dom.scroller).on('touchstart.DTS', function () {
|
492
|
-
that._fnScroll.call( that );
|
493
|
-
} );
|
494
|
-
|
495
|
-
/* Update the scroller when the DataTable is redrawn */
|
496
|
-
this.s.dt.aoDrawCallback.push( {
|
497
|
-
"fn": function () {
|
498
|
-
if ( that.s.dt.bInitialised ) {
|
499
|
-
that._fnDrawCallback.call( that );
|
500
|
-
}
|
501
|
-
},
|
502
|
-
"sName": "Scroller"
|
503
|
-
} );
|
504
|
-
|
505
|
-
/* On resize, update the information element, since the number of rows shown might change */
|
506
|
-
$(window).on( 'resize.DTS', function () {
|
507
|
-
that.fnMeasure( false );
|
508
|
-
that._fnInfo();
|
509
|
-
} );
|
510
|
-
|
511
|
-
/* Add a state saving parameter to the DT state saving so we can restore the exact
|
512
|
-
* position of the scrolling
|
513
|
-
*/
|
514
|
-
var initialStateSave = true;
|
515
|
-
this.s.dt.oApi._fnCallbackReg( this.s.dt, 'aoStateSaveParams', function (oS, oData) {
|
516
|
-
/* Set iScroller to saved scroll position on initialization.
|
517
|
-
*/
|
518
|
-
if(initialStateSave && that.s.dt.oLoadedState){
|
519
|
-
oData.iScroller = that.s.dt.oLoadedState.iScroller;
|
520
|
-
oData.iScrollerTopRow = that.s.dt.oLoadedState.iScrollerTopRow;
|
521
|
-
initialStateSave = false;
|
522
|
-
} else {
|
523
|
-
oData.iScroller = that.dom.scroller.scrollTop;
|
524
|
-
oData.iScrollerTopRow = that.s.topRowFloat;
|
525
|
-
}
|
526
|
-
}, "Scroller_State" );
|
527
|
-
|
528
|
-
if ( this.s.dt.oLoadedState ) {
|
529
|
-
this.s.topRowFloat = this.s.dt.oLoadedState.iScrollerTopRow || 0;
|
530
|
-
}
|
531
|
-
|
532
|
-
/* Destructor */
|
533
|
-
this.s.dt.aoDestroyCallback.push( {
|
534
|
-
"sName": "Scroller",
|
535
|
-
"fn": function () {
|
536
|
-
$(window).off( 'resize.DTS' );
|
537
|
-
$(that.dom.scroller).off('touchstart.DTS scroll.DTS');
|
538
|
-
$(that.s.dt.nTableWrapper).removeClass('DTS');
|
539
|
-
$('div.DTS_Loading', that.dom.scroller.parentNode).remove();
|
540
|
-
|
541
|
-
that.dom.table.style.position = "";
|
542
|
-
that.dom.table.style.top = "";
|
543
|
-
that.dom.table.style.left = "";
|
544
|
-
}
|
545
|
-
} );
|
546
|
-
},
|
547
|
-
|
548
|
-
|
549
|
-
/**
|
550
|
-
* Scrolling function - fired whenever the scrolling position is changed.
|
551
|
-
* This method needs to use the stored values to see if the table should be
|
552
|
-
* redrawn as we are moving towards the end of the information that is
|
553
|
-
* currently drawn or not. If needed, then it will redraw the table based on
|
554
|
-
* the new position.
|
555
|
-
* @returns {void}
|
556
|
-
* @private
|
557
|
-
*/
|
558
|
-
"_fnScroll": function ()
|
559
|
-
{
|
560
|
-
var
|
561
|
-
that = this,
|
562
|
-
heights = this.s.heights,
|
563
|
-
iScrollTop = this.dom.scroller.scrollTop,
|
564
|
-
iTopRow;
|
565
|
-
|
566
|
-
if ( this.s.skip ) {
|
567
|
-
return;
|
568
|
-
}
|
569
|
-
|
570
|
-
if ( this.s.ingnoreScroll ) {
|
571
|
-
return;
|
572
|
-
}
|
573
|
-
|
574
|
-
/* If the table has been sorted or filtered, then we use the redraw that
|
575
|
-
* DataTables as done, rather than performing our own
|
576
|
-
*/
|
577
|
-
if ( this.s.dt.bFiltered || this.s.dt.bSorted ) {
|
578
|
-
this.s.lastScrollTop = 0;
|
579
|
-
return;
|
580
|
-
}
|
581
|
-
|
582
|
-
/* Update the table's information display for what is now in the viewport */
|
583
|
-
this._fnInfo();
|
584
|
-
|
585
|
-
/* We don't want to state save on every scroll event - that's heavy
|
586
|
-
* handed, so use a timeout to update the state saving only when the
|
587
|
-
* scrolling has finished
|
588
|
-
*/
|
589
|
-
clearTimeout( this.s.stateTO );
|
590
|
-
this.s.stateTO = setTimeout( function () {
|
591
|
-
that.s.dt.oApi._fnSaveState( that.s.dt );
|
592
|
-
}, 250 );
|
593
|
-
|
594
|
-
/* Check if the scroll point is outside the trigger boundary which would required
|
595
|
-
* a DataTables redraw
|
596
|
-
*/
|
597
|
-
if ( iScrollTop < this.s.redrawTop || iScrollTop > this.s.redrawBottom ) {
|
598
|
-
var preRows = Math.ceil( ((this.s.displayBuffer-1)/2) * this.s.viewportRows );
|
599
|
-
|
600
|
-
if ( Math.abs( iScrollTop - this.s.lastScrollTop ) > heights.viewport || this.s.ani ) {
|
601
|
-
iTopRow = parseInt(this._domain( 'physicalToVirtual', iScrollTop ) / heights.row, 10) - preRows;
|
602
|
-
this.s.topRowFloat = (this._domain( 'physicalToVirtual', iScrollTop ) / heights.row);
|
603
|
-
}
|
604
|
-
else {
|
605
|
-
iTopRow = this.fnPixelsToRow( iScrollTop ) - preRows;
|
606
|
-
this.s.topRowFloat = this.fnPixelsToRow( iScrollTop, false );
|
607
|
-
}
|
608
|
-
|
609
|
-
if ( iTopRow <= 0 ) {
|
610
|
-
/* At the start of the table */
|
611
|
-
iTopRow = 0;
|
612
|
-
}
|
613
|
-
else if ( iTopRow + this.s.dt._iDisplayLength > this.s.dt.fnRecordsDisplay() ) {
|
614
|
-
/* At the end of the table */
|
615
|
-
iTopRow = this.s.dt.fnRecordsDisplay() - this.s.dt._iDisplayLength;
|
616
|
-
if ( iTopRow < 0 ) {
|
617
|
-
iTopRow = 0;
|
618
|
-
}
|
619
|
-
}
|
620
|
-
else if ( iTopRow % 2 !== 0 ) {
|
621
|
-
// For the row-striping classes (odd/even) we want only to start
|
622
|
-
// on evens otherwise the stripes will change between draws and
|
623
|
-
// look rubbish
|
624
|
-
iTopRow++;
|
625
|
-
}
|
626
|
-
|
627
|
-
if ( iTopRow != this.s.dt._iDisplayStart ) {
|
628
|
-
/* Cache the new table position for quick lookups */
|
629
|
-
this.s.tableTop = $(this.s.dt.nTable).offset().top;
|
630
|
-
this.s.tableBottom = $(this.s.dt.nTable).height() + this.s.tableTop;
|
631
|
-
|
632
|
-
var draw = function () {
|
633
|
-
if ( that.s.scrollDrawReq === null ) {
|
634
|
-
that.s.scrollDrawReq = iScrollTop;
|
635
|
-
}
|
636
|
-
|
637
|
-
that.s.dt._iDisplayStart = iTopRow;
|
638
|
-
if ( that.s.dt.oApi._fnCalculateEnd ) { // Removed in 1.10
|
639
|
-
that.s.dt.oApi._fnCalculateEnd( that.s.dt );
|
640
|
-
}
|
641
|
-
that.s.dt.oApi._fnDraw( that.s.dt );
|
642
|
-
};
|
643
|
-
|
644
|
-
/* Do the DataTables redraw based on the calculated start point - note that when
|
645
|
-
* using server-side processing we introduce a small delay to not DoS the server...
|
646
|
-
*/
|
647
|
-
if ( this.s.dt.oFeatures.bServerSide ) {
|
648
|
-
clearTimeout( this.s.drawTO );
|
649
|
-
this.s.drawTO = setTimeout( draw, this.s.serverWait );
|
650
|
-
}
|
651
|
-
else {
|
652
|
-
draw();
|
653
|
-
}
|
654
|
-
|
655
|
-
if ( this.dom.loader && ! this.s.loaderVisible ) {
|
656
|
-
this.dom.loader.css( 'display', 'block' );
|
657
|
-
this.s.loaderVisible = true;
|
658
|
-
}
|
659
|
-
}
|
660
|
-
}
|
661
|
-
|
662
|
-
this.s.lastScrollTop = iScrollTop;
|
663
|
-
this.s.stateSaveThrottle();
|
664
|
-
},
|
665
|
-
|
666
|
-
|
667
|
-
/**
|
668
|
-
* Convert from one domain to another. The physical domain is the actual
|
669
|
-
* pixel count on the screen, while the virtual is if we had browsers which
|
670
|
-
* had scrolling containers of infinite height (i.e. the absolute value)
|
671
|
-
*
|
672
|
-
* @param {string} dir Domain transform direction, `virtualToPhysical` or
|
673
|
-
* `physicalToVirtual`
|
674
|
-
* @returns {number} Calculated transform
|
675
|
-
* @private
|
676
|
-
*/
|
677
|
-
_domain: function ( dir, val )
|
678
|
-
{
|
679
|
-
var heights = this.s.heights;
|
680
|
-
var coeff;
|
681
|
-
|
682
|
-
// If the virtual and physical height match, then we use a linear
|
683
|
-
// transform between the two, allowing the scrollbar to be linear
|
684
|
-
if ( heights.virtual === heights.scroll ) {
|
685
|
-
coeff = (heights.virtual-heights.viewport) / (heights.scroll-heights.viewport);
|
686
|
-
|
687
|
-
if ( dir === 'virtualToPhysical' ) {
|
688
|
-
return val / coeff;
|
689
|
-
}
|
690
|
-
else if ( dir === 'physicalToVirtual' ) {
|
691
|
-
return val * coeff;
|
692
|
-
}
|
693
|
-
}
|
694
|
-
|
695
|
-
// Otherwise, we want a non-linear scrollbar to take account of the
|
696
|
-
// redrawing regions at the start and end of the table, otherwise these
|
697
|
-
// can stutter badly - on large tables 30px (for example) scroll might
|
698
|
-
// be hundreds of rows, so the table would be redrawing every few px at
|
699
|
-
// the start and end. Use a simple quadratic to stop this. It does mean
|
700
|
-
// the scrollbar is non-linear, but with such massive data sets, the
|
701
|
-
// scrollbar is going to be a best guess anyway
|
702
|
-
var xMax = (heights.scroll - heights.viewport) / 2;
|
703
|
-
var yMax = (heights.virtual - heights.viewport) / 2;
|
704
|
-
|
705
|
-
coeff = yMax / ( xMax * xMax );
|
706
|
-
|
707
|
-
if ( dir === 'virtualToPhysical' ) {
|
708
|
-
if ( val < yMax ) {
|
709
|
-
return Math.pow(val / coeff, 0.5);
|
710
|
-
}
|
711
|
-
else {
|
712
|
-
val = (yMax*2) - val;
|
713
|
-
return val < 0 ?
|
714
|
-
heights.scroll :
|
715
|
-
(xMax*2) - Math.pow(val / coeff, 0.5);
|
716
|
-
}
|
717
|
-
}
|
718
|
-
else if ( dir === 'physicalToVirtual' ) {
|
719
|
-
if ( val < xMax ) {
|
720
|
-
return val * val * coeff;
|
721
|
-
}
|
722
|
-
else {
|
723
|
-
val = (xMax*2) - val;
|
724
|
-
return val < 0 ?
|
725
|
-
heights.virtual :
|
726
|
-
(yMax*2) - (val * val * coeff);
|
727
|
-
}
|
728
|
-
}
|
729
|
-
},
|
730
|
-
|
731
|
-
|
732
|
-
/**
|
733
|
-
* Draw callback function which is fired when the DataTable is redrawn. The main function of
|
734
|
-
* this method is to position the drawn table correctly the scrolling container for the rows
|
735
|
-
* that is displays as a result of the scrolling position.
|
736
|
-
* @returns {void}
|
737
|
-
* @private
|
738
|
-
*/
|
739
|
-
"_fnDrawCallback": function ()
|
740
|
-
{
|
741
|
-
var
|
742
|
-
that = this,
|
743
|
-
heights = this.s.heights,
|
744
|
-
iScrollTop = this.dom.scroller.scrollTop,
|
745
|
-
iActualScrollTop = iScrollTop,
|
746
|
-
iScrollBottom = iScrollTop + heights.viewport,
|
747
|
-
iTableHeight = $(this.s.dt.nTable).height(),
|
748
|
-
displayStart = this.s.dt._iDisplayStart,
|
749
|
-
displayLen = this.s.dt._iDisplayLength,
|
750
|
-
displayEnd = this.s.dt.fnRecordsDisplay();
|
751
|
-
|
752
|
-
// Disable the scroll event listener while we are updating the DOM
|
753
|
-
this.s.skip = true;
|
754
|
-
|
755
|
-
// Resize the scroll forcing element
|
756
|
-
this._fnScrollForce();
|
757
|
-
|
758
|
-
// Reposition the scrolling for the updated virtual position if needed
|
759
|
-
if ( displayStart === 0 ) {
|
760
|
-
// Linear calculation at the top of the table
|
761
|
-
iScrollTop = this.s.topRowFloat * heights.row;
|
762
|
-
}
|
763
|
-
else if ( displayStart + displayLen >= displayEnd ) {
|
764
|
-
// Linear calculation that the bottom as well
|
765
|
-
iScrollTop = heights.scroll - ((displayEnd - this.s.topRowFloat) * heights.row);
|
766
|
-
}
|
767
|
-
else {
|
768
|
-
// Domain scaled in the middle
|
769
|
-
iScrollTop = this._domain( 'virtualToPhysical', this.s.topRowFloat * heights.row );
|
770
|
-
}
|
771
|
-
|
772
|
-
this.dom.scroller.scrollTop = iScrollTop;
|
773
|
-
|
774
|
-
// Store positional information so positional calculations can be based
|
775
|
-
// upon the current table draw position
|
776
|
-
this.s.baseScrollTop = iScrollTop;
|
777
|
-
this.s.baseRowTop = this.s.topRowFloat;
|
778
|
-
|
779
|
-
// Position the table in the virtual scroller
|
780
|
-
var tableTop = iScrollTop - ((this.s.topRowFloat - displayStart) * heights.row);
|
781
|
-
if ( displayStart === 0 ) {
|
782
|
-
tableTop = 0;
|
783
|
-
}
|
784
|
-
else if ( displayStart + displayLen >= displayEnd ) {
|
785
|
-
tableTop = heights.scroll - iTableHeight;
|
786
|
-
}
|
787
|
-
|
788
|
-
this.dom.table.style.top = tableTop+'px';
|
789
|
-
|
790
|
-
/* Cache some information for the scroller */
|
791
|
-
this.s.tableTop = tableTop;
|
792
|
-
this.s.tableBottom = iTableHeight + this.s.tableTop;
|
793
|
-
|
794
|
-
// Calculate the boundaries for where a redraw will be triggered by the
|
795
|
-
// scroll event listener
|
796
|
-
var boundaryPx = (iScrollTop - this.s.tableTop) * this.s.boundaryScale;
|
797
|
-
this.s.redrawTop = iScrollTop - boundaryPx;
|
798
|
-
this.s.redrawBottom = iScrollTop + boundaryPx;
|
799
|
-
|
800
|
-
this.s.skip = false;
|
801
|
-
|
802
|
-
// Restore the scrolling position that was saved by DataTable's state
|
803
|
-
// saving Note that this is done on the second draw when data is Ajax
|
804
|
-
// sourced, and the first draw when DOM soured
|
805
|
-
if ( this.s.dt.oFeatures.bStateSave && this.s.dt.oLoadedState !== null &&
|
806
|
-
typeof this.s.dt.oLoadedState.iScroller != 'undefined' )
|
807
|
-
{
|
808
|
-
// A quirk of DataTables is that the draw callback will occur on an
|
809
|
-
// empty set if Ajax sourced, but not if server-side processing.
|
810
|
-
var ajaxSourced = (this.s.dt.sAjaxSource || that.s.dt.ajax) && ! this.s.dt.oFeatures.bServerSide ?
|
811
|
-
true :
|
812
|
-
false;
|
813
|
-
|
814
|
-
if ( ( ajaxSourced && this.s.dt.iDraw == 2) ||
|
815
|
-
(!ajaxSourced && this.s.dt.iDraw == 1) )
|
816
|
-
{
|
817
|
-
setTimeout( function () {
|
818
|
-
$(that.dom.scroller).scrollTop( that.s.dt.oLoadedState.iScroller );
|
819
|
-
that.s.redrawTop = that.s.dt.oLoadedState.iScroller - (heights.viewport/2);
|
820
|
-
|
821
|
-
// In order to prevent layout thrashing we need another
|
822
|
-
// small delay
|
823
|
-
setTimeout( function () {
|
824
|
-
that.s.ingnoreScroll = false;
|
825
|
-
}, 0 );
|
826
|
-
}, 0 );
|
827
|
-
}
|
828
|
-
}
|
829
|
-
else {
|
830
|
-
that.s.ingnoreScroll = false;
|
831
|
-
}
|
832
|
-
|
833
|
-
// Because of the order of the DT callbacks, the info update will
|
834
|
-
// take precedence over the one we want here. So a 'thread' break is
|
835
|
-
// needed
|
836
|
-
setTimeout( function () {
|
837
|
-
that._fnInfo.call( that );
|
838
|
-
}, 0 );
|
839
|
-
|
840
|
-
// Hide the loading indicator
|
841
|
-
if ( this.dom.loader && this.s.loaderVisible ) {
|
842
|
-
this.dom.loader.css( 'display', 'none' );
|
843
|
-
this.s.loaderVisible = false;
|
844
|
-
}
|
845
|
-
},
|
846
|
-
|
847
|
-
|
848
|
-
/**
|
849
|
-
* Force the scrolling container to have height beyond that of just the
|
850
|
-
* table that has been drawn so the user can scroll the whole data set.
|
851
|
-
*
|
852
|
-
* Note that if the calculated required scrolling height exceeds a maximum
|
853
|
-
* value (1 million pixels - hard-coded) the forcing element will be set
|
854
|
-
* only to that maximum value and virtual / physical domain transforms will
|
855
|
-
* be used to allow Scroller to display tables of any number of records.
|
856
|
-
* @returns {void}
|
857
|
-
* @private
|
858
|
-
*/
|
859
|
-
_fnScrollForce: function ()
|
860
|
-
{
|
861
|
-
var heights = this.s.heights;
|
862
|
-
var max = 1000000;
|
863
|
-
|
864
|
-
heights.virtual = heights.row * this.s.dt.fnRecordsDisplay();
|
865
|
-
heights.scroll = heights.virtual;
|
866
|
-
|
867
|
-
if ( heights.scroll > max ) {
|
868
|
-
heights.scroll = max;
|
869
|
-
}
|
870
|
-
|
871
|
-
this.dom.force.style.height = heights.scroll+"px";
|
872
|
-
},
|
873
|
-
|
874
|
-
|
875
|
-
/**
|
876
|
-
* Automatic calculation of table row height. This is just a little tricky here as using
|
877
|
-
* initialisation DataTables has tale the table out of the document, so we need to create
|
878
|
-
* a new table and insert it into the document, calculate the row height and then whip the
|
879
|
-
* table out.
|
880
|
-
* @returns {void}
|
881
|
-
* @private
|
882
|
-
*/
|
883
|
-
"_fnCalcRowHeight": function ()
|
884
|
-
{
|
885
|
-
var dt = this.s.dt;
|
886
|
-
var origTable = dt.nTable;
|
887
|
-
var nTable = origTable.cloneNode( false );
|
888
|
-
var tbody = $('<tbody/>').appendTo( nTable );
|
889
|
-
var container = $(
|
890
|
-
'<div class="'+dt.oClasses.sWrapper+' DTS">'+
|
891
|
-
'<div class="'+dt.oClasses.sScrollWrapper+'">'+
|
892
|
-
'<div class="'+dt.oClasses.sScrollBody+'"></div>'+
|
893
|
-
'</div>'+
|
894
|
-
'</div>'
|
895
|
-
);
|
896
|
-
|
897
|
-
// Want 3 rows in the sizing table so :first-child and :last-child
|
898
|
-
// CSS styles don't come into play - take the size of the middle row
|
899
|
-
$('tbody tr:lt(4)', origTable).clone().appendTo( tbody );
|
900
|
-
while( $('tr', tbody).length < 3 ) {
|
901
|
-
tbody.append( '<tr><td> </td></tr>' );
|
902
|
-
}
|
903
|
-
|
904
|
-
$('div.'+dt.oClasses.sScrollBody, container).append( nTable );
|
905
|
-
|
906
|
-
var appendTo;
|
907
|
-
if (dt._bInitComplete) {
|
908
|
-
appendTo = origTable.parentNode;
|
909
|
-
} else {
|
910
|
-
if (!this.s.dt.nHolding) {
|
911
|
-
this.s.dt.nHolding = $( '<div></div>' ).insertBefore( this.s.dt.nTable );
|
912
|
-
}
|
913
|
-
appendTo = this.s.dt.nHolding;
|
914
|
-
}
|
915
|
-
|
916
|
-
container.appendTo( appendTo );
|
917
|
-
this.s.heights.row = $('tr', tbody).eq(1).outerHeight();
|
918
|
-
container.remove();
|
919
|
-
},
|
920
|
-
|
921
|
-
|
922
|
-
/**
|
923
|
-
* Update any information elements that are controlled by the DataTable based on the scrolling
|
924
|
-
* viewport and what rows are visible in it. This function basically acts in the same way as
|
925
|
-
* _fnUpdateInfo in DataTables, and effectively replaces that function.
|
926
|
-
* @returns {void}
|
927
|
-
* @private
|
928
|
-
*/
|
929
|
-
"_fnInfo": function ()
|
930
|
-
{
|
931
|
-
if ( !this.s.dt.oFeatures.bInfo )
|
932
|
-
{
|
933
|
-
return;
|
934
|
-
}
|
935
|
-
|
936
|
-
var
|
937
|
-
dt = this.s.dt,
|
938
|
-
language = dt.oLanguage,
|
939
|
-
iScrollTop = this.dom.scroller.scrollTop,
|
940
|
-
iStart = Math.floor( this.fnPixelsToRow(iScrollTop, false, this.s.ani)+1 ),
|
941
|
-
iMax = dt.fnRecordsTotal(),
|
942
|
-
iTotal = dt.fnRecordsDisplay(),
|
943
|
-
iPossibleEnd = Math.ceil( this.fnPixelsToRow(iScrollTop+this.s.heights.viewport, false, this.s.ani) ),
|
944
|
-
iEnd = iTotal < iPossibleEnd ? iTotal : iPossibleEnd,
|
945
|
-
sStart = dt.fnFormatNumber( iStart ),
|
946
|
-
sEnd = dt.fnFormatNumber( iEnd ),
|
947
|
-
sMax = dt.fnFormatNumber( iMax ),
|
948
|
-
sTotal = dt.fnFormatNumber( iTotal ),
|
949
|
-
sOut;
|
950
|
-
|
951
|
-
if ( dt.fnRecordsDisplay() === 0 &&
|
952
|
-
dt.fnRecordsDisplay() == dt.fnRecordsTotal() )
|
953
|
-
{
|
954
|
-
/* Empty record set */
|
955
|
-
sOut = language.sInfoEmpty+ language.sInfoPostFix;
|
956
|
-
}
|
957
|
-
else if ( dt.fnRecordsDisplay() === 0 )
|
958
|
-
{
|
959
|
-
/* Empty record set after filtering */
|
960
|
-
sOut = language.sInfoEmpty +' '+
|
961
|
-
language.sInfoFiltered.replace('_MAX_', sMax)+
|
962
|
-
language.sInfoPostFix;
|
963
|
-
}
|
964
|
-
else if ( dt.fnRecordsDisplay() == dt.fnRecordsTotal() )
|
965
|
-
{
|
966
|
-
/* Normal record set */
|
967
|
-
sOut = language.sInfo.
|
968
|
-
replace('_START_', sStart).
|
969
|
-
replace('_END_', sEnd).
|
970
|
-
replace('_MAX_', sMax).
|
971
|
-
replace('_TOTAL_', sTotal)+
|
972
|
-
language.sInfoPostFix;
|
973
|
-
}
|
974
|
-
else
|
975
|
-
{
|
976
|
-
/* Record set after filtering */
|
977
|
-
sOut = language.sInfo.
|
978
|
-
replace('_START_', sStart).
|
979
|
-
replace('_END_', sEnd).
|
980
|
-
replace('_MAX_', sMax).
|
981
|
-
replace('_TOTAL_', sTotal) +' '+
|
982
|
-
language.sInfoFiltered.replace(
|
983
|
-
'_MAX_',
|
984
|
-
dt.fnFormatNumber(dt.fnRecordsTotal())
|
985
|
-
)+
|
986
|
-
language.sInfoPostFix;
|
987
|
-
}
|
988
|
-
|
989
|
-
var callback = language.fnInfoCallback;
|
990
|
-
if ( callback ) {
|
991
|
-
sOut = callback.call( dt.oInstance,
|
992
|
-
dt, iStart, iEnd, iMax, iTotal, sOut
|
993
|
-
);
|
994
|
-
}
|
995
|
-
|
996
|
-
var n = dt.aanFeatures.i;
|
997
|
-
if ( typeof n != 'undefined' )
|
998
|
-
{
|
999
|
-
for ( var i=0, iLen=n.length ; i<iLen ; i++ )
|
1000
|
-
{
|
1001
|
-
$(n[i]).html( sOut );
|
1002
|
-
}
|
1003
|
-
}
|
1004
|
-
}
|
1005
|
-
};
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
1010
|
-
* Statics
|
1011
|
-
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
1012
|
-
|
1013
|
-
|
1014
|
-
/**
|
1015
|
-
* Scroller default settings for initialisation
|
1016
|
-
* @namespace
|
1017
|
-
* @name Scroller.defaults
|
1018
|
-
* @static
|
1019
|
-
*/
|
1020
|
-
Scroller.defaults = /** @lends Scroller.defaults */{
|
1021
|
-
/**
|
1022
|
-
* Indicate if Scroller show show trace information on the console or not. This can be
|
1023
|
-
* useful when debugging Scroller or if just curious as to what it is doing, but should
|
1024
|
-
* be turned off for production.
|
1025
|
-
* @type bool
|
1026
|
-
* @default false
|
1027
|
-
* @static
|
1028
|
-
* @example
|
1029
|
-
* var oTable = $('#example').dataTable( {
|
1030
|
-
* "sScrollY": "200px",
|
1031
|
-
* "sDom": "frtiS",
|
1032
|
-
* "bDeferRender": true,
|
1033
|
-
* "oScroller": {
|
1034
|
-
* "trace": true
|
1035
|
-
* }
|
1036
|
-
* } );
|
1037
|
-
*/
|
1038
|
-
"trace": false,
|
1039
|
-
|
1040
|
-
/**
|
1041
|
-
* Scroller will attempt to automatically calculate the height of rows for it's internal
|
1042
|
-
* calculations. However the height that is used can be overridden using this parameter.
|
1043
|
-
* @type int|string
|
1044
|
-
* @default auto
|
1045
|
-
* @static
|
1046
|
-
* @example
|
1047
|
-
* var oTable = $('#example').dataTable( {
|
1048
|
-
* "sScrollY": "200px",
|
1049
|
-
* "sDom": "frtiS",
|
1050
|
-
* "bDeferRender": true,
|
1051
|
-
* "oScroller": {
|
1052
|
-
* "rowHeight": 30
|
1053
|
-
* }
|
1054
|
-
* } );
|
1055
|
-
*/
|
1056
|
-
"rowHeight": "auto",
|
1057
|
-
|
1058
|
-
/**
|
1059
|
-
* When using server-side processing, Scroller will wait a small amount of time to allow
|
1060
|
-
* the scrolling to finish before requesting more data from the server. This prevents
|
1061
|
-
* you from DoSing your own server! The wait time can be configured by this parameter.
|
1062
|
-
* @type int
|
1063
|
-
* @default 200
|
1064
|
-
* @static
|
1065
|
-
* @example
|
1066
|
-
* var oTable = $('#example').dataTable( {
|
1067
|
-
* "sScrollY": "200px",
|
1068
|
-
* "sDom": "frtiS",
|
1069
|
-
* "bDeferRender": true,
|
1070
|
-
* "oScroller": {
|
1071
|
-
* "serverWait": 100
|
1072
|
-
* }
|
1073
|
-
* } );
|
1074
|
-
*/
|
1075
|
-
"serverWait": 200,
|
1076
|
-
|
1077
|
-
/**
|
1078
|
-
* The display buffer is what Scroller uses to calculate how many rows it should pre-fetch
|
1079
|
-
* for scrolling. Scroller automatically adjusts DataTables' display length to pre-fetch
|
1080
|
-
* rows that will be shown in "near scrolling" (i.e. just beyond the current display area).
|
1081
|
-
* The value is based upon the number of rows that can be displayed in the viewport (i.e.
|
1082
|
-
* a value of 1), and will apply the display range to records before before and after the
|
1083
|
-
* current viewport - i.e. a factor of 3 will allow Scroller to pre-fetch 1 viewport's worth
|
1084
|
-
* of rows before the current viewport, the current viewport's rows and 1 viewport's worth
|
1085
|
-
* of rows after the current viewport. Adjusting this value can be useful for ensuring
|
1086
|
-
* smooth scrolling based on your data set.
|
1087
|
-
* @type int
|
1088
|
-
* @default 7
|
1089
|
-
* @static
|
1090
|
-
* @example
|
1091
|
-
* var oTable = $('#example').dataTable( {
|
1092
|
-
* "sScrollY": "200px",
|
1093
|
-
* "sDom": "frtiS",
|
1094
|
-
* "bDeferRender": true,
|
1095
|
-
* "oScroller": {
|
1096
|
-
* "displayBuffer": 10
|
1097
|
-
* }
|
1098
|
-
* } );
|
1099
|
-
*/
|
1100
|
-
"displayBuffer": 9,
|
1101
|
-
|
1102
|
-
/**
|
1103
|
-
* Scroller uses the boundary scaling factor to decide when to redraw the table - which it
|
1104
|
-
* typically does before you reach the end of the currently loaded data set (in order to
|
1105
|
-
* allow the data to look continuous to a user scrolling through the data). If given as 0
|
1106
|
-
* then the table will be redrawn whenever the viewport is scrolled, while 1 would not
|
1107
|
-
* redraw the table until the currently loaded data has all been shown. You will want
|
1108
|
-
* something in the middle - the default factor of 0.5 is usually suitable.
|
1109
|
-
* @type float
|
1110
|
-
* @default 0.5
|
1111
|
-
* @static
|
1112
|
-
* @example
|
1113
|
-
* var oTable = $('#example').dataTable( {
|
1114
|
-
* "sScrollY": "200px",
|
1115
|
-
* "sDom": "frtiS",
|
1116
|
-
* "bDeferRender": true,
|
1117
|
-
* "oScroller": {
|
1118
|
-
* "boundaryScale": 0.75
|
1119
|
-
* }
|
1120
|
-
* } );
|
1121
|
-
*/
|
1122
|
-
"boundaryScale": 0.5,
|
1123
|
-
|
1124
|
-
/**
|
1125
|
-
* Show (or not) the loading element in the background of the table. Note that you should
|
1126
|
-
* include the dataTables.scroller.css file for this to be displayed correctly.
|
1127
|
-
* @type boolean
|
1128
|
-
* @default false
|
1129
|
-
* @static
|
1130
|
-
* @example
|
1131
|
-
* var oTable = $('#example').dataTable( {
|
1132
|
-
* "sScrollY": "200px",
|
1133
|
-
* "sDom": "frtiS",
|
1134
|
-
* "bDeferRender": true,
|
1135
|
-
* "oScroller": {
|
1136
|
-
* "loadingIndicator": true
|
1137
|
-
* }
|
1138
|
-
* } );
|
1139
|
-
*/
|
1140
|
-
"loadingIndicator": false
|
1141
|
-
};
|
1142
|
-
|
1143
|
-
Scroller.oDefaults = Scroller.defaults;
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
1148
|
-
* Constants
|
1149
|
-
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
1150
|
-
|
1151
|
-
/**
|
1152
|
-
* Scroller version
|
1153
|
-
* @type String
|
1154
|
-
* @default See code
|
1155
|
-
* @name Scroller.version
|
1156
|
-
* @static
|
1157
|
-
*/
|
1158
|
-
Scroller.version = "1.2.2";
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
1163
|
-
* Initialisation
|
1164
|
-
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
1165
|
-
|
1166
|
-
/*
|
1167
|
-
* Register a new feature with DataTables
|
1168
|
-
*/
|
1169
|
-
if ( typeof $.fn.dataTable == "function" &&
|
1170
|
-
typeof $.fn.dataTableExt.fnVersionCheck == "function" &&
|
1171
|
-
$.fn.dataTableExt.fnVersionCheck('1.9.0') )
|
1172
|
-
{
|
1173
|
-
$.fn.dataTableExt.aoFeatures.push( {
|
1174
|
-
"fnInit": function( oDTSettings ) {
|
1175
|
-
var init = oDTSettings.oInit;
|
1176
|
-
var opts = init.scroller || init.oScroller || {};
|
1177
|
-
var oScroller = new Scroller( oDTSettings, opts );
|
1178
|
-
return oScroller.dom.wrapper;
|
1179
|
-
},
|
1180
|
-
"cFeature": "S",
|
1181
|
-
"sFeature": "Scroller"
|
1182
|
-
} );
|
1183
|
-
}
|
1184
|
-
else
|
1185
|
-
{
|
1186
|
-
alert( "Warning: Scroller requires DataTables 1.9.0 or greater - www.datatables.net/download");
|
1187
|
-
}
|
1188
|
-
|
1189
|
-
|
1190
|
-
// Attach Scroller to DataTables so it can be accessed as an 'extra'
|
1191
|
-
$.fn.dataTable.Scroller = Scroller;
|
1192
|
-
$.fn.DataTable.Scroller = Scroller;
|
1193
|
-
|
1194
|
-
|
1195
|
-
// DataTables 1.10 API method aliases
|
1196
|
-
if ( $.fn.dataTable.Api ) {
|
1197
|
-
var Api = $.fn.dataTable.Api;
|
1198
|
-
|
1199
|
-
Api.register( 'scroller()', function () {
|
1200
|
-
return this;
|
1201
|
-
} );
|
1202
|
-
|
1203
|
-
Api.register( 'scroller().rowToPixels()', function ( rowIdx, intParse, virtual ) {
|
1204
|
-
var ctx = this.context;
|
1205
|
-
|
1206
|
-
if ( ctx.length && ctx[0].oScroller ) {
|
1207
|
-
return ctx[0].oScroller.fnRowToPixels( rowIdx, intParse, virtual );
|
1208
|
-
}
|
1209
|
-
// undefined
|
1210
|
-
} );
|
1211
|
-
|
1212
|
-
Api.register( 'scroller().pixelsToRow()', function ( pixels, intParse, virtual ) {
|
1213
|
-
var ctx = this.context;
|
1214
|
-
|
1215
|
-
if ( ctx.length && ctx[0].oScroller ) {
|
1216
|
-
return ctx[0].oScroller.fnPixelsToRow( pixels, intParse, virtual );
|
1217
|
-
}
|
1218
|
-
// undefined
|
1219
|
-
} );
|
1220
|
-
|
1221
|
-
Api.register( 'scroller().scrollToRow()', function ( row, ani ) {
|
1222
|
-
this.iterator( 'table', function ( ctx ) {
|
1223
|
-
if ( ctx.oScroller ) {
|
1224
|
-
ctx.oScroller.fnScrollToRow( row, ani );
|
1225
|
-
}
|
1226
|
-
} );
|
1227
|
-
|
1228
|
-
return this;
|
1229
|
-
} );
|
1230
|
-
|
1231
|
-
Api.register( 'scroller().measure()', function ( redraw ) {
|
1232
|
-
this.iterator( 'table', function ( ctx ) {
|
1233
|
-
if ( ctx.oScroller ) {
|
1234
|
-
ctx.oScroller.fnMeasure( redraw );
|
1235
|
-
}
|
1236
|
-
} );
|
1237
|
-
|
1238
|
-
return this;
|
1239
|
-
} );
|
1240
|
-
}
|
1241
|
-
|
1242
|
-
|
1243
|
-
return Scroller;
|
1244
|
-
}; // /factory
|
1245
|
-
|
1246
|
-
|
1247
|
-
// Define as an AMD module if possible
|
1248
|
-
if ( typeof define === 'function' && define.amd ) {
|
1249
|
-
define( ['jquery', 'datatables'], factory );
|
1250
|
-
}
|
1251
|
-
else if ( typeof exports === 'object' ) {
|
1252
|
-
// Node/CommonJS
|
1253
|
-
factory( require('jquery'), require('datatables') );
|
1254
|
-
}
|
1255
|
-
else if ( jQuery && !jQuery.fn.dataTable.Scroller ) {
|
1256
|
-
// Otherwise simply initialise as normal, stopping multiple evaluation
|
1257
|
-
factory( jQuery, jQuery.fn.dataTable );
|
1258
|
-
}
|
1259
|
-
|
1260
|
-
|
1261
|
-
})(window, document);
|
1262
|
-
|