summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorelijahe <elijahe@ca.ibm.com>2014-06-16 16:36:38 -0400
committerelijahe <elijahe@ca.ibm.com>2014-06-16 16:36:38 -0400
commitfec4c4efa37e74032058592291406b810d9c7278 (patch)
treec87725b0915da85db45dab1e89b711e20a4913f7
parent983518fb82ba211324220ba4782aba670630cee9 (diff)
downloadorg.eclipse.orion.client-origin/findFileButton.zip
org.eclipse.orion.client-origin/findFileButton.tar.gz
org.eclipse.orion.client-origin/findFileButton.tar.bz2
Added a button which triggers the "Find file" dialog to the Editor pageorigin/findFileButton
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/css/controls.css10
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/widgets/nav/mini-nav.js20
2 files changed, 26 insertions, 4 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/css/controls.css b/bundles/org.eclipse.orion.client.ui/web/css/controls.css
index 55a33c2..8df1465 100644
--- a/bundles/org.eclipse.orion.client.ui/web/css/controls.css
+++ b/bundles/org.eclipse.orion.client.ui/web/css/controls.css
@@ -1215,3 +1215,13 @@ textarea.parameterInput {
font-size: 12px;
color: #222;
}
+
+.commandButton.filterButton {
+ float: right;
+ margin: 5px 2px 2px 2px;
+}
+
+.filterButton > .filterButtonSpan {
+ font-size: 12px;
+}
+
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/nav/mini-nav.js b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/nav/mini-nav.js
index 9f43e9c..076e20b 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/nav/mini-nav.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/nav/mini-nav.js
@@ -15,12 +15,11 @@ define([
'orion/objects',
'orion/webui/littlelib',
'orion/widgets/nav/common-nav',
- 'orion/fileCommands',
'orion/PageUtil',
- 'orion/Deferred',
'orion/widgets/filesystem/filesystemSwitcher',
+ 'orion/keyBinding',
'orion/URL-shim'
-], function(messages, objects, lib, mCommonNav, FileCommands, PageUtil, Deferred, mFilesystemSwitcher, _) {
+], function(messages, objects, lib, mCommonNav, PageUtil, mFilesystemSwitcher, KeyBinding, _) {
var CommonNavExplorer = mCommonNav.CommonNavExplorer;
var CommonNavRenderer = mCommonNav.CommonNavRenderer;
@@ -117,6 +116,19 @@ define([
toolbarNode: this.toolbarNode
});
+ // filter button
+ var domNodeWrapperList = [];
+ this.commandRegistry.registerCommandContribution(this.toolbarNode.id, "orion.openResource", 100, null, false, new KeyBinding.KeyBinding('f', true, true)); //$NON-NLS-1$ //$NON-NLS-0$
+ this.commandRegistry.renderCommands(this.toolbarNode.id, this.toolbarNode, [], this, "button", null, domNodeWrapperList); //$NON-NLS-0$
+ var filterButton = domNodeWrapperList[0].domNode; //$NON-NLS-0$
+ lib.empty(filterButton);
+ filterButton.classList.add("filterButton"); //$NON-NLS-0$
+
+ var filterSpan = document.createElement("span"); //$NON-NLS-0$
+ filterSpan.classList.add("core-sprite-outline"); //$NON-NLS-0$
+ filterSpan.classList.add("filterButtonSpan"); //$NON-NLS-0$
+ filterButton.appendChild(filterSpan);
+
// Create switcher here
this.fsSwitcher = new mFilesystemSwitcher.FilesystemSwitcher({
commandRegistry: this.commandRegistry,
@@ -126,7 +138,7 @@ define([
node: this.toolbarNode,
serviceRegistry: this.serviceRegistry
});
-
+
var params = PageUtil.matchResourceParameters();
var navigate = params.navigate, resource = params.resource;
var root = navigate || this.lastRoot || this.fileClient.fileServiceRootURL(resource || ""); //$NON-NLS-0$