Просмотр исходного кода

No ticket. Updating all the bootstraps to include the package name of their js requirements. Updating some whitespace in CCS.Filebrowser.js

Aaron Newton 15 лет назад
Родитель
Сommit
a0eaf80abe

+ 1 - 1
apps/about/static/bootstrap.js

@@ -16,7 +16,7 @@
 CCS.Desktop.register({
 CCS.Desktop.register({
 	About : {
 	About : {
 		name: 'About Hue',
 		name: 'About Hue',
-		require: ['CCS.JBrowser'],
+		require: ['ccs-shared/CCS.JBrowser'],
 		launch: function(path, options){
 		launch: function(path, options){
 			return new CCS.JBrowser('/about/', $merge({
 			return new CCS.JBrowser('/about/', $merge({
 				displayHistory: false,
 				displayHistory: false,

+ 1 - 1
apps/beeswax/static/bootstrap.js

@@ -16,7 +16,7 @@
 CCS.Desktop.register({
 CCS.Desktop.register({
 	Beeswax: {
 	Beeswax: {
 		name: 'Beeswax for Hive',
 		name: 'Beeswax for Hive',
-		require: ['CCS.Beeswax'],
+		require: ['beeswax/CCS.Beeswax'],
 		launch: function(path, options) {
 		launch: function(path, options) {
 			return new CCS.Beeswax(path, options);
 			return new CCS.Beeswax(path, options);
 		},
 		},

+ 1 - 1
apps/filebrowser/src/filebrowser/static/bootstrap.js

@@ -17,7 +17,7 @@ CCS.Desktop.register({
 	FileBrowser: {
 	FileBrowser: {
 		name: 'File Browser',
 		name: 'File Browser',
 		css: '/filebrowser/static/css/fb.css',
 		css: '/filebrowser/static/css/fb.css',
-		require: ['CCS.FileBrowser'],
+		require: ['filebrowser/CCS.FileBrowser'],
 		launch: function(path, options){
 		launch: function(path, options){
 			return new CCS.FileBrowser(path || 'filebrowser/view/?default_to_home=1', options);
 			return new CCS.FileBrowser(path || 'filebrowser/view/?default_to_home=1', options);
 		},
 		},

+ 87 - 87
apps/filebrowser/src/filebrowser/static/js/Source/FileBrowser/CCS.FileBrowser.js

@@ -169,7 +169,7 @@ ART.Sheet.define('window.filechooser.browser', {
 					keys: 'keydown:backspace',
 					keys: 'keydown:backspace',
 					shortcut: 'backspace',
 					shortcut: 'backspace',
 					handler: function(e){
 					handler: function(e){
-                                                if ($(e.target).match('input, textarea')) return;
+						if ($(e.target).match('input, textarea')) return;
 						e.stop();
 						e.stop();
 						var table = this.getDirList().retrieve('HtmlTable');
 						var table = this.getDirList().retrieve('HtmlTable');
 						//the view only allows one item to be selected at a time currently
 						//the view only allows one item to be selected at a time currently
@@ -201,16 +201,16 @@ ART.Sheet.define('window.filechooser.browser', {
 
 
 		//when jframe loads, set up the content
 		//when jframe loads, set up the content
 		setup: function(view){
 		setup: function(view){
-                        if (!this._shortcutsAdded) {
-			        this.addFBShortcuts();
-			        this._shortcutsAdded = true;
+			if (!this._shortcutsAdded) {
+				this.addFBShortcuts();
+				this._shortcutsAdded = true;
 			}
 			}
 			this.setupHistory();
 			this.setupHistory();
 			this.addLinkers();
 			this.addLinkers();
 			this.removeOkEvents();
 			this.removeOkEvents();
 			this.addSaverInfo();
 			this.addSaverInfo();
 			this.addRowFocusEvents();
 			this.addRowFocusEvents();
-                        			//make the uploader
+						//make the uploader
 			(function(){
 			(function(){
 				//note we have a very short delay here; the DOM needs a moment to be there or else you sometimes
 				//note we have a very short delay here; the DOM needs a moment to be there or else you sometimes
 				//get the error "obj.CallFunction is not a function" which means that the JS can't communicate with
 				//get the error "obj.CallFunction is not a function" which means that the JS can't communicate with
@@ -230,12 +230,12 @@ ART.Sheet.define('window.filechooser.browser', {
 			return this.jframe.currentPath.split("?")[0].replace('/' + this.options.filesystem + '/' + this.options.view, '');
 			return this.jframe.currentPath.split("?")[0].replace('/' + this.options.filesystem + '/' + this.options.view, '');
 		},
 		},
 
 
-                getClickPath: function(selected){
-                        var dblclickdelegate = selected.get('data', 'dblclick-delegate', true);
-                        if (dblclickdelegate) var dblclick_loads = dblclickdelegate.dblclick_loads;
-                        if (dblclick_loads) var elemLoad = selected.getElement(dblclick_loads);
-                        if (elemLoad) return elemLoad.href; 
-                }
+		getClickPath: function(selected){
+			var dblclickdelegate = selected.get('data', 'dblclick-delegate', true);
+			if (dblclickdelegate) var dblclick_loads = dblclickdelegate.dblclick_loads;
+			if (dblclick_loads) var elemLoad = selected.getElement(dblclick_loads);
+			if (elemLoad) return elemLoad.href; 
+		}
 
 
 
 
 
 
@@ -357,7 +357,7 @@ ART.Sheet.define('window.filechooser.browser', {
 				return this.caption || "Choose Where To Save This File";
 				return this.caption || "Choose Where To Save This File";
 			}.bind(this)
 			}.bind(this)
 		},
 		},
-                //append an input to the alert, allowing the user to view/enter the path where the file will be saved
+		//append an input to the alert, allowing the user to view/enter the path where the file will be saved
 		addSaverInfo: function() {
 		addSaverInfo: function() {
 			var locationInput = new Element("input", {
 			var locationInput = new Element("input", {
 				'type' : 'text',
 				'type' : 'text',
@@ -372,29 +372,29 @@ ART.Sheet.define('window.filechooser.browser', {
 			locationDiv.inject($(this.footer), 'top');
 			locationDiv.inject($(this.footer), 'top');
 			this.locationInput = locationInput;
 			this.locationInput = locationInput;
 		},
 		},
-                //add events which will occur when rows of filebrowser table are focused 
+		//add events which will occur when rows of filebrowser table are focused 
 		addRowFocusEvents: function(){
 		addRowFocusEvents: function(){
-                        var table = $(this).getElement('[data-filters*=HtmlTable]');
-                        if(!table) return;
-                        var hTable = table.retrieve('HtmlTable');
-                        var locationInput = $(this).getElement('.fs-locationInput');
-                        hTable.addEvent('rowFocus', function(row) {
-                                var selectData = row.get('data', 'filedata', true);
-                                if (selectData.type == 'file') {
-                                        //Doesn't make sense to do this if overwriting files is not possible.
-                                        //locationInput.set('value', targetData.path.split('/').getLast());
-                                        this.getOk().setText("Save");
-                                }
-                                if (selectData.type =='dir') {
-                                        locationInput.set('value', this.options.fileToMove);
-                                        this.getOk().setText("Open");
-                                }
-                        }.bind(this));
+			var table = $(this).getElement('[data-filters*=HtmlTable]');
+			if(!table) return;
+			var hTable = table.retrieve('HtmlTable');
+			var locationInput = $(this).getElement('.fs-locationInput');
+			hTable.addEvent('rowFocus', function(row) {
+				var selectData = row.get('data', 'filedata', true);
+				if (selectData.type == 'file') {
+					//Doesn't make sense to do this if overwriting files is not possible.
+					//locationInput.set('value', targetData.path.split('/').getLast());
+					this.getOk().setText("Save");
+				}
+				if (selectData.type =='dir') {
+					locationInput.set('value', this.options.fileToMove);
+					this.getOk().setText("Open");
+				}
+			}.bind(this));
 
 
 		},
 		},
-                //add keyboard shortcuts for filebrowser
+		//add keyboard shortcuts for filebrowser
 		addFBShortcuts: function(){
 		addFBShortcuts: function(){
-                        this.jframe.addShortcuts({
+			this.jframe.addShortcuts({
 			'Select Highlighted': {
 			'Select Highlighted': {
 				keys: 'enter',
 				keys: 'enter',
 				shortcut: 'enter',
 				shortcut: 'enter',
@@ -418,11 +418,11 @@ ART.Sheet.define('window.filechooser.browser', {
 					} else {
 					} else {
 						this.getOk().fireEvent('press');
 						this.getOk().fireEvent('press');
 					}
 					}
-                                }.bind(this),
+				}.bind(this),
 				description: 'Select the highlighted row or folder.'
 				description: 'Select the highlighted row or folder.'
 			}
 			}
 			});
 			});
-                }
+		}
 	});
 	});
 
 
 	/*
 	/*
@@ -443,10 +443,10 @@ ART.Sheet.define('window.filechooser.browser', {
 				resizable: true
 				resizable: true
 			});
 			});
 			var chooser = new CCS.FileChooser("/filebrowser/view" + fsPath, options);
 			var chooser = new CCS.FileChooser("/filebrowser/view" + fsPath, options);
-                        //set caption when jframe is done loading
+			//set caption when jframe is done loading
 			chooser.jframe.addEvent('loadComplete', function() {
 			chooser.jframe.addEvent('loadComplete', function() {
 				this.setCaption(chooser.getDirPath() + " :: " + caption);
 				this.setCaption(chooser.getDirPath() + " :: " + caption);
-                                chooser.getOk().addEvent('press', function(){
+				chooser.getOk().addEvent('press', function(){
 				var selected = $(chooser).getElement('.table-tr-selected');
 				var selected = $(chooser).getElement('.table-tr-selected');
 				var error = function(){
 				var error = function(){
 					var msg = "Please choose a directory.";
 					var msg = "Please choose a directory.";
@@ -455,27 +455,27 @@ ART.Sheet.define('window.filechooser.browser', {
 					chooser.fireEvent('badSelection', selected);
 					chooser.fireEvent('badSelection', selected);
 				};
 				};
 				if (selected) {
 				if (selected) {
-                                        //If file_filter was part of query, the filtered rows will have a "not-selectable" class.
+					//If file_filter was part of query, the filtered rows will have a "not-selectable" class.
 					if (selected.hasClass('not-selectable')) {
 					if (selected.hasClass('not-selectable')) {
 						error();
 						error();
 						return;
 						return;
 					}
 					}
-                                        var selectedData = selected.get('data', 'filedata', true);
-                                        //Otherwise, use options.filter and the selected row's filedata object to determine whether or not the row should be filtered.
+					var selectedData = selected.get('data', 'filedata', true);
+					//Otherwise, use options.filter and the selected row's filedata object to determine whether or not the row should be filtered.
 					if(selectedData) {
 					if(selectedData) {
-                                                //Ensure that the two values don't conflict.  (Other possible value is 'any', which allows any selection.) If they don't, fire callback.  Otherwise, show error.
-                                                if(selectedData.type == 'file' && options.filter != 'dir' || selectedData.type == 'dir' && options.filter != 'file'){
-                                                        callback(selectedData);
-                                                        chooser.hide();
-                                                } else {
-                                                        error();
-                                                }
-                                        }
+						//Ensure that the two values don't conflict.  (Other possible value is 'any', which allows any selection.) If they don't, fire callback.  Otherwise, show error.
+						if(selectedData.type == 'file' && options.filter != 'dir' || selectedData.type == 'dir' && options.filter != 'file'){
+							callback(selectedData);
+							chooser.hide();
+						} else {
+							error();
+						}
+					}
 				} else if (options.filter == "file") {
 				} else if (options.filter == "file") {
-                                        //If nothing is selected, and filter is 'file', show error.
+					//If nothing is selected, and filter is 'file', show error.
 					error();
 					error();
 				} else {
 				} else {
-                                        //If nothing is selected, and filter is 'dir or any', call callback using chooser's current directory as path.
+					//If nothing is selected, and filter is 'dir or any', call callback using chooser's current directory as path.
 					callback({
 					callback({
 						path: chooser.getDirPath(),
 						path: chooser.getDirPath(),
 						type: 'dir'
 						type: 'dir'
@@ -485,7 +485,7 @@ ART.Sheet.define('window.filechooser.browser', {
 			});
 			});
 
 
 			}.bind(chooser));
 			}.bind(chooser));
-                        //add event on click of ok button which handles filtering and passing of file data to callback 
+			//add event on click of ok button which handles filtering and passing of file data to callback 
 						return chooser;
 						return chooser;
 		});
 		});
 	};
 	};
@@ -498,46 +498,46 @@ ART.Sheet.define('window.filechooser.browser', {
 					fileToMove: toMove
 					fileToMove: toMove
 				});
 				});
 				var saver = new CCS.FileSaver("/filebrowser/view" + fsPath + "?show_upload=false", options);
 				var saver = new CCS.FileSaver("/filebrowser/view" + fsPath + "?show_upload=false", options);
-                                //Set caption on loadComplete
+				//Set caption on loadComplete
 				saver.jframe.addEvent('loadComplete', function() {
 				saver.jframe.addEvent('loadComplete', function() {
 					this.setCaption(saver.getDirPath() + " :: " + caption);
 					this.setCaption(saver.getDirPath() + " :: " + caption);
-                                        var locationInput = $(saver).getElement('.fs-locationInput');
-                                        saver.getOk().addEvent('press', function(){
-                                                //Get selected row of filebrowser table
-                                                var selected = $(saver).getElement('.table-tr-selected');
-                                                var selectedPath, isDirSelected = false;
-                                                // If there is a row selected, navigate to that directory 
-                                                // If not create a selected path based on the current displayed directory
-                                                if(selected) {
-                                                        var selectedData = selected.get('data', 'filedata', true);
-                                                        isDirSelected = selectedData.type == 'dir';
-                                                } else {
-                                                        selectedPath = saver.getDirPath();
-                                                }
-                                                var error = function(){
-                                                        var msg = "Please choose a directory.";
-                                                        if (options.filter == "file") msg = "Please choose a file.";
-                                                        saver.alert(caption || "Choose a File", msg);
-                                                        saver.fireEvent('badSelection', selected);
-                                                };
-                                                //if a directory is selected, naviagte to the selected directory
-                                                if (isDirSelected) {
-                                                        saver.jframe.load({
-                                                                requestPath: saver.getClickPath(selected) 
-                                                        });
-                                                } else {
-                                                        var inputPath = locationInput.get('value');
-                                                        var returnPath; 
-                                                        //An input path belonging with a slash is assumed to be an absolute path.
-                                                        if (inputPath[0] == '/') returnPath = inputPath;
-                                                        else returnPath = saver.getDirPath() + '/' + inputPath;
-                                                        callback({
-                                                                path: returnPath,
-                                                                type: 'dir'
-                                                        });
-                                                        saver.hide();
-                                                }
-                                        });
+					var locationInput = $(saver).getElement('.fs-locationInput');
+					saver.getOk().addEvent('press', function(){
+						//Get selected row of filebrowser table
+						var selected = $(saver).getElement('.table-tr-selected');
+						var selectedPath, isDirSelected = false;
+						// If there is a row selected, navigate to that directory 
+						// If not create a selected path based on the current displayed directory
+						if(selected) {
+							var selectedData = selected.get('data', 'filedata', true);
+							isDirSelected = selectedData.type == 'dir';
+						} else {
+							selectedPath = saver.getDirPath();
+						}
+						var error = function(){
+							var msg = "Please choose a directory.";
+							if (options.filter == "file") msg = "Please choose a file.";
+							saver.alert(caption || "Choose a File", msg);
+							saver.fireEvent('badSelection', selected);
+						};
+						//if a directory is selected, naviagte to the selected directory
+						if (isDirSelected) {
+							saver.jframe.load({
+								requestPath: saver.getClickPath(selected) 
+							});
+						} else {
+							var inputPath = locationInput.get('value');
+							var returnPath; 
+							//An input path belonging with a slash is assumed to be an absolute path.
+							if (inputPath[0] == '/') returnPath = inputPath;
+							else returnPath = saver.getDirPath() + '/' + inputPath;
+							callback({
+								path: returnPath,
+								type: 'dir'
+							});
+							saver.hide();
+						}
+					});
 				}.bind(saver));
 				}.bind(saver));
 				return saver;
 				return saver;
 		});
 		});

+ 1 - 1
apps/help/src/help/static/bootstrap.js

@@ -16,7 +16,7 @@
 CCS.Desktop.register({
 CCS.Desktop.register({
 	Help: {
 	Help: {
 		name: 'Help',
 		name: 'Help',
-		require: ['Help'],
+		require: ['help/Help'],
 		css: '/help/static/css/dv.css',
 		css: '/help/static/css/dv.css',
 		launch: function(path, options){
 		launch: function(path, options){
 			return new Help(path, options);
 			return new Help(path, options);

+ 1 - 1
apps/jframegallery/static/bootstrap.js

@@ -16,7 +16,7 @@
 CCS.Desktop.register({
 CCS.Desktop.register({
 	JFrameGallery: {
 	JFrameGallery: {
 		name: 'JFrame Gallery',
 		name: 'JFrame Gallery',
-		require: ['CCS.JFrameGallery'],
+		require: ['jframe-gallery/CCS.JFrameGallery'],
 		css: '/jframegallery/static/css/jframegallery.css',
 		css: '/jframegallery/static/css/jframegallery.css',
 		launch: function(path, options){
 		launch: function(path, options){
 			return new CCS.JFrameGallery(path, options);
 			return new CCS.JFrameGallery(path, options);

+ 1 - 1
apps/jobbrowser/static/bootstrap.js

@@ -17,7 +17,7 @@ CCS.Desktop.register({
 	JobBrowser: {
 	JobBrowser: {
 		name: 'Job Browser',
 		name: 'Job Browser',
 		css: '/jobbrowser/static/css/jobbrowser.css',
 		css: '/jobbrowser/static/css/jobbrowser.css',
-		require: ["CCS.JobBrowser"],
+		require: ["jobbrowser/CCS.JobBrowser"],
 		launch: function(path, options){
 		launch: function(path, options){
 			return new CCS.JobBrowser(path, options);
 			return new CCS.JobBrowser(path, options);
 		},
 		},

+ 1 - 1
apps/jobsub/static/bootstrap.js

@@ -16,7 +16,7 @@
 CCS.Desktop.register({
 CCS.Desktop.register({
 	JobSub: {
 	JobSub: {
 		name: 'Job Designer',
 		name: 'Job Designer',
-		require: ['CCS.JobSub'],
+		require: ['jobsub/CCS.JobSub'],
 		launch: function(path, options){
 		launch: function(path, options){
 			CCS.Desktop.load("JobBrowser");
 			CCS.Desktop.load("JobBrowser");
 			return new CCS.JobSub(path, options);
 			return new CCS.JobSub(path, options);

+ 1 - 1
apps/useradmin/static/bootstrap.js

@@ -17,7 +17,7 @@ CCS.Desktop.register({
 	UserAdmin: {
 	UserAdmin: {
 		name: 'User Admin',
 		name: 'User Admin',
 		libs: '/useradmin/static/js/libs.json',
 		libs: '/useradmin/static/js/libs.json',
-		require: ['CCS.UserAdmin'],
+		require: ['useradmin/CCS.UserAdmin'],
 		launch: function(path, options) {
 		launch: function(path, options) {
 			return new CCS.UserAdmin(path || '/useradmin/', options);
 			return new CCS.UserAdmin(path || '/useradmin/', options);
 		},
 		},

+ 1 - 1
desktop/core/src/desktop/app_template/src/app_name/static/bootstrap.js

@@ -18,7 +18,7 @@ CCS.Desktop.register({
 		name : '${app_name_spaces}',
 		name : '${app_name_spaces}',
 		//autolaunch: "/${app_name}/",
 		//autolaunch: "/${app_name}/",
 		css : '/${app_name}/static/css/${app_name}.css',
 		css : '/${app_name}/static/css/${app_name}.css',
-		require: [ '${app_name_camel}' ],
+		require: [ '${app_name}/${app_name_camel}' ],
 		launch: function(path, options){
 		launch: function(path, options){
 			// application launch code here 
 			// application launch code here 
 			// example code below: 
 			// example code below: