Permalink
Browse files

Update to latest orion.client

  • Loading branch information...
mamacdon committed Dec 12, 2012
1 parent d411662 commit bf6e8995633a3fc8618dd97d7e074fd749d0b5c9
Showing with 444 additions and 590 deletions.
  1. +8 −8 lib/orion.client/bundles/org.eclipse.orion.client.core/web/css/editor-theme.css
  2. +20 −1 lib/orion.client/bundles/org.eclipse.orion.client.core/web/css/ide.css
  3. +3 −2 lib/orion.client/bundles/org.eclipse.orion.client.core/web/edit/setup.js
  4. +9 −3 lib/orion.client/bundles/org.eclipse.orion.client.core/web/js-tests/globalSearch/testcase.js
  5. +16 −18 lib/orion.client/bundles/org.eclipse.orion.client.core/web/js-tests/serviceRegistry/testcase.js
  6. +3 −3 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/Deferred.js
  7. +1 −1 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/URL-shim.js
  8. +1 −1 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/commonHTMLFragments.js
  9. +21 −21 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/crawler/searchCrawler.js
  10. +16 −4 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/explorers/explorer-table.js
  11. +12 −4 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/fileClient.js
  12. +0 −7 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js
  13. +28 −49 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/searchClient.js
  14. +60 −59 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/searchExplorer.js
  15. +11 −12 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/searchResults.js
  16. +106 −258 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/searchUtils.js
  17. +2 −2 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/webui/tooltip.js
  18. +3 −2 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/widgets/OpenResourceDialog.js
  19. +29 −29 lib/orion.client/bundles/org.eclipse.orion.client.core/web/orion/widgets/themes/editor/ThemeData.js
  20. +60 −14 lib/orion.client/bundles/org.eclipse.orion.client.core/web/plugins/filePlugin/fileImpl.js
  21. +1 −0 lib/orion.client/bundles/org.eclipse.orion.client.core/web/plugins/filePlugin/webdavImpl.js
  22. +28 −51 lib/orion.client/bundles/org.eclipse.orion.client.core/web/search/search.js
  23. +0 −3 lib/orion.client/bundles/org.eclipse.orion.client.editor/web/examples/textview/textStylerOptions.js
  24. +3 −37 lib/orion.client/bundles/org.eclipse.orion.client.editor/web/orion/editor/textMateStyler.js
  25. +3 −1 lib/orion.client/bundles/org.eclipse.orion.client.editor/web/orion/textview/textView.js
