summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorAnton McConville2012-02-09 16:50:51 (EST)
committer sfranklin2012-02-09 16:50:51 (EST)
commit5e6ba2f482854492d8c77ba3092a2f577525aaf8 (patch)
tree7db0f966be77b10ab00bcab2433c531c22df1346
parentbf28eac9cff1bc7c34a95606c58fdd012af1bf73 (diff)
downloadorg.eclipse.orion.client-5e6ba2f482854492d8c77ba3092a2f577525aaf8.zip
org.eclipse.orion.client-5e6ba2f482854492d8c77ba3092a2f577525aaf8.tar.gz
org.eclipse.orion.client-5e6ba2f482854492d8c77ba3092a2f577525aaf8.tar.bz2
Addition of service carousel fixes for: 371104, 349442, 369348, 369711 Merged Simon's previous fix in settings.js for bug 370086 (fixed moved to PluginList.js)
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/widgets/PluginList.js253
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/widgets/ServiceCarousel.js191
-rw-r--r--bundles/org.eclipse.orion.client.core/web/settings/settings.css227
-rw-r--r--bundles/org.eclipse.orion.client.core/web/settings/settings.html10
-rw-r--r--bundles/org.eclipse.orion.client.core/web/settings/settings.js214
5 files changed, 670 insertions, 225 deletions
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/widgets/PluginList.js b/bundles/org.eclipse.orion.client.core/web/orion/widgets/PluginList.js
new file mode 100644
index 0000000..f98c479
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.core/web/orion/widgets/PluginList.js
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors: Anton McConville - IBM Corporation - initial API and implementation
+ ******************************************************************************/
+/*global dojo dijit widgets orion console define*/
+/*jslint browser:true*/
+
+define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/TooltipDialog', 'orion/widgets/ServiceCarousel'], function(require, dojo, dijit, mUtil) {
+
+ dojo.declare("orion.widgets.PluginList", [dijit._Widget, dijit._Templated], {
+
+ templateString: '<div>' +
+ '<div class="pluginwrapper">' +
+ '<div class="pluginTitle" data-dojo-attach-point="pluginTitle"></div>' +
+ '<div class="additions" data-dojo-attach-point="pluginControl" data-dojo-attach-event="onclick:addNewPlugins">Add Plugins</div>' +
+ '</div>' +
+ '<div class="displaytable">' +
+ '<div data-dojo-attach-point="pluginDialog" class="interactionClosed">' +
+ '<table id="dev-table" width="100%">' +
+ '<tr>' +
+ '<td>' +
+ '<input data-dojo-attach-point="pluginUrlEntry" type="url" data-dojo-attach-event="onfocus:pluginURLFocus, onblur:pluginURLBlur" value="Type a plugin url here ..." name="user_url" style="width:400px;color:#AAA;"/>' +
+ '<button data-dojo-attach-event="onclick:installHandler">Load this plugin</button>' +
+ '</td>' +
+ '<td align="right">' +
+ '<button id="update-extensions-now" data-dojo-attach-event="onclick:reloadPlugins">Re-load all</button>' +
+ '</td>' +
+ '</tr>' +
+ '</table>' +
+ '</div>' +
+ '<div class="plugin-settings">' +
+ '<list data-dojo-attach-point="pluginSettingsList"></list>' +
+ '</div>' +
+ '</div>' +
+ '</div>',
+
+ iconSource: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wBFxMFB6T1TK0AAAfOSURBVGjevZpLbFzlGYaf9x87DnZCyLUhCSSOY9PgmdwQdxrRVqhR1aYgpVXUTbvohgqRtrQCsWjFolSqBIUKCXXRsmkFCygiUpu2QgkFWkoIGOKZQIRj5yYSUifNhdiO7TlvF/+Mb4zt8bGTszmamXP+//2+7/2u/4gZulxgAYmWWl4kWG6zVGI+5gLQjziOOeYQzmgwOar19AMkpyEsTL+v0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DH5cAdQI3gPK8YrNTZhL2IrrXn61A8J+04mX6UbOjXc+VnVjm7RRR61ex9wSj990WbQe5+gewHpSOT9SzXuT9sRuh7CRS+qvvVXB98gaiCfzM2eNEtmFnWeAJcr5EXdlYoKdrgDKlTap60etvGp7geFhxCe2cUphht6xQbxha2vIkdNGzia7QY1FwleqGtFNQ3MFbXbCM8hrhGYBmRKBS8lVpflNjO1RyQbUjzwIvESGH4e1nE6dA1ODPwC6cSiLzwetxG4BsqCsxBzwEuCSrTOCbnAbIm+HLik5omzpLzedEFanw/F/byy0oCz4lroAAAAASUVORK5CYII=",
+
+ pluginDialogState: false,
+
+ /* derivePluginNameFromLocation - temporary function -
+ the current plugins don't provide useful enough, or
+ consistent meta-data to use for descriptions. */
+
+ derivePluginNameFromLocation: function( location ){
+
+ function wordToUpper(strSentence) {
+
+ function convertToUpper() {
+ return arguments[0].toUpperCase();
+ }
+
+ return strSentence.toLowerCase().replace(/\b[a-z]/g, convertToUpper);
+ }
+
+ var divides = location.split( "/" );
+ var last = divides[divides.length-1];
+ last = last.split( ".html" )[0];
+ last = last.replace( /([a-z])([A-Z])/, "$1 $2");
+ last = wordToUpper( last );
+ return last;
+ },
+
+
+ postCreate: function(){
+ this.addRows();
+ },
+
+ addRows: function(){
+
+ var list = this.pluginSettingsList;
+ dojo.empty( list );
+
+ var pluginList = this.settings.pluginRegistry.getPlugins();
+
+ this.pluginTitle.innerHTML = "Plugins [" + pluginList.length +"]";
+
+ for( var p = 0; p < pluginList.length; p++ ){
+
+ var plg = pluginList[p].getData();
+ var ref = pluginList[p].getServiceReferences();
+
+ var rcount=0;
+ var serviceData = [];
+
+ for( rcount;rcount<ref.length;rcount++ ){
+
+ var s = { 'service': ref[rcount].name };
+ var props = [];
+ var properties = ref[rcount].properties;
+
+ for( var pItem in properties ){
+ if( pItem ){
+ var item = { 'item':pItem, 'value':properties[pItem] };
+ props.push(item);
+ }
+ }
+
+ s.items = props;
+ serviceData.push(s);
+ }
+
+ var location = pluginList[p].getLocation();
+
+ var name = this.derivePluginNameFromLocation( location );
+
+ var extensionListItem = dojo.create( "div", { "class":"plugin-list-item" }, list );
+ var container = dojo.create( "div", /*{ "class":"container" }*/ null, extensionListItem );
+ var icon = dojo.create( "img", { "class":"plugin-icon", "src": this.iconSource }, container );
+ var detailsView = dojo.create( "div", { "class":"stretch" }, container );
+ var title = dojo.create( "span", { "class":"plugin-title", innerHTML: name }, detailsView );
+ dojo.create( "div", null, detailsView );
+ var description = dojo.create( "span", { "class":"plugin-description", innerHTML: "A plugin for Eclipse Orion" }, detailsView );
+ dojo.create( "a", { "class":"plugin-link", href: location, innerHTML: "Plugin Link" }, detailsView );
+
+ var removeButton = dojo.create( "button", { "id":location, "class":"plugin-delete", innerHTML: "Remove", 'onclick': dojo.hitch( this, "removePlugin" ) }, container );
+
+ var serviceContainer = dojo.create("div", {'class':'plugin-service-item'}, list);
+
+ new orion.widgets.ServiceCarousel({serviceData:serviceData}, serviceContainer );
+ }
+ },
+
+ addNewPlugins: function(){
+ if( this.pluginDialogState === false ){
+ dojo.removeClass( this.pluginDialog, "interactionClosed" );
+ dojo.addClass( this.pluginDialog, "interactionOpen" );
+ this.pluginControl.innerHTML = "Hide Dialog";
+ this.pluginDialogState = true;
+ }else{
+ dojo.removeClass( this.pluginDialog, "interactionOpen" );
+ dojo.addClass( this.pluginDialog, "interactionClosed" );
+ this.pluginControl.innerHTML = "Add Plugins";
+ this.pluginDialogState = false;
+ }
+ },
+
+ pluginURLFocus: function(){
+ this.pluginUrlEntry.value = '';
+ dojo.style( this.pluginUrlEntry, "color", "" );
+ },
+
+ pluginURLBlur: function(){
+ if( this.pluginUrlEntry.value === '' ){
+ this.pluginUrlEntry.value = 'Type a plugin url here ...';
+ dojo.style( this.pluginUrlEntry, "color", "#AAA" );
+ }
+ },
+
+ addPlugin: function( plugin ){
+ this.pluginUrlEntry.value="";
+ this.statusService.setMessage("Installed " + plugin.getLocation(), 5000);
+ this.settings.preferences.getPreferences("/plugins").then(function(plugins) {
+ plugins.put(this.newPluginUrl, true);
+ }); // this will force a sync
+
+ this.addRows();
+
+ },
+
+ pluginError: function( error ){
+ this.statusService.setErrorMessage(error);
+ },
+
+ installHandler: function(){
+ this.newPluginUrl = this.pluginUrlEntry.value;
+ if (/^\S+$/.test(dojo.trim(this.newPluginUrl))) {
+ this.statusService.setMessage("Installing " + this.newPluginUrl + "...");
+ if( this.settings.pluginRegistry.getPlugin(this.newPluginUrl) ){
+ this.statusService.setErrorMessage("Already installed");
+ } else {
+ this.settings.pluginRegistry.installPlugin(this.newPluginUrl).then( dojo.hitch( this, 'addPlugin' ), dojo.hitch( this, 'pluginError' ) );
+ }
+ }
+ },
+
+ reloaded: function(){
+ var settingsPluginList = this.settings.pluginRegistry.getPlugins();
+ this.statusService.setMessage( "Reloaded " + settingsPluginList.length + " plugin" + ( settingsPluginList.length===1 ? "": "s") + ".", 5000 );
+ this.addRows();
+ },
+
+ /* reloads all of the plugins - sometimes useful for reaffirming plugin initialization */
+
+ reloadPlugins: function(){
+
+ var settingsPluginList = this.settings.pluginRegistry.getPlugins();
+
+ var count = 0;
+
+ var d = new dojo.Deferred();
+
+ for( var i = 0; i < settingsPluginList.length; i++) {
+
+ settingsPluginList[i].update().then( function(){
+ count++;
+ if( count === settingsPluginList.length ){
+ d.resolve();
+ }
+ });
+ }
+
+ d.then( dojo.hitch( this, "reloaded" ) );
+ },
+
+ forceRemove: function(decision){
+ if( decision === true ){
+
+ var settings = this.settings;
+ var statusService = this.statusService;
+
+ var settingsPluginList = settings.pluginRegistry.getPlugins();
+
+ for( var p = 0; p < settingsPluginList.length; p++ ){
+ if( settingsPluginList[p].getLocation() === event.srcElement.id ){
+ settingsPluginList[p].uninstall();
+
+ this.pluginUrlEntry.value="";
+ statusService.setMessage("Uninstalled " + event.srcElement.id, 5000);
+ settings.preferences.getPreferences("/plugins").then(function(plugins) {
+ plugins.remove(event.srcElement.id);
+ }); // this will force a sync
+
+ this.addRows();
+
+ break;
+ }
+ }
+ }
+ },
+
+
+ /* removePlugin - removes a plugin by url */
+
+ removePlugin: function( event ){
+
+ /* The id of the source element is programmed with the
+ url of the plugin to remove. */
+
+ // TODO: Should be internationalized
+
+ var confirmMessage = "Are you sure you want to uninstall '" + event.srcElement.id + "'?";
+
+ this.dialogService.confirm( confirmMessage, dojo.hitch( this, 'forceRemove' ) );
+ }
+ });
+}); \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/widgets/ServiceCarousel.js b/bundles/org.eclipse.orion.client.core/web/orion/widgets/ServiceCarousel.js
new file mode 100644
index 0000000..5d9e08d
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.core/web/orion/widgets/ServiceCarousel.js
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors: Anton McConville - IBM Corporation - initial API and implementation
+ ******************************************************************************/
+/*global dojo dijit widgets console define*/
+/*jslint browser:true*/
+
+define(['require', 'dojo', 'dijit', 'orion/util', 'dijit/TooltipDialog', 'dojo/fx'], function(require, dojo, dijit, mUtil) {
+
+ dojo.declare("orion.widgets.ServiceCarousel", [dijit._Widget, dijit._Templated], {
+
+ serviceState: false,
+ pointer: 0,
+ box: null,
+
+ closedIcon: "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAwAAAANCAYAAACdKY9CAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wCCQ46FewKfYYAAAF4SURBVCjPbZEvyFNhGMV/590ciANhjNs2nC66osHiJ8b9cdVgN4uKyWbRaDGZBIvwYRB2723WBUEEy5igYeZxYQzd7t2x7IUFn/bAOec55zxK05TxeEyWZZds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ASUVORK5CYII=",
+
+ templateString:'<div class="plugin-service-item"><div class="serviceContainerClosed" data-dojo-attach-point="serviceLabel" data-dojo-attach-event="onclick:showServices">Services</div>' +
+ '<div class="serviceRailsVisible" data-dojo-attach-point="rails" data-dojo-attach-event="onmouseenter:showButtons,onmouseleave:hideButtons">' +
+ '<div class="leftButtonArea" data-dojo-attach-point="leftbutton">' +
+ '<span class="carouselControl" data-dojo-attach-event="onclick:slideLeft">&lt;</span>' +
+ '</div>' +
+ '<div class="listContainer" data-dojo-attach-point="listContainer" >' +
+ '<ul class="serviceList" data-dojo-attach-point="testlist"></ul>' +
+ '</div>' +
+ '<div class="rightButtonArea" data-dojo-attach-point="rightbutton">' +
+ '<span class="carouselControl" data-dojo-attach-event="onclick:slideRight">&gt;</span>' +
+ '</div>' +
+ '</div></div>',
+
+ constructor: function() {
+ this.inherited(arguments);
+ },
+
+ setRailsWidth: function(){
+ var railsBox = dojo.marginBox( this.rails );
+
+ var gaps = 170; // TODO: Write the marginSize calls to build this up
+
+ var listwidth = railsBox.w - gaps;
+
+ dojo.style( this.listContainer, "width", listwidth + 'px' );
+ },
+
+ postCreate: function(){
+ var railsBox = dojo.marginBox( this.domNode.parentNode );
+ this.setRailsWidth();
+ this.addData( this.serviceData );
+ this.serviceLabel.innerHTML = "Services [" + this.serviceData.length +"]";
+ dojo.style( this.domNode, "width", railsBox.w - 63 + 'px' );
+
+ this.box = dojo.marginBox( this.rails );
+
+ dojo.removeClass( this.rails, "serviceRailsVisible" );
+ dojo.addClass( this.rails, "serviceRailsHidden" );
+ },
+
+ showServices: function(){
+ if( this.serviceState === false ){
+
+ dojo.removeClass( this.rails, "serviceRailsHidden" );
+ dojo.addClass( this.rails, "serviceRailsVisible" );
+ dojo.removeClass( this.serviceLabel, "serviceContainerClosed" );
+ dojo.addClass( this.serviceLabel, "serviceContainerOpen" );
+
+ if( this.box ){
+ dojo.marginBox( this.rails, this.box );
+ }else{
+ this.box = dojo.marginBox( this.rails );
+ }
+
+ this.serviceState = true;
+
+
+ }else{
+ dojo.marginBox( this.rails, { h:0 } );
+
+ dojo.removeClass( this.serviceLabel, "serviceContainerOpen" );
+ dojo.addClass( this.serviceLabel, "serviceContainerClosed" );
+ dojo.removeClass( this.rails, "serviceRailsVisible" );
+ dojo.addClass( this.rails, "serviceRailsHidden" );
+ this.serviceState = false;
+ }
+ },
+
+ showButtons: function(){
+
+ dojo.style( this.leftbutton, "visibility", "visible" );
+ dojo.style( this.rightbutton, "visibility", "visible" );
+
+ var sze = dojo.marginBox( this.rails );
+
+ var buttonSize = dojo.marginBox( this.leftbutton.firstChild );
+ var buttonTop = Math.round(sze.h/2) - Math.round( buttonSize.h ) + 'px';
+
+ dojo.style( this.leftbutton.firstChild, "top", buttonTop );
+ dojo.style( this.rightbutton.firstChild, "top", buttonTop );
+
+ },
+
+ hideButtons:function(){
+ dojo.style( this.leftbutton, "visibility", "hidden" );
+ dojo.style( this.rightbutton, "visibility", "hidden" );
+ },
+
+ slideRight: function(){
+
+ this.pointer = this.pointer+1;
+
+ this.box = dojo.marginBox( this.rails );
+
+ if( this.pointer < this.serviceData.length ){
+
+ for( var count=0; count < this.pointer; count++ ){
+ dojo.style( this.listContainer.childNodes[0].childNodes[count], "display", "none" );
+ };
+
+ dojo.marginBox( this.rails, this.box );
+ }
+ },
+
+ slideLeft: function(){
+
+ this.box = dojo.marginBox( this.rails );
+
+ if( this.pointer > 0 ){
+ this.pointer = this.pointer-1;
+ dojo.style( this.listContainer.childNodes[0].childNodes[this.pointer], "display", "" );
+ }
+
+ dojo.marginBox( this.rails, this.box );
+ },
+
+ consoleOutput: function( debugData ){
+ console.log( 'Service: ' + debugData.title + ' Element: ' + debugData.item + ':' );
+ console.log( debugData.value );
+ },
+
+ createServiceTable: function(data, location){
+
+ var listItem = dojo.create( "li", {"class":"serviceData"}, location);
+
+ var entry = dojo.create( "div", { "class":"listEntry" }, listItem);
+
+ var tableContainer = dojo.create( "div", { "class":"tablecontainer" }, entry);
+ var table = dojo.create( "table", {"class":"serviceTable"}, tableContainer );
+ dojo.place('<thead><tr><th scope="col" id="...">Item</th><th scope="col" id="...">Value</th></tr></thead>', table);
+ dojo.place('<tfoot><tr><td></td></tr></tfoot>', table);
+ var tablebody = dojo.create( "tbody", null, table);
+
+ var itemCount;
+
+ for( itemCount=0;itemCount<data.items.length;itemCount++ ){
+ var row = dojo.create( "tr", null, tablebody);
+ dojo.create("td", {'innerHTML':data.items[itemCount].item}, row);
+
+ var value = data.items[itemCount].value;
+
+ var row = dojo.create("td", null, row);
+
+ if( typeof value === 'object' ){
+
+ var debugData = { title:data.service, item:data.items[itemCount].item, value: value };
+
+ dojo.create("span", { 'class':'objectLink', 'title':'click here, then check javascript console to drill down', 'onclick': dojo.hitch( this, 'consoleOutput', debugData ), 'innerHTML':'JavaScript Object' }, row );
+ }else{
+ row.innerHTML = value;
+ }
+ }
+
+ dojo.create( "div", { "innerHTML":data.service, "class":"listTitle" }, entry );
+
+ },
+
+ addData: function(services){
+
+ var itemCount;
+
+ for( itemCount=0;itemCount<services.length;itemCount++ ){
+ this.createServiceTable( services[itemCount], this.testlist );
+ }
+ }
+ });
+}); \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.core/web/settings/settings.css b/bundles/org.eclipse.orion.client.core/web/settings/settings.css
index 9af34d5..6613d3d 100644
--- a/bundles/org.eclipse.orion.client.core/web/settings/settings.css
+++ b/bundles/org.eclipse.orion.client.core/web/settings/settings.css
@@ -17,9 +17,6 @@
@import "../css/commands.css";
-@import "../org.dojotoolkit/dojox/grid/resources/Grid.css";
-
-@import "../org.dojotoolkit/dojox/grid/resources/nihiloGrid.css";
html,body {
height: 100%;
@@ -107,16 +104,17 @@ ul,menu,dir {
}
.settings {
- min-width:1000px;
- max-width:1300px;
+ min-width:800px;
+ max-width:1000px;
padding-left: 20px;
padding-right: 40px;
}
.pluginwrapper {
- padding-bottom: 40px;
+ padding-bottom: 20px;
padding-top: 24px;
border-bottom: 1px dotted #BFBFBF;
+ overflow:hidden;
}
.pluginTitle {
@@ -223,14 +221,6 @@ ul,menu,dir {
min-width: 100px;
}
-input[type="checkbox"] {
- margin: 3px 3px 3px 4px;
- margin-left: 0;
- margin-right: 0;
- position: relative;
- top: 1px;
-}
-
.addPluginClosed {
float: right;
width: 10px;
@@ -297,7 +287,6 @@ div.page section:last-child {
.plugin-list-item {
padding-top: 20px;
- margin-bottom: 20px;
width: 100%;
}
@@ -315,6 +304,8 @@ list,grid {
vertical-align: text-top;
width: 48px;
padding-right: 15px;
+ -webkit-user-select: none;
+ user-select: none;
}
.stretch {
@@ -359,6 +350,11 @@ list>*,grid>* {
padding-right: 10px;
}
+.container{
+ float:left;
+ position:relative;
+}
+
.plugin-description {
font-size: 13px;
white-space: normal;
@@ -393,3 +389,204 @@ list>*,grid>* {
padding-right: 7px;
}
+.plugin-service-item {
+ width: 100%;
+ margin-left: 63px;
+}
+
+
+
+.serviceContainerClosed{
+ position: relative;
+ background: white;
+ padding-left:16px;
+ background-image: url("data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAwAAAANCAYAAACdKY9CAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wCCQ46FewKfYYAAAF4SURBVCjPbZEvyFNhGMV/590ciANhjNs2nC66osHiJ8b9cdVgN4uKyWbRaDGZBIvwYRB2723WBUEEy5igYeZxYQzd7t2x7IUFn/bAOec55zxK05TxeEyWZZds3wEeAXeBP8An4I3tr5PJZJemKQLIsiyxfQ6c8f95V1XVw+l0utdsNrsInEsaA5akE6Btx/3Vfr9/HiTdOIIBKMsS29gGOCU/bTQanWD7QVQry1Lz+ZzFYsFutyOEgCQkGbhg+1Zd0vRIkG2KomC5XLJarej3+3S7XUII8dJZHehIihaQxHq9ZrvdUhQFzWaTdrvNEXO1DvwCrkSjh8OBJEnodrv0ej1arVZMD/CjLumj7SexoSRJGAwGdDodarVaBFqSbH9WlmU3gS9RHSCEgG1iw8fW/gLXAvDd9gfbhBAIIThmOf4hZnux2Wx+CyDP88tVVb2XdC9mOVUHXo9Go8eSCFmWMRwOC+A+cBt4C/y0/c32S+C6pGeSyPOcfyAyt4A7QPcNAAAAAElFTkSuQmCC" );
+ background-repeat:no-repeat;
+ background-position:left;
+ color: #666;
+ font-size: 0.9em;
+ float:left;
+ -webkit-user-select: none;
+ cursor:pointer;
+}
+
+.serviceContainerOpen{
+ position: relative;
+ background: white;
+ padding-left:16px;
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAMCAYAAAC5tzfZAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wCCQ46NddkXU4AAAFuSURBVCjPXZG/q9NwFMU/5yYQOhVKoF1SDK9OOjl1URxcQl+G5/LgLeJf4K7wRjdBxMXRxcFR6TfZ3e3iUGe3DKXYQSEk10GjwbPdy+X8uEdVVVEUBVVVJcBt4MrdHwI3gG/u/lHSO3f/vNlsfoQQEEBd19O+799IunR3JAHg7gxw92Bmj4uiaLTdbifAe0nnkvDfl+IfxvMnSUUs6Q5wLom+7+m6TmMFSYrjeFjcdfd7MfBozLjb7WiaBjPD3ZlOp6zXa8VxPNh9YsCDgdTMmM/nHI9H9vs9TdOQpilRFI3cct+A7+PgWZaxXC5JkoQsy8jznP/w04Aw2JNEFEXkec5isWC1WjGZTIZvDrk+KIRwC/jyJzQAfd9zOByYzWZ/s42wNklfgZejXtzMSNMUMxsrALx1952G46qqnrr7tZklQ8EjhRZ40XXddVmWrdV1jSROp9Nz4MzdL4BX7h6A18ClpJtt2z4ry7INIfAL982ks01Z8EgAAAAASUVORK5CYII=" );
+ background-repeat:no-repeat;
+ background-position:left;
+ color: #666;
+ font-size: 0.9em;
+ float:left;
+ -webkit-user-select: none;
+ cursor:pointer;
+}
+
+.service-container:hover{
+ color: #039;
+}
+
+.serviceTable{
+ border-collapse: separate;
+ border-spacing: 2px;
+ font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
+ font-size: 9px;
+ text-align: left;
+ border-collapse: collapse;
+ width: 200px;
+ -webkit-user-select: none;
+}
+
+ .serviceTable th{
+ padding: 8px 2px;
+ font-weight: normal;
+ font-size: 10px;
+ border-bottom: 2px solid #6678B1;
+ border-right: 30px solid white;
+ border-left: 30px solid white;
+ color: #039;
+ -webkit-user-select: none;
+}
+
+.serviceTable td {
+ padding : 3px 2px 0px 2px;
+ border-right: 30px solid white;
+ border-left: 30px solid white;
+ width:100px;
+ color: #669;
+ -webkit-user-select: none;
+}
+
+.serviceTable td, th {
+ display: table-cell;
+ vertical-align: inherit;
+ -webkit-user-select: none;
+}
+
+.tablecontainer{
+ padding:1px;
+ border: 1px solid #039;
+ display: inline-block;
+ border-radius:5px;
+ vertical-align:top;
+ -webkit-user-select: none;
+}
+
+.serviceData{
+ display: inline;
+ list-style-type: none;
+ padding-right: 20px;
+}
+
+.serviceRailsVisible{
+ white-space: nowrap;
+ border-top: solid 1px #EEE;
+ border-bottom: solid 1px #EEE;
+ margin-top:30px;
+ overflow:hidden;
+ -webkit-user-select: none;
+ transition:height 1s;
+ -moz-transition:height 1s; /* Firefox 4 */
+ -webkit-transition:height 1s; /* Safari and Chrome */
+ -o-transition:height 1s;
+ -ms-transition:height 1s; /* Safari and Chrome */
+}
+
+.serviceRailsHidden{
+ white-space: nowrap;
+ border-top: solid 1px #EEE;
+ border-bottom: solid 1px #EEE;
+ margin-top:30px;
+ margin-right:20px;
+ overflow:hidden;
+ visibility:hidden;
+ height:0px;
+ transition:height 1s;
+ -moz-transition:height 1s; /* Firefox 4 */
+ -webkit-transition:height 1s; /* Safari and Chrome */
+ -o-transition:height 1s;
+ -ms-transition:height 1s; /* Safari and Chrome */
+}
+
+.serviceList{
+ margin-right:20px;
+ padding-right:20px;
+
+ float:left;
+ // position:relative;
+ overflow:hidden;
+}
+
+.leftButtonArea{
+ width: 40px;
+ float:left;
+ position:relative;
+ visibility:hidden;
+ display: inline;
+ text-align:right;
+}
+
+.rightButtonArea{
+ width: 40px;
+ float:left;
+ position:relative;
+ visibility:hidden;
+ display: inline;
+ margin: 0 1em 0 1em;
+ text-align:right;
+}
+
+.carouselControl{
+ background:#666;
+ opacity:0.4;
+ padding-left:6px;
+ padding-right:6px;
+ border-radius:23px;
+ display: table-cell;
+ vertical-align: middle;
+ position:absolute;
+ color:white;
+ font-weight:bolder;
+ border: #333 solid 1px;
+ cursor:pointer;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 13px;
+ background: #222;
+ text-align:right;
+}
+
+.carouselControl:hover{
+ opacity:0.8;
+}
+
+.listContainer{
+ float:left;
+ overflow:hidden;
+ padding-left:0px;
+ margin-left:0px;
+}
+
+.listEntry{
+ padding:1px;
+ display: inline-block;
+ vertical-align:top;
+ text-align:center;
+}
+
+.listTitle{
+ font-weight: bold;
+ font-size: 10px;
+ color: #039;
+ margin-top:5px;
+}
+
+.objectLink{
+ cursor:pointer;
+}
+
+.objectLink:hover{
+ color: orange;
+}
+
diff --git a/bundles/org.eclipse.orion.client.core/web/settings/settings.html b/bundles/org.eclipse.orion.client.core/web/settings/settings.html
index 5e3781c..1d2fc50 100644
--- a/bundles/org.eclipse.orion.client.core/web/settings/settings.html
+++ b/bundles/org.eclipse.orion.client.core/web/settings/settings.html
@@ -7,15 +7,7 @@
<link rel="stylesheet" type="text/css" href="settings.css" />
<style>
- .nihilo .dijitArrowButtonInner {
- }
-
- .dijitButtonNode .dijitArrowButtonInner {
- background: no-repeat center;
- width: 12px;
- height: 12px;
- direction: ltr;
- }
+
</style>
diff --git a/bundles/org.eclipse.orion.client.core/web/settings/settings.js b/bundles/org.eclipse.orion.client.core/web/settings/settings.js
index 69b6f52..d553909 100644
--- a/bundles/org.eclipse.orion.client.core/web/settings/settings.js
+++ b/bundles/org.eclipse.orion.client.core/web/settings/settings.js
@@ -1,6 +1,6 @@
/*******************************************************************************
* @license
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
@@ -20,6 +20,8 @@ var settingsCore;
var selectedCategory;
var newPluginDialog = false;
+var pluginWidget = null;
+
var iconSource = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wBFxMFB6T1TK0AAAfOSURBVGjevZpLbFzlGYaf9x87DnZCyLUhCSSOY9PgmdwQdxrRVqhR1aYgpVXUTbvohgqRtrQCsWjFolSqBIUKCXXRsmkFCygiUpu2QgkFWkoIGOKZQIRj5yYSUifNhdiO7TlvF/+Mb4zt8bGTszmamXP+//2+7/2u/4gZulxgAYmWWl4kWG6zVGI+5gLQjziOOeYQzmgwOar19AMkpyEsTL+v0ryUAKEMfD8PWNqBvExWLVADyAI8YgcDOEEaxB5A2if5Z2rlHQDnQdnLLIALoFZwO3cgHsTahsiAsbGkqtazbYGMQHwi/AeLp0Irp/0BaP0MCpDsBhozhMYiyX41EPxXoc3YIM0I+2yXVtLDlp8OWS5Va5GqESR5PS57B1J93HFm0I8SBAtzWLBdOd5O8hCy07VAnvkyO4G7jCwx08DHmgMhkB9SlieT9kDIJVMXwAUArnWiDqBeGuWSl1MASyX/MDtDzt8q+16lK4y7UMJyzH7J9eDxwSeG2ZtKj0z/itSUsS15a5Jnl1ohOabJBUjypXuBBZKO2CwEUZHvdoyNjbugaR/U3zVjQpTkENEKW5zXK+E6k+yfRAD1LI73hD1AZlI/nX0TzNkSgTe+Bg1fHi2EDUVPVzAbtrqdHWFdzBcVBUjeA9/8X5zX7yzW4Uk4L0HPu3BseylLBWjcDXNLAtlQ1wI3fAj1t6UWQpIUHeMpt3PL2NA6CmDyAd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zeCnj8KpX8X3VX1QsPR+yHpjUJZuW8ewp9ZG9rVB560RrASXDsLhrw6XB0GRakfvg+L/4vOHNkCxGw7Mg+KFuNYXHodlvy31QK56fyX+5VA2Stq1RfKuKXuUDXVro1OefAg8wLhNkUc0agJqV0DzRxAa4jNnnoXjP4SMqok+F0LWV8cR0H4ozVu6QQtSpdhUNZEh1MfJRc2S+N3pp+HEjyYpzQ3m98rxA4AQ1g2t9xtwytJQ6d5JeuDjtcNRa+EOWPHHcR3bjicLFk+4fURBk+wGFtGAdF5yuAIz3NGWqFkaxzC1y+J33U/AyZ+Ooxy/qCzfrliROc8WrF3mssz/Jy/ybjgeu7zBM3Dw2pg0SzAcqXMWa7mCezR2sJXkgd66vxn2quJc5DJeZV0d2hCTZcfaUeDL+CV+EdYNg69YEydt1KmGs0AdV9IKI8f1GhZqaKyIXlLW28ae2oymUDsoB0leNwH7xJU51JhsCAQ6ReJV6lvSq1tPVXlCk+c+W3/mSvvD2HwLh12kNaynp+oTGneBsrwsfK8keeg044ppPWYW6zyBDaqpDH5cAdQI3gPK8YrNTZhL2IrrXn61A8J+04mX6UbOjXc+VnVjm7RRR61ex9wSj990WbQe5+gewHpSOT9SzXuT9sRuh7CRS+qvvVXB98gaiCfzM2eNEtmFnWeAJcr5EXdlYoKdrgDKlTap60etvGp7geFhxCe2cUphht6xQbxha2vIkdNGzia7QY1FwleqGtFNQ3MFbXbCM8hrhGYBmRKBS8lVpflNjO1RyQbUjzwIvESGH4e1nE6dA1ODPwC6cSiLzwetxG4BsqCsxBzwEuCSrTOCbnAbIm+HLik5omzpLzedEFanw/F/byy0oCz4lroAAAAASUVORK5CYII=";
/* initialSettings is the structure of the settings information that we're working with for now.
@@ -171,8 +173,11 @@ function processInputType( category, label, item, node, ui ){
dojo.style( button.domNode.firstChild, "background", setting );
dojo.style( button.domNode.firstChild, "height", "12px" );
dojo.style( button.domNode.firstChild, "width", "12px" );
-
+
c.colornode = button;
+
+ var elements = dojo.query( '.dijitArrowButtonInner', button.domNode );
+ dojo.removeClass( elements[0], 'dijitArrowButtonInner' );
break;
}
@@ -207,6 +212,8 @@ function displaySettings( id ){
processInputType( category, subcategory[sub].label, subcategory[sub].items[item], label, subcategory[sub].ui );
}
}
+
+
}
function addCategory( item ){
@@ -224,69 +231,6 @@ function addPlugins(){
addCategory( item );
}
-function addNewPlugins(){
-
- if( newPluginDialog === false ){
- dojo.removeClass( "newpluginsdialog", "interactionClosed" );
- dojo.addClass( "newpluginsdialog", "interactionOpen" );
- dojo.byId("addpluginscontrol").innerHTML = "Hide Dialog";
- newPluginDialog = true;
- }else{
- dojo.removeClass( "newpluginsdialog", "interactionOpen" );
- dojo.addClass( "newpluginsdialog", "interactionClosed" );
- dojo.byId("addpluginscontrol").innerHTML = "Add Plugins";
- newPluginDialog = false;
- }
-}
-
-
-/* derivePluginNameFromLocation - temporary function -
- the current plugins don't provide useful enough, or
- consistent meta-data to use for descriptions. */
-
-function derivePluginNameFromLocation( location ){
-
- function wordToUpper(strSentence) {
-
- function convertToUpper() {
- return arguments[0].toUpperCase();
- }
-
- return strSentence.toLowerCase().replace(/\b[a-z]/g, convertToUpper);
- }
-
- var divides = location.split( "/" );
- var last = divides[divides.length-1];
- last = last.split( ".html" )[0];
- last = last.replace( /([a-z])([A-Z])/, "$1 $2");
- last = wordToUpper( last );
- return last;
-}
-
-/* pluginUrlFocus - a focus handler for the
- url entry text field */
-
-function pluginUrlFocus(){
- var node = dojo.byId( 'pluginUrlEntry' );
- node.value = '';
- dojo.style( node, "color", "" );
-}
-
-/* pluginUrlFocus - a blue handler for the
- url entry text field */
-
-function pluginUrlBlur(){
- var node = dojo.byId( 'pluginUrlEntry' );
- if( node.value === '' ){
- node.value = 'Type a plugin url here ...';
- dojo.style( node, "color", "#AAA" );
- }
-}
-
-function createpropertiesTable(){
- // TODO: work in progress
-}
-
/* showPlugins - iterates over the plugin array, reads
meta-data and creates a dom entry for each plugin.
@@ -297,8 +241,6 @@ function createpropertiesTable(){
function showPlugins( event ){
- var settingsPluginList = settingsCore.pluginRegistry.getPlugins();
-
if( selectedCategory ){
dojo.removeClass( selectedCategory, "navbar-item-selected" );
}
@@ -313,145 +255,15 @@ function showPlugins( event ){
dojo.empty( tableNode );
- var titleWrapper = dojo.create( "div", {"class":"pluginwrapper"}, tableNode );
-
- var item = { id: "Plugins", "class":"pluginTitle", innerHTML: "Plugins [" + settingsPluginList.length +"]" };
-
- dojo.create( "div", item, titleWrapper );
-
- dojo.create( "a", { id: "oldlink", href:"../plugin/list.html", innerHTML:"Services", "class":"oldLink", onclick:"addNewPlugins()"}, titleWrapper );
-
- dojo.create( "div", { id: "addpluginscontrol", innerHTML:"Add Plugins", "class":"additions", onclick:"addNewPlugins()"}, titleWrapper );
-
- /* The plugins page has a slightly different layout from the other settings pages - so this content
- section provides the slide down capability to reveal the dialog for adding more plugins */
-
- var content = '<div class="displaytable">' +
- '<div id="newpluginsdialog" class="interactionClosed">' +
- '<table id="dev-table" width="100%">' +
- '<tr>' +
- '<td>' +
- '<input id="pluginUrlEntry" type="url" onfocus="pluginUrlFocus()" onblur="pluginUrlBlur()" value="Type a plugin url here ..." name="user_url" style="width:400px;color:#AAA;"/>' +
- '<button onclick="installHandler()">Load this plugin</button>' +
- '</td>' +
- '<td align="right">' +
- '<button id="update-extensions-now" onclick="reloadPlugins()">Re-load all</button>' +
- '</td>' +
- '</tr>' +
- '</table>' +
- '</div>' +
- '<div class="plugin-settings">' +
- '<list id="plugin-settings-list"></list>' +
- '</div>' +
- '</div>';
-
- dojo.place( content, tableNode );
-
- var list = dojo.byId( "plugin-settings-list" );
-
- for( var p = 0; p < settingsPluginList.length; p++ ){
- var plg = settingsPluginList[p].getData();
-
- var location = settingsPluginList[p].getLocation();
-
- var name = derivePluginNameFromLocation( location );
-
- var extensionListItem = dojo.create( "div", { "class":"plugin-list-item" }, list );
- var container = dojo.create( "div", { "class":"container" }, extensionListItem );
- var icon = dojo.create( "img", { "class":"plugin-icon", "src": iconSource }, container );
- var detailsView = dojo.create( "div", { "class":"stretch" }, container );
- var title = dojo.create( "span", { "class":"plugin-title", innerHTML: name }, detailsView );
- dojo.create( "div", null, detailsView );
- var description = dojo.create( "span", { "class":"plugin-description", innerHTML: "A plugin for Eclipse Orion" }, detailsView );
- dojo.create( "a", { "class":"plugin-link", href: location, innerHTML: "Plugin Website" }, detailsView );
-
- var removeButton = dojo.create( "button", { "id":location, "class":"plugin-delete", innerHTML: "Remove", onClick: "removePlugin(event)" }, container );
- }
-}
-
-/* reloads all of the plugins - sometimes useful for reaffirming plugin initialization */
-
-function reloadPlugins(){
-
var settingsPluginList = settingsCore.pluginRegistry.getPlugins();
-
- var count = 0;
- var d = new dojo.Deferred();
-
- for( var i = 0; i < settingsPluginList.length; i++) {
- settingsPluginList[i].update().then( function(){
- count++;
- if( count === settingsPluginList.length ){
- d.resolve();
- }
- });
+ if( pluginWidget ){
+ pluginWidget.destroyRecursive(true);
}
- d.then( function(){
- preferencesStatusService.setMessage( "Reloaded " + settingsPluginList.length + " plugin" + ( settingsPluginList.length===1 ? "": "s") + ".", 5000 );
- showPlugins();
- });
-}
-
-/* removePlugin - removes a plugin by url */
-
-function removePlugin( event ){
-
- /* The id of the source element is programmed with the
- url of the plugin to remove. */
-
- var confirmMessage = "Are you sure you want to uninstall '" + event.srcElement.id + "'?";
-
- preferenceDialogService.confirm( confirmMessage, function( doit ){
-
- if( doit ){
-
- var settingsPluginList = settingsCore.pluginRegistry.getPlugins();
-
- for( var p = 0; p < settingsPluginList.length; p++ ){
- if( settingsPluginList[p].getLocation() === event.srcElement.id ){
- settingsPluginList[p].uninstall();
-
- dojo.byId("pluginUrlEntry").value.value="";
- preferencesStatusService.setMessage("Uninstalled " + event.srcElement.id, 5000);
- preferencesCorePreferences.getPreferences("/plugins").then(function(plugins) {
- plugins.remove(event.srcElement.id);
- }); // this will force a sync
-
- showPlugins();
-
- break;
- }
- }
- }
- });
+ pluginWidget = new orion.widgets.PluginList( { settings: settingsCore, statusService: preferencesStatusService, dialogService:preferenceDialogService }, tableNode );
}
-var installHandler = function(evt) {
- var pluginUrl = dojo.byId("pluginUrlEntry").value;
- if (/^\S+$/.test(dojo.trim(pluginUrl))) {
- preferencesStatusService.setMessage("Installing " + pluginUrl + "...");
- if (settingsCore.pluginRegistry.getPlugin(pluginUrl)) {
- preferencesStatusService.setErrorMessage("Already installed");
- } else {
- settingsCore.pluginRegistry.installPlugin(pluginUrl).then(
- function(plugin) {
-
- dojo.byId("pluginUrlEntry").value.value="";
- preferencesStatusService.setMessage("Installed " + plugin.getLocation(), 5000);
- preferencesCorePreferences.getPreferences("/plugins").then(function(plugins) {
- plugins.put(pluginUrl, true);
- }); // this will force a sync
-
- showPlugins();
-
- }, function(error) {
- preferencesStatusService.setErrorMessage(error);
- });
- }
- }
-};
function selectCategory( event ){
@@ -534,7 +346,7 @@ function manageDefaultData( preferences, settings ){
define(['require', 'dojo', 'orion/bootstrap', 'orion/status', 'orion/commands', 'orion/fileClient',
'orion/searchClient', 'orion/dialogs', 'orion/globalCommands', 'orion/siteService', 'orion/siteUtils', 'orion/siteTree', 'orion/treetable',
- 'dojo/parser', 'dojo/hash', 'dojo/date/locale', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/NewSiteDialog', 'dijit/form/Button', 'dijit/ColorPalette' ],
+ 'dojo/parser', 'dojo/hash', 'dojo/date/locale', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/ServiceCarousel', 'orion/widgets/PluginList', 'dijit/form/Button', 'dijit/ColorPalette' ],
function(require, dojo, mBootstrap, mStatus, mCommands, mFileClient, mSearchClient, mDialogs, mGlobalCommands, mSiteService, mSiteUtils, mSiteTree, mTreeTable) {
dojo.addOnLoad(function() {