From be796682b60870890443b10e3bfb811c5fd22545 Mon Sep 17 00:00:00 2001 From: Martin Hunt Date: Mon, 4 Feb 2013 14:21:25 -0800 Subject: [PATCH 1/6] move support links into left side-bar add docs iframe fix some JS errors with upgrade script --- src/serve/plugins/about/manifest.json | 2 +- src/serve/plugins/about/plugin.js | 1 - src/serve/plugins/about/static/Pane.js | 25 +++----- src/serve/plugins/art/manifest.json | 2 +- src/serve/plugins/documentation/manifest.json | 6 ++ src/serve/plugins/documentation/plugin.js | 20 +++++++ .../plugins/documentation/static/Pane.js | 38 ++++++++++++ src/serve/plugins/native/manifest.json | 2 +- src/serve/plugins/projects/manifest.json | 2 +- src/serve/plugins/support/manifest.json | 6 ++ src/serve/plugins/support/plugin.js | 20 +++++++ src/serve/plugins/support/static/Pane.js | 60 +++++++++++++++++++ src/serve/plugins/support/static/support.styl | 9 +++ src/serve/public/Overview.js | 14 ++--- src/serve/stylesheets/plugins.styl | 1 + src/shared/Version.js | 4 +- 16 files changed, 181 insertions(+), 31 deletions(-) create mode 100644 src/serve/plugins/documentation/manifest.json create mode 100644 src/serve/plugins/documentation/plugin.js create mode 100644 src/serve/plugins/documentation/static/Pane.js create mode 100644 src/serve/plugins/support/manifest.json create mode 100644 src/serve/plugins/support/plugin.js create mode 100644 src/serve/plugins/support/static/Pane.js create mode 100644 src/serve/plugins/support/static/support.styl diff --git a/src/serve/plugins/about/manifest.json b/src/serve/plugins/about/manifest.json index 2583d828..b06401d7 100644 --- a/src/serve/plugins/about/manifest.json +++ b/src/serve/plugins/about/manifest.json @@ -2,5 +2,5 @@ "version": "0.1.0", "author": "Game Closure", "name": "About", - "scope": "main" + "scope": "footer" } \ No newline at end of file diff --git a/src/serve/plugins/about/plugin.js b/src/serve/plugins/about/plugin.js index 43c14f27..e25fe15b 100644 --- a/src/serve/plugins/about/plugin.js +++ b/src/serve/plugins/about/plugin.js @@ -76,7 +76,6 @@ exports.load = function (app) { res.json({ info: { lastChecked: lastChecked, - isDev: true, version: version }, tags: tagData diff --git a/src/serve/plugins/about/static/Pane.js b/src/serve/plugins/about/static/Pane.js index e4a0f9ad..3f56a3c3 100644 --- a/src/serve/plugins/about/static/Pane.js +++ b/src/serve/plugins/about/static/Pane.js @@ -55,7 +55,7 @@ var VersionCell = Class(squill.Cell, function(supr) { }; }); -var versionData = new squill.models.DataSource({key: 'tag'}); +var versionData = new squill.models.DataSource({key: 'src'}); exports = Class(sdkPlugin.SDKPlugin, function(supr) { this._def = { @@ -77,13 +77,6 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { ]}, ]}, ]}, - - { - className: 'support mainPanel', - title: 'support', - id: 'support' - }, - {className: 'mainPanel', title: 'versions', children: [ {id: 'versionHeader', children: [{tag: 'span', text: 'current version: '}, {tag: 'span', id: 'aboutVersion'}]}, {id: 'versionWrapper', className: 'darkPanel', children: [ @@ -106,7 +99,6 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { }); this.onSwitchVersion = function(version) { - this.hideMore(); $.setText(this.lastCheckedStatus, 'Updating... Please wait.'); util.ajax.get({ url: '/plugins/about/update/', @@ -127,14 +119,6 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { this.getVersions(); this.versions.subscribe('Switch', this, 'onSwitchVersion'); - - this.support._el.innerHTML = ''; }; this.getVersions = function() { @@ -148,6 +132,7 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { if (!response) { return; } + var lastChecked = response.info ? response.info.lastChecked : -1; if (lastChecked == -1) { $.setText(this.lastCheckedStatus, 'checking for updates...'); @@ -178,7 +163,11 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { if (!currentVersion) { verStr = 'Version Unknown'; } else { - verStr = 'Version ' + currentVersion.tag.replace(/-/g, ' '); + if (currentVersion.channel == 'release') { + verStr = 'Version ' + currentVersion.toString(true); // don't show channel + } else { + verStr = 'Version ' + currentVersion.toString(); + } } $.setText(this.version, verStr); diff --git a/src/serve/plugins/art/manifest.json b/src/serve/plugins/art/manifest.json index 7f7a5cea..3596b011 100644 --- a/src/serve/plugins/art/manifest.json +++ b/src/serve/plugins/art/manifest.json @@ -2,5 +2,5 @@ "version": "0.1.0", "author": "Game Closure", "name": "Art Editor", - "scope": "tools" + "scope": "project" } \ No newline at end of file diff --git a/src/serve/plugins/documentation/manifest.json b/src/serve/plugins/documentation/manifest.json new file mode 100644 index 00000000..3348d0b9 --- /dev/null +++ b/src/serve/plugins/documentation/manifest.json @@ -0,0 +1,6 @@ +{ + "version": "0.1.0", + "author": "Game Closure", + "name": "Documentation", + "scope": "footer" +} \ No newline at end of file diff --git a/src/serve/plugins/documentation/plugin.js b/src/serve/plugins/documentation/plugin.js new file mode 100644 index 00000000..a279b642 --- /dev/null +++ b/src/serve/plugins/documentation/plugin.js @@ -0,0 +1,20 @@ +/* @license + * This file is part of the Game Closure SDK. + * + * The Game Closure SDK is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * The Game Closure SDK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with the Game Closure SDK. If not, see . + */ + +exports.load = function (app) { + +}; diff --git a/src/serve/plugins/documentation/static/Pane.js b/src/serve/plugins/documentation/static/Pane.js new file mode 100644 index 00000000..4b99281f --- /dev/null +++ b/src/serve/plugins/documentation/static/Pane.js @@ -0,0 +1,38 @@ +/* @license + * This file is part of the Game Closure SDK. + * + * The Game Closure SDK is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * The Game Closure SDK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with the Game Closure SDK. If not, see . + */ + +import ....sdkPlugin; +import shared.Version as Version; +import util.ajax; +import string.timeAgo; + +import squill.TabbedPane; +import squill.Delegate; +import squill.models.DataSource; +import squill.Cell; + +from util.browser import $; + +exports = Class(sdkPlugin.SDKPlugin, function(supr) { + this._def = { + id: 'aboutPane', + style: {overflow: 'hidden'}, + children: [ + {tag: 'iframe', src: '//docs.gameclosure.com', style: {border: 0, width: '100%', height: '100%'}} + ] + }; +}); diff --git a/src/serve/plugins/native/manifest.json b/src/serve/plugins/native/manifest.json index aeefd969..704c3ddc 100644 --- a/src/serve/plugins/native/manifest.json +++ b/src/serve/plugins/native/manifest.json @@ -2,5 +2,5 @@ "version": "0.2.0", "author": "Game Closure", "name": "Remote Debug", - "scope": "inspectors" + "scope": "debug" } diff --git a/src/serve/plugins/projects/manifest.json b/src/serve/plugins/projects/manifest.json index 4a90d44e..233cb4cd 100644 --- a/src/serve/plugins/projects/manifest.json +++ b/src/serve/plugins/projects/manifest.json @@ -2,5 +2,5 @@ "version": "0.1.0", "author": "Game Closure", "name": "Projects", - "scope": "main" + "scope": "header" } \ No newline at end of file diff --git a/src/serve/plugins/support/manifest.json b/src/serve/plugins/support/manifest.json new file mode 100644 index 00000000..766a39c5 --- /dev/null +++ b/src/serve/plugins/support/manifest.json @@ -0,0 +1,6 @@ +{ + "version": "0.1.0", + "author": "Game Closure", + "name": "Support", + "scope": "footer" +} \ No newline at end of file diff --git a/src/serve/plugins/support/plugin.js b/src/serve/plugins/support/plugin.js new file mode 100644 index 00000000..a279b642 --- /dev/null +++ b/src/serve/plugins/support/plugin.js @@ -0,0 +1,20 @@ +/* @license + * This file is part of the Game Closure SDK. + * + * The Game Closure SDK is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * The Game Closure SDK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with the Game Closure SDK. If not, see . + */ + +exports.load = function (app) { + +}; diff --git a/src/serve/plugins/support/static/Pane.js b/src/serve/plugins/support/static/Pane.js new file mode 100644 index 00000000..4be845f7 --- /dev/null +++ b/src/serve/plugins/support/static/Pane.js @@ -0,0 +1,60 @@ +/* @license + * This file is part of the Game Closure SDK. + * + * The Game Closure SDK is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * The Game Closure SDK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with the Game Closure SDK. If not, see . + */ + +import ....sdkPlugin; +import shared.Version as Version; +import util.ajax; +import string.timeAgo; + +import squill.TabbedPane; +import squill.Delegate; +import squill.models.DataSource; +import squill.Cell; + +from util.browser import $; + +exports = Class(sdkPlugin.SDKPlugin, function(supr) { + this._def = { + id: 'aboutPane', + children: [ + { + tag: 'a', + attrs: {href: 'https://gcsdk.zendesk.com/forums', target: '_blank'}, + className: 'supportLink', + text: 'forums' + }, + { + tag: 'a', + attrs: {href: 'https://groups.google.com/forum/?fromgroups=#!forum/gameclosure', target: '_blank'}, + className: 'supportLink', + text: 'mailing list' + }, + { + tag: 'a', + attrs: {href: 'http://webchat.freenode.net/?channels=#gameclosure', target: '_blank'}, + className: 'supportLink', + text: 'IRC' + }, + { + tag: 'a', + attrs: {href: 'mailto:support@gameclosure.com'}, + className: 'supportLink', + text: 'support@gameclosure.com' + } + ] + }; +}); diff --git a/src/serve/plugins/support/static/support.styl b/src/serve/plugins/support/static/support.styl new file mode 100644 index 00000000..d13cd2f0 --- /dev/null +++ b/src/serve/plugins/support/static/support.styl @@ -0,0 +1,9 @@ +.supportLink + border-radius 10px + padding 20px 40px + background rgba(0, 0, 0, 0.2) + margin 20px + border 1px solid rgba(0, 0, 0, 0.3) + float left + color #226 + text-decoration none \ No newline at end of file diff --git a/src/serve/public/Overview.js b/src/serve/public/Overview.js index 17138b02..dde5f1b6 100644 --- a/src/serve/public/Overview.js +++ b/src/serve/public/Overview.js @@ -33,8 +33,10 @@ import util.ajax; var PluginGroup = Class(function() { var PRIORITIES = { header: 'a', - project: 'b', - debug: 'c' + main: 'b', + project: 'c', + debug: 'd', + footer: 'z' }; var DEFAULT_PRIORITY = 'z'; @@ -44,7 +46,7 @@ var PluginGroup = Class(function() { this.priority = PRIORITIES[name] || DEFAULT_PRIORITY; }; - this.add = function(plugin) { this.plugins.push(plugin); }; + this.add = function(plugin) { this.plugins.push(plugin); console.log(plugin, this.priority); }; this.toString = function() { return this.priority; }; }); @@ -229,8 +231,7 @@ exports = Class(squill.TabbedPane, function(supr) { // sort the plugins by group var groups = []; - plugins.forEach( - function(plugin) { + plugins.forEach(function(plugin) { var group = groups[plugin.group]; if (!group) { group = new PluginGroup(plugin.group); @@ -239,8 +240,7 @@ exports = Class(squill.TabbedPane, function(supr) { } group.add(plugin); - } - ); + }); groups.sort(); diff --git a/src/serve/stylesheets/plugins.styl b/src/serve/stylesheets/plugins.styl index 3d3ec1fd..914b980c 100644 --- a/src/serve/stylesheets/plugins.styl +++ b/src/serve/stylesheets/plugins.styl @@ -1,4 +1,5 @@ @import "about/static/about.styl" +@import "support/static/support.styl" @import "art/static/art.styl" @import "native/static/native.styl" @import "projects/static/projects.styl" diff --git a/src/shared/Version.js b/src/shared/Version.js index 8e4efefb..d538272a 100644 --- a/src/shared/Version.js +++ b/src/shared/Version.js @@ -43,6 +43,8 @@ var Version = Class(function () { this.build = opts.build || 0; this.tag = opts.tag || ''; + + this.src = this.toString(); }; this.getNext = function (which) { @@ -208,7 +210,7 @@ Version.sorterDesc = function (a, b) { }; if(module && module.children) { - module.exports = Version; + module.exports = Version; } else { exports = Version; } From de71cf0419b6d85a73b2b50b22111781ad2ee915 Mon Sep 17 00:00:00 2001 From: Martin Hunt Date: Mon, 4 Feb 2013 14:21:25 -0800 Subject: [PATCH 2/6] move support links into left side-bar add docs iframe fix some JS errors with upgrade script --- src/serve/plugins/about/manifest.json | 2 +- src/serve/plugins/about/plugin.js | 1 - src/serve/plugins/about/static/Pane.js | 25 +++----- src/serve/plugins/art/manifest.json | 2 +- src/serve/plugins/documentation/manifest.json | 6 ++ src/serve/plugins/documentation/plugin.js | 20 +++++++ .../plugins/documentation/static/Pane.js | 38 ++++++++++++ src/serve/plugins/native/manifest.json | 2 +- src/serve/plugins/projects/manifest.json | 2 +- src/serve/plugins/support/manifest.json | 6 ++ src/serve/plugins/support/plugin.js | 20 +++++++ src/serve/plugins/support/static/Pane.js | 60 +++++++++++++++++++ src/serve/plugins/support/static/support.styl | 9 +++ src/serve/public/Overview.js | 14 ++--- src/serve/stylesheets/plugins.styl | 1 + src/shared/Version.js | 4 +- 16 files changed, 181 insertions(+), 31 deletions(-) create mode 100644 src/serve/plugins/documentation/manifest.json create mode 100644 src/serve/plugins/documentation/plugin.js create mode 100644 src/serve/plugins/documentation/static/Pane.js create mode 100644 src/serve/plugins/support/manifest.json create mode 100644 src/serve/plugins/support/plugin.js create mode 100644 src/serve/plugins/support/static/Pane.js create mode 100644 src/serve/plugins/support/static/support.styl diff --git a/src/serve/plugins/about/manifest.json b/src/serve/plugins/about/manifest.json index 2583d828..b06401d7 100644 --- a/src/serve/plugins/about/manifest.json +++ b/src/serve/plugins/about/manifest.json @@ -2,5 +2,5 @@ "version": "0.1.0", "author": "Game Closure", "name": "About", - "scope": "main" + "scope": "footer" } \ No newline at end of file diff --git a/src/serve/plugins/about/plugin.js b/src/serve/plugins/about/plugin.js index 43c14f27..e25fe15b 100644 --- a/src/serve/plugins/about/plugin.js +++ b/src/serve/plugins/about/plugin.js @@ -76,7 +76,6 @@ exports.load = function (app) { res.json({ info: { lastChecked: lastChecked, - isDev: true, version: version }, tags: tagData diff --git a/src/serve/plugins/about/static/Pane.js b/src/serve/plugins/about/static/Pane.js index e4a0f9ad..3f56a3c3 100644 --- a/src/serve/plugins/about/static/Pane.js +++ b/src/serve/plugins/about/static/Pane.js @@ -55,7 +55,7 @@ var VersionCell = Class(squill.Cell, function(supr) { }; }); -var versionData = new squill.models.DataSource({key: 'tag'}); +var versionData = new squill.models.DataSource({key: 'src'}); exports = Class(sdkPlugin.SDKPlugin, function(supr) { this._def = { @@ -77,13 +77,6 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { ]}, ]}, ]}, - - { - className: 'support mainPanel', - title: 'support', - id: 'support' - }, - {className: 'mainPanel', title: 'versions', children: [ {id: 'versionHeader', children: [{tag: 'span', text: 'current version: '}, {tag: 'span', id: 'aboutVersion'}]}, {id: 'versionWrapper', className: 'darkPanel', children: [ @@ -106,7 +99,6 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { }); this.onSwitchVersion = function(version) { - this.hideMore(); $.setText(this.lastCheckedStatus, 'Updating... Please wait.'); util.ajax.get({ url: '/plugins/about/update/', @@ -127,14 +119,6 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { this.getVersions(); this.versions.subscribe('Switch', this, 'onSwitchVersion'); - - this.support._el.innerHTML = ''; }; this.getVersions = function() { @@ -148,6 +132,7 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { if (!response) { return; } + var lastChecked = response.info ? response.info.lastChecked : -1; if (lastChecked == -1) { $.setText(this.lastCheckedStatus, 'checking for updates...'); @@ -178,7 +163,11 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { if (!currentVersion) { verStr = 'Version Unknown'; } else { - verStr = 'Version ' + currentVersion.tag.replace(/-/g, ' '); + if (currentVersion.channel == 'release') { + verStr = 'Version ' + currentVersion.toString(true); // don't show channel + } else { + verStr = 'Version ' + currentVersion.toString(); + } } $.setText(this.version, verStr); diff --git a/src/serve/plugins/art/manifest.json b/src/serve/plugins/art/manifest.json index 7f7a5cea..3596b011 100644 --- a/src/serve/plugins/art/manifest.json +++ b/src/serve/plugins/art/manifest.json @@ -2,5 +2,5 @@ "version": "0.1.0", "author": "Game Closure", "name": "Art Editor", - "scope": "tools" + "scope": "project" } \ No newline at end of file diff --git a/src/serve/plugins/documentation/manifest.json b/src/serve/plugins/documentation/manifest.json new file mode 100644 index 00000000..3348d0b9 --- /dev/null +++ b/src/serve/plugins/documentation/manifest.json @@ -0,0 +1,6 @@ +{ + "version": "0.1.0", + "author": "Game Closure", + "name": "Documentation", + "scope": "footer" +} \ No newline at end of file diff --git a/src/serve/plugins/documentation/plugin.js b/src/serve/plugins/documentation/plugin.js new file mode 100644 index 00000000..a279b642 --- /dev/null +++ b/src/serve/plugins/documentation/plugin.js @@ -0,0 +1,20 @@ +/* @license + * This file is part of the Game Closure SDK. + * + * The Game Closure SDK is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * The Game Closure SDK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with the Game Closure SDK. If not, see . + */ + +exports.load = function (app) { + +}; diff --git a/src/serve/plugins/documentation/static/Pane.js b/src/serve/plugins/documentation/static/Pane.js new file mode 100644 index 00000000..4b99281f --- /dev/null +++ b/src/serve/plugins/documentation/static/Pane.js @@ -0,0 +1,38 @@ +/* @license + * This file is part of the Game Closure SDK. + * + * The Game Closure SDK is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * The Game Closure SDK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with the Game Closure SDK. If not, see . + */ + +import ....sdkPlugin; +import shared.Version as Version; +import util.ajax; +import string.timeAgo; + +import squill.TabbedPane; +import squill.Delegate; +import squill.models.DataSource; +import squill.Cell; + +from util.browser import $; + +exports = Class(sdkPlugin.SDKPlugin, function(supr) { + this._def = { + id: 'aboutPane', + style: {overflow: 'hidden'}, + children: [ + {tag: 'iframe', src: '//docs.gameclosure.com', style: {border: 0, width: '100%', height: '100%'}} + ] + }; +}); diff --git a/src/serve/plugins/native/manifest.json b/src/serve/plugins/native/manifest.json index aeefd969..704c3ddc 100644 --- a/src/serve/plugins/native/manifest.json +++ b/src/serve/plugins/native/manifest.json @@ -2,5 +2,5 @@ "version": "0.2.0", "author": "Game Closure", "name": "Remote Debug", - "scope": "inspectors" + "scope": "debug" } diff --git a/src/serve/plugins/projects/manifest.json b/src/serve/plugins/projects/manifest.json index 4a90d44e..233cb4cd 100644 --- a/src/serve/plugins/projects/manifest.json +++ b/src/serve/plugins/projects/manifest.json @@ -2,5 +2,5 @@ "version": "0.1.0", "author": "Game Closure", "name": "Projects", - "scope": "main" + "scope": "header" } \ No newline at end of file diff --git a/src/serve/plugins/support/manifest.json b/src/serve/plugins/support/manifest.json new file mode 100644 index 00000000..766a39c5 --- /dev/null +++ b/src/serve/plugins/support/manifest.json @@ -0,0 +1,6 @@ +{ + "version": "0.1.0", + "author": "Game Closure", + "name": "Support", + "scope": "footer" +} \ No newline at end of file diff --git a/src/serve/plugins/support/plugin.js b/src/serve/plugins/support/plugin.js new file mode 100644 index 00000000..a279b642 --- /dev/null +++ b/src/serve/plugins/support/plugin.js @@ -0,0 +1,20 @@ +/* @license + * This file is part of the Game Closure SDK. + * + * The Game Closure SDK is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * The Game Closure SDK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with the Game Closure SDK. If not, see . + */ + +exports.load = function (app) { + +}; diff --git a/src/serve/plugins/support/static/Pane.js b/src/serve/plugins/support/static/Pane.js new file mode 100644 index 00000000..4be845f7 --- /dev/null +++ b/src/serve/plugins/support/static/Pane.js @@ -0,0 +1,60 @@ +/* @license + * This file is part of the Game Closure SDK. + * + * The Game Closure SDK is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * The Game Closure SDK is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with the Game Closure SDK. If not, see . + */ + +import ....sdkPlugin; +import shared.Version as Version; +import util.ajax; +import string.timeAgo; + +import squill.TabbedPane; +import squill.Delegate; +import squill.models.DataSource; +import squill.Cell; + +from util.browser import $; + +exports = Class(sdkPlugin.SDKPlugin, function(supr) { + this._def = { + id: 'aboutPane', + children: [ + { + tag: 'a', + attrs: {href: 'https://gcsdk.zendesk.com/forums', target: '_blank'}, + className: 'supportLink', + text: 'forums' + }, + { + tag: 'a', + attrs: {href: 'https://groups.google.com/forum/?fromgroups=#!forum/gameclosure', target: '_blank'}, + className: 'supportLink', + text: 'mailing list' + }, + { + tag: 'a', + attrs: {href: 'http://webchat.freenode.net/?channels=#gameclosure', target: '_blank'}, + className: 'supportLink', + text: 'IRC' + }, + { + tag: 'a', + attrs: {href: 'mailto:support@gameclosure.com'}, + className: 'supportLink', + text: 'support@gameclosure.com' + } + ] + }; +}); diff --git a/src/serve/plugins/support/static/support.styl b/src/serve/plugins/support/static/support.styl new file mode 100644 index 00000000..d13cd2f0 --- /dev/null +++ b/src/serve/plugins/support/static/support.styl @@ -0,0 +1,9 @@ +.supportLink + border-radius 10px + padding 20px 40px + background rgba(0, 0, 0, 0.2) + margin 20px + border 1px solid rgba(0, 0, 0, 0.3) + float left + color #226 + text-decoration none \ No newline at end of file diff --git a/src/serve/public/Overview.js b/src/serve/public/Overview.js index 17138b02..dde5f1b6 100644 --- a/src/serve/public/Overview.js +++ b/src/serve/public/Overview.js @@ -33,8 +33,10 @@ import util.ajax; var PluginGroup = Class(function() { var PRIORITIES = { header: 'a', - project: 'b', - debug: 'c' + main: 'b', + project: 'c', + debug: 'd', + footer: 'z' }; var DEFAULT_PRIORITY = 'z'; @@ -44,7 +46,7 @@ var PluginGroup = Class(function() { this.priority = PRIORITIES[name] || DEFAULT_PRIORITY; }; - this.add = function(plugin) { this.plugins.push(plugin); }; + this.add = function(plugin) { this.plugins.push(plugin); console.log(plugin, this.priority); }; this.toString = function() { return this.priority; }; }); @@ -229,8 +231,7 @@ exports = Class(squill.TabbedPane, function(supr) { // sort the plugins by group var groups = []; - plugins.forEach( - function(plugin) { + plugins.forEach(function(plugin) { var group = groups[plugin.group]; if (!group) { group = new PluginGroup(plugin.group); @@ -239,8 +240,7 @@ exports = Class(squill.TabbedPane, function(supr) { } group.add(plugin); - } - ); + }); groups.sort(); diff --git a/src/serve/stylesheets/plugins.styl b/src/serve/stylesheets/plugins.styl index 3d3ec1fd..914b980c 100644 --- a/src/serve/stylesheets/plugins.styl +++ b/src/serve/stylesheets/plugins.styl @@ -1,4 +1,5 @@ @import "about/static/about.styl" +@import "support/static/support.styl" @import "art/static/art.styl" @import "native/static/native.styl" @import "projects/static/projects.styl" diff --git a/src/shared/Version.js b/src/shared/Version.js index 8e4efefb..d538272a 100644 --- a/src/shared/Version.js +++ b/src/shared/Version.js @@ -43,6 +43,8 @@ var Version = Class(function () { this.build = opts.build || 0; this.tag = opts.tag || ''; + + this.src = this.toString(); }; this.getNext = function (which) { @@ -208,7 +210,7 @@ Version.sorterDesc = function (a, b) { }; if(module && module.children) { - module.exports = Version; + module.exports = Version; } else { exports = Version; } From 02d11b6c89b4b9eddfcf3babb7f4b274b841c18e Mon Sep 17 00:00:00 2001 From: Martin Hunt Date: Wed, 13 Feb 2013 00:59:33 -0800 Subject: [PATCH 3/6] Remove support pane --- src/serve/plugins/support/manifest.json | 6 -- src/serve/plugins/support/plugin.js | 20 ------- src/serve/plugins/support/static/Pane.js | 60 ------------------- src/serve/plugins/support/static/support.styl | 9 --- src/serve/stylesheets/plugins.styl | 1 - 5 files changed, 96 deletions(-) delete mode 100644 src/serve/plugins/support/manifest.json delete mode 100644 src/serve/plugins/support/plugin.js delete mode 100644 src/serve/plugins/support/static/Pane.js delete mode 100644 src/serve/plugins/support/static/support.styl diff --git a/src/serve/plugins/support/manifest.json b/src/serve/plugins/support/manifest.json deleted file mode 100644 index 766a39c5..00000000 --- a/src/serve/plugins/support/manifest.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "0.1.0", - "author": "Game Closure", - "name": "Support", - "scope": "footer" -} \ No newline at end of file diff --git a/src/serve/plugins/support/plugin.js b/src/serve/plugins/support/plugin.js deleted file mode 100644 index a279b642..00000000 --- a/src/serve/plugins/support/plugin.js +++ /dev/null @@ -1,20 +0,0 @@ -/* @license - * This file is part of the Game Closure SDK. - * - * The Game Closure SDK is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * The Game Closure SDK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with the Game Closure SDK. If not, see . - */ - -exports.load = function (app) { - -}; diff --git a/src/serve/plugins/support/static/Pane.js b/src/serve/plugins/support/static/Pane.js deleted file mode 100644 index 4be845f7..00000000 --- a/src/serve/plugins/support/static/Pane.js +++ /dev/null @@ -1,60 +0,0 @@ -/* @license - * This file is part of the Game Closure SDK. - * - * The Game Closure SDK is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * The Game Closure SDK is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with the Game Closure SDK. If not, see . - */ - -import ....sdkPlugin; -import shared.Version as Version; -import util.ajax; -import string.timeAgo; - -import squill.TabbedPane; -import squill.Delegate; -import squill.models.DataSource; -import squill.Cell; - -from util.browser import $; - -exports = Class(sdkPlugin.SDKPlugin, function(supr) { - this._def = { - id: 'aboutPane', - children: [ - { - tag: 'a', - attrs: {href: 'https://gcsdk.zendesk.com/forums', target: '_blank'}, - className: 'supportLink', - text: 'forums' - }, - { - tag: 'a', - attrs: {href: 'https://groups.google.com/forum/?fromgroups=#!forum/gameclosure', target: '_blank'}, - className: 'supportLink', - text: 'mailing list' - }, - { - tag: 'a', - attrs: {href: 'http://webchat.freenode.net/?channels=#gameclosure', target: '_blank'}, - className: 'supportLink', - text: 'IRC' - }, - { - tag: 'a', - attrs: {href: 'mailto:support@gameclosure.com'}, - className: 'supportLink', - text: 'support@gameclosure.com' - } - ] - }; -}); diff --git a/src/serve/plugins/support/static/support.styl b/src/serve/plugins/support/static/support.styl deleted file mode 100644 index d13cd2f0..00000000 --- a/src/serve/plugins/support/static/support.styl +++ /dev/null @@ -1,9 +0,0 @@ -.supportLink - border-radius 10px - padding 20px 40px - background rgba(0, 0, 0, 0.2) - margin 20px - border 1px solid rgba(0, 0, 0, 0.3) - float left - color #226 - text-decoration none \ No newline at end of file diff --git a/src/serve/stylesheets/plugins.styl b/src/serve/stylesheets/plugins.styl index 8f15779b..1a6c57cd 100644 --- a/src/serve/stylesheets/plugins.styl +++ b/src/serve/stylesheets/plugins.styl @@ -1,5 +1,4 @@ @import "about/static/about.styl" -@import "support/static/support.styl" @import "native/static/native.styl" @import "projects/static/projects.styl" @import "simulate/static/simulate.styl" From a2c32a82b8b62f0729df6a711926de5b3b1e63fd Mon Sep 17 00:00:00 2001 From: Martin Hunt Date: Wed, 13 Feb 2013 01:25:22 -0800 Subject: [PATCH 4/6] sort the versions and remove the tabbed pane int he about panel --- src/serve/plugins/about/static/Pane.js | 41 +++++++++++-------- src/serve/plugins/about/static/about.styl | 39 ++++++++++++++---- .../plugins/documentation/static/Pane.js | 2 + src/shared/Version.js | 24 +++++++++++ 4 files changed, 82 insertions(+), 24 deletions(-) diff --git a/src/serve/plugins/about/static/Pane.js b/src/serve/plugins/about/static/Pane.js index 0b381f6c..e74c6407 100644 --- a/src/serve/plugins/about/static/Pane.js +++ b/src/serve/plugins/about/static/Pane.js @@ -45,9 +45,9 @@ var VersionCell = Class(squill.Cell, function(supr) { }); this.render = function() { - this.label.setText(this._data.toString()); + this.label.setText(this._data.version.toString()); - if (this._data == currentVersion) { + if (this._data.version == currentVersion) { $.addClass(this._el, 'current'); } else { $.removeClass(this._el, 'current'); @@ -55,14 +55,14 @@ var VersionCell = Class(squill.Cell, function(supr) { }; }); -var versionData = new squill.models.DataSource({key: 'src'}); +var versionData = new squill.models.DataSource({key: 'src', sorter: function (v) { return Version.sorterKey(v.version); }}); exports = Class(sdkPlugin.SDKPlugin, function(supr) { this._def = { id: 'aboutPane', children: [ - {className: 'topTabs', type: squill.TabbedPane, panes: [ - {id: 'aboutMain', className: 'mainPanel', title: 'about', children: [ + {id: 'aboutMain', className: 'mainPanel', title: 'about', children: [ + {className: 'table-wrapper', children: [ {className: 'table', children: [ {className: 'table-row', children: [ {className: 'table-cell', children: [ @@ -72,16 +72,18 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { {id: 'updateStatus'}, {id: 'lastCheckedStatus'}, {id: 'refresh', type: 'button', text: '\u21BB', className: 'circle'} - ]} + ]}, + {id: 'btnSwitchVersion', type: 'button', text: 'switch version'} ]} ]}, ]}, ]}, - {className: 'mainPanel', title: 'versions', children: [ - {id: 'versionHeader', children: [{tag: 'span', text: 'current version: '}, {tag: 'span', id: 'aboutVersion'}]}, - {id: 'versionWrapper', className: 'darkPanel', children: [ + + {id: 'versionWrapper', children: [ + {id: 'versionHeader', text: 'all versions:'}, // children: [{tag: 'span', text: 'all versions: '}, {tag: 'span', id: 'aboutVersion'}]}, + {id: 'versionListWrapper', className: 'darkPanel', children: [ {id: 'versions', type: 'list', dataSource: versionData, cellCtor: VersionCell, selectable: 'single'} - ]}, + ]} ]} ]} ] @@ -96,6 +98,11 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { type: 'json' }, bind(this, 'onVersions')); }; + + on.btnSwitchVersion = function () { + $.addClass(this._el, 'showVersions'); + this.versions.needsRender(); + } }); this.onSwitchVersion = function(version) { @@ -154,7 +161,10 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { currentVersion = v; } - versionData.add(v); + versionData.add({ + version: v, + src: v.src + }); } versionData.sort(Version.sorterDesc); @@ -171,8 +181,7 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { } $.setText(this.version, verStr); - $.setText(this.aboutVersion, verStr); - + this._checkUpdates(); }; @@ -184,9 +193,9 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { var nextVersion = null; // find the first non-beta version greater than the current version - versionData.forEach(function(v) { - if (currentVersion.lt(v)) { - nextVersion = v; + versionData.forEach(function(data) { + if (currentVersion.lt(data.version)) { + nextVersion = data.version; return true; } }, this); diff --git a/src/serve/plugins/about/static/about.styl b/src/serve/plugins/about/static/about.styl index eb4c1449..47fbbeda 100644 --- a/src/serve/plugins/about/static/about.styl +++ b/src/serve/plugins/about/static/about.styl @@ -9,11 +9,31 @@ background: bglight(), -webkit-radial-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)); } -#aboutMain .table { - width: 100%; - height: 100%; - display: table; -} +#aboutPane .table-wrapper + height 100% + overflow auto + +#aboutPane .table + width 100%; + height 100%; + display table; + overflow auto + +#aboutPane.showVersions .table-wrapper, +#aboutPane.showVersions .table + height 50% + +#aboutPane #versionWrapper + display none + + absoluteBox(0px, 15px, 15px, 15px) + top: 50%; + +#aboutPane.showVersions #versionWrapper + display block + +#aboutPane.showVersions #btnSwitchVersion + display none #aboutPane input[type=checkbox] { margin-right: 5px; @@ -59,13 +79,16 @@ text-size: 80%; } +#aboutPane #btnSwitchVersion + margin-top: 40px + #aboutPane #versionHeader padding 15px + text-align center -#aboutPane #versionWrapper { +#aboutPane #versionListWrapper overflow auto - absoluteBox(45px, 15px, 15px, 15px) -} + absoluteBox(35px, 15px, 15px, 15px) #aboutPane #versions padding 10px 0px diff --git a/src/serve/plugins/documentation/static/Pane.js b/src/serve/plugins/documentation/static/Pane.js index 4b99281f..620f2f98 100644 --- a/src/serve/plugins/documentation/static/Pane.js +++ b/src/serve/plugins/documentation/static/Pane.js @@ -35,4 +35,6 @@ exports = Class(sdkPlugin.SDKPlugin, function(supr) { {tag: 'iframe', src: '//docs.gameclosure.com', style: {border: 0, width: '100%', height: '100%'}} ] }; + + }); diff --git a/src/shared/Version.js b/src/shared/Version.js index 3e5e0a61..a07400bf 100644 --- a/src/shared/Version.js +++ b/src/shared/Version.js @@ -215,6 +215,30 @@ Version.sorterDesc = function (a, b) { return Version.sorterAsc(b, a); }; +Version.sorterKey = function (a) { + return a.channel + ' ' + pad(a.major) + pad(a.minor) + pad(a.patch) + pad(a.build); +} + + +var LEN = 8; +var MAX = 99999999; +var MIN = -99999999; +var PAD = "00000000"; + +function pad (val) { + val = ~~val; + + if (val < MIN) { val = MIN; } + if (val > MAX) { val = MAX; } + if (val < 0) { + val *= -1; + return '-' + PAD.substring(0, LEN - ('' + val).length) + val; + } else { + return PAD.substring(0, LEN - ('' + val).length) + val; + } +}; + + if(module && module.children) { module.exports = Version; } else { From f27d331905b2a8a1fae70594a3859a92e9831f3e Mon Sep 17 00:00:00 2001 From: Martin Hunt Date: Wed, 13 Feb 2013 13:24:13 -0800 Subject: [PATCH 5/6] mock a console object if it does not exist (IE9?) --- src/serve/plugins/simulate/static/index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/serve/plugins/simulate/static/index.html b/src/serve/plugins/simulate/static/index.html index 24c635ee..58048889 100755 --- a/src/serve/plugins/simulate/static/index.html +++ b/src/serve/plugins/simulate/static/index.html @@ -9,6 +9,11 @@ Game Closure SDK