[ARVADOS] updated: 9f0705911d360e6a4bec7703ce9fb6631144c13e
Git user
git at public.curoverse.com
Mon Aug 14 15:26:52 EDT 2017
Summary of changes:
.../app/assets/javascripts/components/collections.js | 17 ++++++++---------
.../workbench/app/assets/javascripts/components/date.js | 3 +--
.../components/{save_state.js => save_ui_state.js} | 3 +--
.../app/assets/javascripts/components/sessions.js | 7 +++----
.../workbench/app/assets/javascripts/components/test.js | 3 +--
apps/workbench/app/assets/javascripts/mithril_mount.js | 2 +-
apps/workbench/app/assets/javascripts/models/loader.js | 6 ++----
.../app/assets/javascripts/models/session_db.js | 3 +--
apps/workbench/app/views/collections/multisite.html | 2 +-
apps/workbench/app/views/sessions/index.html | 2 +-
apps/workbench/app/views/tests/mithril.html | 2 +-
11 files changed, 21 insertions(+), 29 deletions(-)
rename apps/workbench/app/assets/javascripts/components/{save_state.js => save_ui_state.js} (95%)
via 9f0705911d360e6a4bec7703ce9fb6631144c13e (commit)
from 35568d227889ca85026c647d57144fee1306bc87 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 9f0705911d360e6a4bec7703ce9fb6631144c13e
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Aug 14 15:23:46 2017 -0400
12033: Move classes to global namespace.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curoverse.com>
diff --git a/apps/workbench/app/assets/javascripts/components/collections.js b/apps/workbench/app/assets/javascripts/components/collections.js
index fad7e74..d65354f 100644
--- a/apps/workbench/app/assets/javascripts/components/collections.js
+++ b/apps/workbench/app/assets/javascripts/components/collections.js
@@ -2,8 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-window.components = window.components || {}
-window.components.collection_table = {
+window.CollectionsTable = {
maybeLoadMore: function(dom) {
var loader = this.loader
if (loader.done || loader.loading)
@@ -50,7 +49,7 @@ window.components.collection_table = {
m('td', m('a.btn.btn-xs.btn-default', {href: item.session.baseURL.replace('://', '://workbench.')+'collections/'+item.uuid}, 'Show')),
m('td.arvados-uuid', item.uuid),
m('td', item.name || '(unnamed)'),
- m('td', m(window.components.datetime, {parse: item.modified_at})),
+ m('td', m(LocalizedDateTime, {parse: item.modified_at})),
])
}),
]),
@@ -74,9 +73,9 @@ window.components.collection_table = {
},
}
-window.components.collection_search = {
+window.CollectionsSearch = {
oninit: function(vnode) {
- vnode.state.sessionDB = new window.models.SessionDB()
+ vnode.state.sessionDB = new SessionDB()
vnode.state.searchEntered = m.stream()
vnode.state.searchActive = m.stream()
// When searchActive changes (e.g., when restoring state
@@ -86,10 +85,10 @@ window.components.collection_search = {
// with the given search term.
vnode.state.searchActive.map(function(q) {
var sessions = vnode.state.sessionDB.loadActive()
- vnode.state.loader = new window.models.MergingLoader({
+ vnode.state.loader = new MergingLoader({
children: Object.keys(sessions).map(function(key) {
var session = sessions[key]
- return new window.models.MultipageLoader({
+ return new MultipageLoader({
loadFunc: function(filters) {
if (q)
filters.push(['any', '@@', q+':*'])
@@ -119,7 +118,7 @@ window.components.collection_search = {
return false
},
}, [
- m(window.components.save_state, {
+ m(SaveUIState, {
defaultState: '',
currentState: vnode.state.searchActive,
forgetSavedState: vnode.state.forgetSavedState,
@@ -153,7 +152,7 @@ window.components.collection_search = {
m('a[href="/sessions"]', 'Add/remove sites'),
]),
]),
- m(window.components.collection_table, {
+ m(CollectionsTable, {
loader: vnode.state.loader,
}),
],
diff --git a/apps/workbench/app/assets/javascripts/components/date.js b/apps/workbench/app/assets/javascripts/components/date.js
index c3c905a..62eacc3 100644
--- a/apps/workbench/app/assets/javascripts/components/date.js
+++ b/apps/workbench/app/assets/javascripts/components/date.js
@@ -2,8 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-window.components = window.components || {}
-window.components.datetime = {
+window.LocalizedDateTime = {
view: function(vnode) {
return m('span', new Date(Date.parse(vnode.attrs.parse)).toLocaleString())
},
diff --git a/apps/workbench/app/assets/javascripts/components/save_state.js b/apps/workbench/app/assets/javascripts/components/save_ui_state.js
similarity index 95%
rename from apps/workbench/app/assets/javascripts/components/save_state.js
rename to apps/workbench/app/assets/javascripts/components/save_ui_state.js
index 021f7ff..b24aef3 100644
--- a/apps/workbench/app/assets/javascripts/components/save_state.js
+++ b/apps/workbench/app/assets/javascripts/components/save_ui_state.js
@@ -2,8 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-window.components = window.components || {}
-window.components.save_state = {
+window.SaveUIState = {
saveState: function() {
var state = history.state || {}
state.bodyHeight = window.getComputedStyle(document.body)['height']
diff --git a/apps/workbench/app/assets/javascripts/components/sessions.js b/apps/workbench/app/assets/javascripts/components/sessions.js
index 97af8b2..17c144c 100644
--- a/apps/workbench/app/assets/javascripts/components/sessions.js
+++ b/apps/workbench/app/assets/javascripts/components/sessions.js
@@ -3,15 +3,14 @@
// SPDX-License-Identifier: AGPL-3.0
$(document).on('ready', function() {
- var db = new window.models.SessionDB()
+ var db = new SessionDB()
db.checkForNewToken()
db.fillMissingUUIDs()
})
-window.components = window.components || {}
-window.components.sessions = {
+window.SessionsTable = {
oninit: function(vnode) {
- vnode.state.db = new window.models.SessionDB()
+ vnode.state.db = new SessionDB()
vnode.state.hostToAdd = m.stream('')
},
view: function(vnode) {
diff --git a/apps/workbench/app/assets/javascripts/components/test.js b/apps/workbench/app/assets/javascripts/components/test.js
index 809c6d7..4893544 100644
--- a/apps/workbench/app/assets/javascripts/components/test.js
+++ b/apps/workbench/app/assets/javascripts/components/test.js
@@ -2,8 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-window.components = window.components || {}
-window.components.test = {
+window.TestComponent = {
view: function(vnode) {
return m('div.mithril-test-component', [
m('p', {
diff --git a/apps/workbench/app/assets/javascripts/mithril_mount.js b/apps/workbench/app/assets/javascripts/mithril_mount.js
index 4a85a09..f4689b5 100644
--- a/apps/workbench/app/assets/javascripts/mithril_mount.js
+++ b/apps/workbench/app/assets/javascripts/mithril_mount.js
@@ -4,6 +4,6 @@
$(document).on('ready arv:pane:loaded', function() {
$('[data-mount-mithril]').each(function() {
- m.mount(this, window.components[$(this).data('mount-mithril')])
+ m.mount(this, window[$(this).data('mount-mithril')])
})
})
diff --git a/apps/workbench/app/assets/javascripts/models/loader.js b/apps/workbench/app/assets/javascripts/models/loader.js
index 93e193b..1b44670 100644
--- a/apps/workbench/app/assets/javascripts/models/loader.js
+++ b/apps/workbench/app/assets/javascripts/models/loader.js
@@ -17,8 +17,7 @@
// items is a stream that resolves to an array of all items retrieved so far.
//
// loadMore() loads the next page, if any.
-window.models = window.models || {}
-window.models.MultipageLoader = function(config) {
+window.MultipageLoader = function(config) {
var loader = this
Object.assign(loader, config, {
done: false,
@@ -57,8 +56,7 @@ window.models.MultipageLoader = function(config) {
// new MergingLoader({children: [loader, loader, ...]})
//
// The children must retrieve results in "modified_at desc" order.
-window.models = window.models || {}
-window.models.MergingLoader = function(config) {
+window.MergingLoader = function(config) {
var loader = this
Object.assign(loader, config, {
// Sorted items ready to display, merged from all children.
diff --git a/apps/workbench/app/assets/javascripts/models/session_db.js b/apps/workbench/app/assets/javascripts/models/session_db.js
index b64481e..1ebff83 100644
--- a/apps/workbench/app/assets/javascripts/models/session_db.js
+++ b/apps/workbench/app/assets/javascripts/models/session_db.js
@@ -2,8 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-window.models = window.models || {}
-window.models.SessionDB = function() {
+window.SessionDB = function() {
var db = this
Object.assign(db, {
loadFromLocalStorage: function() {
diff --git a/apps/workbench/app/views/collections/multisite.html b/apps/workbench/app/views/collections/multisite.html
index 7e49ac9..9b03f10 100644
--- a/apps/workbench/app/views/collections/multisite.html
+++ b/apps/workbench/app/views/collections/multisite.html
@@ -2,4 +2,4 @@
SPDX-License-Identifier: AGPL-3.0 -->
-<div data-mount-mithril="collection_search"></div>
+<div data-mount-mithril="CollectionsSearch"></div>
diff --git a/apps/workbench/app/views/sessions/index.html b/apps/workbench/app/views/sessions/index.html
index ddfa8dd..bf23028 100644
--- a/apps/workbench/app/views/sessions/index.html
+++ b/apps/workbench/app/views/sessions/index.html
@@ -2,4 +2,4 @@
SPDX-License-Identifier: AGPL-3.0 -->
-<div data-mount-mithril="sessions"></div>
+<div data-mount-mithril="SessionsTable"></div>
diff --git a/apps/workbench/app/views/tests/mithril.html b/apps/workbench/app/views/tests/mithril.html
index 4936f12..a629eb7 100644
--- a/apps/workbench/app/views/tests/mithril.html
+++ b/apps/workbench/app/views/tests/mithril.html
@@ -1 +1 @@
-<div data-mount-mithril="test"></div>
+<div data-mount-mithril="TestComponent"></div>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list