@@ -16,7 +16,7 @@
font-size: 10pt;
min-width: 50px;
min-height: 50px;
- color: darkSlateGrey;
+ color: #333;
}
.textviewContent {
@@ -37,15 +37,15 @@
*
*************************************************************************************************/
.comment {
- color: darkSeaGreen;
+ color: #3C802C;
}
.token_multiline_comment {
- color: darkSeaGreen;
+ color: #3C802C;
}
.token_doc_comment {
- color: #AAA;
+ color: #3C802C;
}
a.token_singleline_comment, a.token_multiline_comment, a.token_doc_comment {
@@ -65,15 +65,15 @@ a.token_singleline_comment, a.token_multiline_comment, a.token_doc_comment {
}
.token-string {
- color: cornflowerBlue; /* was blue; */
+ color: #446fbd; /* was blue; */
}
.token_number {
color: blue;
}
.token_keyword {
- color: darkOrange; /* originally darkred; */
+ color: #CC4C07; /* originally darkred; */
font-weight: bold;
}
@@ -179,7 +179,7 @@ a.token_singleline_comment, a.token_multiline_comment, a.token_doc_comment {
/* Hardcoded HTML styles */
.entity-name-tag /*tag name*/ {
- color: darkOrange;
+ color: #CC4C07;
}
.entity-other-attribute-name {
@@ -225,7 +225,7 @@ a.token_singleline_comment, a.token_multiline_comment, a.token_doc_comment {
*************************************************************************************************/
.entity-other-attribute-name {
- color: darkSeaGreen;
+ color: #3C802C;
}
.punctuation-definition-comment {
@@ -158,8 +158,18 @@ h2 {
.parameterPopup {
min-width: 15em;
max-width: 100em;
+ color: #333;
+}
+
+.parameterPopup > label{
+ color: #333;
}
+.parameterPopup > input{
+ color: #333;
+}
+
+
.navTableHeading {
color: #404040;
border-bottom: 1px solid #404040;
@@ -726,7 +736,7 @@ input {
text-indent: none;
text-indent: 0px;
text-shadow: none;
- border: none;
+ border: solid 1px #555;
border-radius: 2px;
color: #333;
font-size: 9pt;
@@ -844,6 +854,15 @@ input {
}
+#folderNameparameterCollector{
+ color:#333;
+}
+
+#urlparameterCollector{
+ color:#333;
+}
+
+
.setting-control {
display: inline-block;
width: 200px;
@@ -419,9 +419,10 @@ exports.setUpEditor = function(serviceRegistry, preferences, isReadOnly){
var b = dojo.create("b", null, searchFloat, "last"); //$NON-NLS-1$ //$NON-NLS-0$
dojo.place(document.createTextNode("\"" + searchPattern + "\"..."), b, "only"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
searchFloat.style.display = "block"; //$NON-NLS-0$
- var query = searcher.createSearchQuery(searchPattern, null, "Name", true); //$NON-NLS-0$
+ var searchParams = searcher.createSearchParams(searchPattern, false, true);
+ searchParams.sort = "Name asc"; //$NON-NLS-0$
var renderer = searcher.defaultRenderer.makeRenderFunction(null, searchFloat, false);
- searcher.search(query, inputManager.getInput(), renderer, true);
+ searcher.search(searchParams, inputManager.getInput(), renderer);
}, 0);
return true;
}, {name: messages["Search Files"]}); //$NON-NLS-0$
@@ -24,10 +24,16 @@ define(["dojo", "orion/assert", "orion/searchUtils"], function(dojo, assert, mSe
* Search in a file with key word and return the file model node.
*/
function searchInFile(fileContentText, keyword, replacing) {
- var inFileQuery = mSearchUtils.generateInFileQuery(keyword);
+ var searchHelper = mSearchUtils.generateSearchHelper({
+ resource: "Temp",
+ sort: "Path asc",
+ rows: 40,
+ start: 0,
+ keyword: keyword
+ });
var fileModel = makeFileModel();
- mSearchUtils.searchWithinFile(inFileQuery, fileModel, fileContentText, "\n", replacing);
- return {m: fileModel, q:inFileQuery};
+ mSearchUtils.searchWithinFile(searchHelper.inFileQuery, fileModel, fileContentText, "\n", replacing);
+ return {m: fileModel, q:searchHelper.inFileQuery};
}
/**
@@ -11,7 +11,7 @@
/*global define console setTimeout*/
-define(["orion/assert", "orion/serviceregistry", "orion/EventTarget"], function(assert, mServiceRegistry, EventTarget) {
+define(["orion/assert", "orion/serviceregistry", "orion/EventTarget", "orion/Deferred"], function(assert, mServiceRegistry, EventTarget, Deferred) {
var tests = {};
tests.testRegisterAndGetService = function() {
var count = 0;
@@ -30,26 +30,24 @@ define(["orion/assert", "orion/serviceregistry", "orion/EventTarget"], function(
assert.equal(count, 0);
var service1 = registry.getService("testRegister");
- service1.test().then(function(newcount) {
+ var service2;
+
+ return service1.test().then(function(newcount) {
count = newcount;
- });
- assert.equal(count, 1);
-
- var service2 = registry.getService(reference);
- service2.test().then(function(newcount) {
+ }).then(function() {
+ assert.equal(count, 1);
+ }).then(function() {
+ service2 = registry.getService(reference);
+ return service2.test();
+ }).then(function(newcount) {
count = newcount;
+ }).then(function() {
+ assert.equal(count, 2);
+ }).then(function() {
+ assert.equal(service1, service2);
+ registration.unregister();
+ assert["throws"](service2.test);
});
- assert.equal(count, 2);
-
- // contrived
- assert.equal(service1, service2);
- registration.unregister();
- assert["throws"](function() {
- service2.test().then(function(newcount) {
- count = newcount;
- });
- });
- assert.equal(count, 2);
};
tests.testRegisterUnregisterMultipleServices = function() {
@@ -8,7 +8,7 @@
*
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
-/*global exports module define*/
+/*global exports module define setTimeout*/
(function(root, factory) { // UMD
if (typeof define === 'function' && define.amd) {
define(factory);
@@ -39,7 +39,7 @@
return;
}
running = true;
- do {
+ setTimeout(function() {
while (fn) {
fn();
if (remainingHead) {
@@ -60,7 +60,7 @@
}
}
running = false;
- } while (running);
+ }, 0);
}
function noReturn(fn) {
@@ -415,7 +415,7 @@
}
});
- if (window.URL.createObjectURL) {
+ if (window.URL && window.URL.createObjectURL) {
Object.defineProperty(URL, "createObjectURL", {
value: window.URL.createObjectURL.bind(window.URL),
enumerable: false
@@ -91,7 +91,7 @@ define(['i18n!orion/nls/messages', 'require', 'orion/webui/littlelib'],
'<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>' + //$NON-NLS-0$
'<img class="layoutRight progressPane" src="'+ require.toUrl("images/none.png") +'" id="progressPane" tabindex="0" role="progressbar" aria-label="Operations - Press spacebar to show current operations"></img>' + //$NON-NLS-4$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
'<div class="layoutRight" style="padding-left:7px;padding-right:7px;margin-top:3px;" id="settingsTab" style="visibility:hidden;">' +
- '<div class="layoutRight settings core-sprite-settings" id="settingsAction" role="settings" aria-live="off" style="visibility:hidden;"></div>' + //$NON-NLS-0$
+ '<div class="layoutRight core-sprite-settings" id="settingsAction" role="settings" aria-live="off" style="visibility:hidden;"></div>' + //$NON-NLS-0$
'</div>' +
'<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>' + //$NON-NLS-0$
'<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>' + //$NON-NLS-0$
@@ -21,11 +21,11 @@ define(['i18n!orion/crawler/nls/messages', 'require', 'orion/searchUtils', 'orio
* It basically visits all the children recursively under a given directory location and search on a given keyword, either literal or wild card.
* @param {serviceRegistry} serviceRegistry The service registry.
* @param {fileClient} fileClient The file client that provides fetchChildren and read APIs.
- * @param {String} queryStr The query string. This is temporary for now. The format is "?sort=Path asc&rows=40&start=0&q=keyword+Location:/file/e/bundles/\*"
+ * @param {Object} searchParams The search parameters.
* @param {Object} options Not used yet. For future use.
* @name orion.search.SearchCrawler
*/
- function SearchCrawler( serviceRegistry, fileClient, queryStr, options) {
+ function SearchCrawler( serviceRegistry, fileClient, searchParams, options) {
this.registry= serviceRegistry;
this.fileClient = fileClient;
this.fileLocations = [];
@@ -35,13 +35,13 @@ define(['i18n!orion/crawler/nls/messages', 'require', 'orion/searchUtils', 'orio
this._searchOnName = options && options.searchOnName;
this._buildSkeletonOnly = options && options.buildSkeletonOnly;
this._fetchChildrenCallBack = options && options.fetchChildrenCallBack;
- this.queryObj = (this._searchOnName || this._buildSkeletonOnly) ? null: mSearchUtils.parseQueryStr(queryStr);
+ this.searchHelper = (this._searchOnName || this._buildSkeletonOnly) ? null: mSearchUtils.generateSearchHelper(searchParams);
this._location = options && options.location;
this._childrenLocation = options && options.childrenLocation ? options.childrenLocation : this._location;
}
/**
- * Do search based on this.queryObj.
+ * Do search based on this.searchHelper.
* @param {Function} onComplete The callback function on search complete. The array of hit file locations are passed to the callback.
*/
SearchCrawler.prototype.search = function(onComplete){
@@ -74,9 +74,9 @@ define(['i18n!orion/crawler/nls/messages', 'require', 'orion/searchUtils', 'orio
* @param {String} queryStr The query string. This is temporary for now. The format is "?sort=Path asc&rows=40&start=0&q=keyword+Location:/file/e/bundles/\*"
* @param {Function} onComplete The callback function on search complete. The array of hit file locations are passed to the callback.
*/
- SearchCrawler.prototype.searchName = function(queryStr, onComplete){
- if(queryStr){
- this.queryObj = mSearchUtils.parseQueryStr(queryStr, true);
+ SearchCrawler.prototype.searchName = function(searchParams, onComplete){
+ if(searchParams){
+ this.searchHelper = mSearchUtils.generateSearchHelper(searchParams, true);
}
if(onComplete){
this.onSearchNameComplete = onComplete;
@@ -87,14 +87,14 @@ define(['i18n!orion/crawler/nls/messages', 'require', 'orion/searchUtils', 'orio
for (var i = 0; i < this.fileSkeleton.length ; i++){
var lineString = this.fileSkeleton[i].Name.toLowerCase();
var result;
- if(this.queryObj.inFileQuery.wildCard){
- result = mSearchUtils.searchOnelineRegEx(this.queryObj.inFileQuery, lineString, true);
+ if(this.searchHelper.inFileQuery.wildCard){
+ result = mSearchUtils.searchOnelineRegEx(this.searchHelper.inFileQuery, lineString, true);
} else {
- result = mSearchUtils.searchOnelineLiteral(this.queryObj.inFileQuery, lineString, true);
+ result = mSearchUtils.searchOnelineLiteral(this.searchHelper.inFileQuery, lineString, true);
}
if(result){
results.push(this.fileSkeleton[i]);
- if(results.length >= this.queryObj.rows){
+ if(results.length >= this.searchHelper.params.rows){
break;
}
}
@@ -105,7 +105,7 @@ define(['i18n!orion/crawler/nls/messages', 'require', 'orion/searchUtils', 'orio
};
/**
- * Do search based on this.queryObj.
+ * Do search based on this.searchHelper.
* @param {Function} onComplete The callback function on search complete. The array of hit file locations are passed to the callback.
*/
SearchCrawler.prototype.buildSkeleton = function(onBegin, onComplete){
@@ -118,7 +118,7 @@ define(['i18n!orion/crawler/nls/messages', 'require', 'orion/searchUtils', 'orio
var result = that._visitRecursively(that._childrenLocation).then(function(){ //$NON-NLS-0$
that._buildingSkeleton = false;
onComplete();
- if(that.queryObj && !that._buildSkeletonOnly){
+ if(that.searchHelper && !that._buildSkeletonOnly){
that.searchName();
}
});
@@ -152,11 +152,11 @@ define(['i18n!orion/crawler/nls/messages', 'require', 'orion/searchUtils', 'orio
};
SearchCrawler.prototype._onFileType = function(contentType){
- if(this.queryObj.advOptions && this.queryObj.advOptions.type){
- if(this.queryObj.advOptions.type === mSearchUtils.ALL_FILE_TYPE){
+ if(this.searchHelper.params.fileType){
+ if(this.searchHelper.params.fileType === mSearchUtils.ALL_FILE_TYPE){
return true;
}
- return contentType.extension.indexOf(this.queryObj.advOptions.type) >= 0;
+ return contentType.extension.indexOf(this.searchHelper.params.fileType) >= 0;
}
return true;
};
@@ -192,10 +192,10 @@ define(['i18n!orion/crawler/nls/messages', 'require', 'orion/searchUtils', 'orio
SearchCrawler.prototype._hitOnceWithinFile = function( fileContentText){
var lineString = fileContentText.toLowerCase();
var result;
- if(this.queryObj.inFileQuery.wildCard){
- result = mSearchUtils.searchOnelineRegEx(this.queryObj.inFileQuery, lineString, true);
+ if(this.searchHelper.inFileQuery.wildCard){
+ result = mSearchUtils.searchOnelineRegEx(this.searchHelper.inFileQuery, lineString, true);
} else {
- result = mSearchUtils.searchOnelineLiteral(this.queryObj.inFileQuery, lineString, true);
+ result = mSearchUtils.searchOnelineLiteral(this.searchHelper.inFileQuery, lineString, true);
}
return result;
};
@@ -212,7 +212,7 @@ define(['i18n!orion/crawler/nls/messages', 'require', 'orion/searchUtils', 'orio
SearchCrawler.prototype._sniffSearch = function(fileObj){
this._totalCounter++;
var self = this;
- if(this.queryObj.searchStr === ""){
+ if(this.searchHelper.params.keyword === ""){
this._reportSingleHit(fileObj);
this.registry.getService("orion.page.message").setProgressResult({Message: dojo.string.substitute(messages["${0} files found out of ${1}"], [this._hitCounter, this._totalCounter])});
} else {
@@ -233,7 +233,7 @@ define(['i18n!orion/crawler/nls/messages', 'require', 'orion/searchUtils', 'orio
SearchCrawler.prototype._buildSingleSkeleton = function(fileObj){
this._totalCounter++;
this.fileSkeleton.push(fileObj);
- if(this.queryObj && !this._buildSkeletonOnly && this._totalCounter%100 === 0){
+ if(this.searchHelper && !this._buildSkeletonOnly && this._totalCounter%100 === 0){
this.searchName();
}
//console.log("skeltoned files : "+ this._totalCounter);
@@ -154,14 +154,26 @@ define(['i18n!orion/navigate/nls/messages', 'require', 'dojo', 'orion/fileUtils'
}
} else if (entry.isDirectory) {
var dirReader = entry.createReader();
- fileClient.createFolder(target.Location, entry.name).then(function(subFolder) {
- explorer.changedItem(target, true);
+ var traverseChildren = function(folder) {
dirReader.readEntries(function(entries) {
for (var i=0; i<entries.length; i++) {
- dropFileEntry(entries[i], path + entry.name + "/", subFolder, explorer, performDrop, fileClient); //$NON-NLS-0$
+ dropFileEntry(entries[i], path + entry.name + "/", folder, explorer, performDrop, fileClient); //$NON-NLS-0$
}
});
- });
+ };
+ if (target.Location.indexOf('/workspace') === 0){ //$NON-NLS-0$
+ fileClient.createProject(target.ChildrenLocation, entry.name).then(function(project) {
+ explorer.loadResourceList(explorer.treeRoot.Path, true);
+ fileClient.read(project.ContentLocation, true).then(function(folder) {
+ traverseChildren(folder);
+ });
+ });
+ } else {
+ fileClient.createFolder(target.Location, entry.name).then(function(subFolder) {
+ explorer.changedItem(target, true);
+ traverseChildren(subFolder);
+ });
+ }
}
}
Oops, something went wrong.

0 comments on commit bf6e899

Please sign in to comment.