Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 217646 Details for
Bug 382749
consider creating a password type for the console
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
patch to start with, obviously wrong
patch.txt (text/plain), 5.59 KB, created by
Grant Gayed
on 2012-06-20 13:54:40 EDT
(
hide
)
Description:
patch to start with, obviously wrong
Filename:
MIME Type:
Creator:
Grant Gayed
Created:
2012-06-20 13:54:40 EDT
Size:
5.59 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.core/web/console/consolePage.js b/bundles/org.eclipse.orion.client.core/web/console/consolePage.js >index cae9fc1..669d31f 100644 >--- a/bundles/org.eclipse.orion.client.core/web/console/consolePage.js >+++ b/bundles/org.eclipse.orion.client.core/web/console/consolePage.js >@@ -14,8 +14,8 @@ > /*jslint browser:true*/ > > define(['i18n!orion/console/nls/messages', 'require', 'dojo', 'dijit', 'orion/bootstrap', 'orion/commands', 'orion/fileClient', 'orion/searchClient', 'orion/globalCommands', >- 'orion/widgets/Console', 'console/current-directory', 'console/paramType-file', 'orion/plugin'], >- function(messages, require, dojo, dijit, mBootstrap, mCommands, mFileClient, mSearchClient, mGlobalCommands, mConsole, mCurrentDirectory, mFileParamType) { >+ 'orion/widgets/Console', 'console/current-directory', 'console/paramType-file', 'console/paramType-hidden', 'orion/plugin'], >+ function(messages, require, dojo, dijit, mBootstrap, mCommands, mFileClient, mSearchClient, mGlobalCommands, mConsole, mCurrentDirectory, mFileParamType, mHiddenParamType) { > > var fileClient; > >@@ -272,10 +272,12 @@ > dijit.byId("centerPane").resize(); //$NON-NLS-0$ > > /* add the locally-defined types */ >- var directoryType = new mFileParamType.ParamTypeFile("directory", true, false); //$NON-NLS-0$ >+ var directoryType = new mFileParamType.ParamTypeFile(true, false); > console.addType(directoryType); >- var fileType = new mFileParamType.ParamTypeFile("file", false, true); //$NON-NLS-0$ >+ var fileType = new mFileParamType.ParamTypeFile(false, true); > console.addType(fileType); >+ var hiddenType = new mHiddenParamType.ParamTypeHidden(); >+ console.addType(hiddenType); > > /* add the locally-defined commands */ > console.addCommand({ >diff --git a/bundles/org.eclipse.orion.client.core/web/console/paramType-file.js b/bundles/org.eclipse.orion.client.core/web/console/paramType-file.js >index 9c06f5f..fd1304c 100644 >--- a/bundles/org.eclipse.orion.client.core/web/console/paramType-file.js >+++ b/bundles/org.eclipse.orion.client.core/web/console/paramType-file.js >@@ -19,13 +19,12 @@ > orion.consolePage = {}; > > orion.consolePage.ParamTypeFile = (function() { >- function ParamTypeFile(name, directories, files) { >- this._init(name, directories, files); >+ function ParamTypeFile(directories, files) { >+ this._init(directories, files); > } > > ParamTypeFile.prototype = { >- _init: function(name, directories, files) { >- this.name = name; >+ _init: function(directories, files) { > this.directories = directories; > this.files = files; > this._initCache(); >@@ -58,6 +57,15 @@ > } > ); > }, >+ getName: function() { >+ if (this.files && !this.directories) { >+ return "file"; //$NON-NLS-0$ >+ } >+ if (!this.files && this.directories) { >+ return "directory"; //$NON-NLS-0$ >+ } >+ return "fileOrDirectory"; //$NON-NLS-0$ >+ }, > /** > * This function is invoked by the console to query for the completion > * status and predictions for an argument with this parameter type. >diff --git a/bundles/org.eclipse.orion.client.core/web/console/paramType-hidden.js b/bundles/org.eclipse.orion.client.core/web/console/paramType-hidden.js >new file mode 100644 >index 0000000..eecea36 >--- /dev/null >+++ b/bundles/org.eclipse.orion.client.core/web/console/paramType-hidden.js >@@ -0,0 +1,51 @@ >+/******************************************************************************* >+ * @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: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+/*global define*/ >+ >+define(['orion/widgets/Console'], function(mConsole) { >+ >+ var orion = {}; >+ orion.consolePage = {}; >+ >+ orion.consolePage.ParamTypeHidden = (function() { >+ function ParamTypeHidden() { >+ } >+ ParamTypeHidden.prototype = { >+ getName: function(arg) { >+ return "hidden"; //$NON-NLS-0$ >+ }, >+ parse: function(arg) { >+ return { >+ value: arg, >+ status: mConsole.CompletionStatus.MATCH, >+ message: undefined, >+ predictions: [{name: this._convertToHidden(arg), value: arg}]}; >+ }, >+ stringify: function(value) { >+ return this._convertToHidden(value); >+ }, >+ /* internal */ >+ _convertToHidden: function(string) { >+ var length = string.length; >+ var result = ""; >+ for (var i = 0; i < length; i++) { >+ result += "*"; //$NON-NLS-0$ >+ } >+ return result; >+ } >+ }; >+ return ParamTypeHidden; >+ }()); >+ >+ return orion.consolePage; >+}); >diff --git a/bundles/org.eclipse.orion.client.core/web/orion/widgets/Console.js b/bundles/org.eclipse.orion.client.core/web/orion/widgets/Console.js >index c447106..f7d0b0a 100644 >--- a/bundles/org.eclipse.orion.client.core/web/orion/widgets/Console.js >+++ b/bundles/org.eclipse.orion.client.core/web/orion/widgets/Console.js >@@ -159,7 +159,7 @@ > function NewType(typeSpec) {} > > NewType.prototype = Object.create(CustomType.prototype); >- NewType.prototype.name = type.name; >+ NewType.prototype.name = type.getName(); > NewType.prototype.parse = function (arg) { > var completion = type.parse(arg.toString().trim()); > var status = mTypes.Status.VALID;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 382749
: 217646