Sfoglia il codice sorgente

Deleted unused files from Filebrowser

Enrico Berti 13 anni fa
parent
commit
c6095b0b94
35 ha cambiato i file con 0 aggiunte e 2859 eliminazioni
  1. BIN
      apps/filebrowser/src/filebrowser/static/art/edit.png
  2. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_bar.gif
  3. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_chown.png
  4. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_copy.png
  5. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_download.png
  6. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_failed.png
  7. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_file.png
  8. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_move.png
  9. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_new_dir.png
  10. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_offset_begin.png
  11. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_offset_end.png
  12. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_offset_next.png
  13. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_offset_previous.png
  14. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_remove.png
  15. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_rename.png
  16. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_rmdir.png
  17. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_success.png
  18. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_upload.png
  19. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_uploading.png
  20. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_view.png
  21. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_view_binary.png
  22. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_view_location.png
  23. BIN
      apps/filebrowser/src/filebrowser/static/art/fb_view_text.png
  24. BIN
      apps/filebrowser/src/filebrowser/static/art/filebrowser.psd
  25. BIN
      apps/filebrowser/src/filebrowser/static/art/graph.png
  26. BIN
      apps/filebrowser/src/filebrowser/static/art/icon-16x16.png
  27. BIN
      apps/filebrowser/src/filebrowser/static/art/icon_large.png
  28. 0 51
      apps/filebrowser/src/filebrowser/static/bootstrap.js
  29. 0 544
      apps/filebrowser/src/filebrowser/static/css/fb.css
  30. 0 70
      apps/filebrowser/src/filebrowser/static/files.html
  31. 0 1249
      apps/filebrowser/src/filebrowser/static/fileuploader.js
  32. 0 744
      apps/filebrowser/src/filebrowser/static/js/Source/FileBrowser/Hue.FileBrowser.js
  33. 0 106
      apps/filebrowser/src/filebrowser/static/js/Source/FileBrowser/Hue.FileEditor.js
  34. 0 90
      apps/filebrowser/src/filebrowser/static/js/Source/FileBrowser/Hue.FileViewer.js
  35. 0 5
      apps/filebrowser/src/filebrowser/static/js/package.yml

BIN
apps/filebrowser/src/filebrowser/static/art/edit.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_bar.gif


BIN
apps/filebrowser/src/filebrowser/static/art/fb_chown.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_copy.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_download.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_failed.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_file.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_move.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_new_dir.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_offset_begin.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_offset_end.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_offset_next.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_offset_previous.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_remove.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_rename.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_rmdir.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_success.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_upload.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_uploading.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_view.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_view_binary.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_view_location.png


BIN
apps/filebrowser/src/filebrowser/static/art/fb_view_text.png


BIN
apps/filebrowser/src/filebrowser/static/art/filebrowser.psd


BIN
apps/filebrowser/src/filebrowser/static/art/graph.png


BIN
apps/filebrowser/src/filebrowser/static/art/icon-16x16.png


BIN
apps/filebrowser/src/filebrowser/static/art/icon_large.png


+ 0 - 51
apps/filebrowser/src/filebrowser/static/bootstrap.js

@@ -1,51 +0,0 @@
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-Hue.Desktop.register({
-	FileBrowser: {
-		name: 'File Browser',
-		css: '/filebrowser/static/css/fb.css',
-		require: ['filebrowser/Hue.FileBrowser'],
-		launch: function(path, options){
-			return new Hue.FileBrowser(path || 'filebrowser/view/?default_to_home=1', options);
-		},
-		menu: {
-			id: 'hue-filebrowser-menu',
-			img: {
-				src: '/filebrowser/static/art/icon.png'
-			}
-		},
-		help: '/help/filebrowser/'
-	},
-	FileViewer: {
-		name: 'File Viewer',
-		css: '/filebrowser/static/css/fb.css',
-		launch: function(path, options){
-			return new Hue.FileViewer(path, options);
-		},
-		require: ['Hue.FileViewer'],
-		help: '/help/filebrowser/'
-		
-	},
-	FileEditor: {
-		name: 'File Editor',
-		css: '/filebrowser/static/css/fb.css',
-		launch: function(path, options){
-			return new Hue.FileEditor(path, options);
-		},
-		require: ['Hue.FileEditor'],
-		help: '/help/filebrowser/'
-	}
-});

+ 0 - 544
apps/filebrowser/src/filebrowser/static/css/fb.css

@@ -1,544 +0,0 @@
-img.fb_icon {
-	width: 54px;
-	height: 55px;
-	position: absolute;
-	top: 27px;
-	left: 3px;
-}
-.toolbar .fb-actions {
-	position: absolute;
-	top: 58px;
-	text-align: right;
-	right: 12px;
-}
-
-div.filebrowser .fb-actions a {
-	padding: 6px 8px 6px 22px;
-	height: 24px;
-}
-
-div.filebrowser .fb-home {
-	background: url(/static/art/icons/house.png);
-}
-
-div.filebrowser .fb-upload {
-	background: url(/static/art/led-icons/page_white_get.png);
-}
-
-div.filebrowser .fb-mkdir {
-	background: url(/static/art/icons/folder.png);
-}
-
-
-.filebrowser .fb-date {
-	width: 170px !important;
-}
-.filebrowser .fb-name, .filebrowser .fb-date, .filebrowser .fb-filesize {
-	line-height: 16px;
-}
-.filebrowser .fb-filesize {
-	min-width: 60px;
-}
-.filebrowser .fb-name-container {
-	position: relative;
-}
-.filebrowser a {
-	color: #000;
-}
-.filebrowser a:hover {
-	text-decoration: none;
-}
-.filebrowser a.fb-dir {
-	background: url(/static/art/icons/folder.png) no-repeat 1px 0px;	
-	display: block;
-	height: 18px;
-	padding-left: 22px;
-}
-.filebrowser a.fb-file {
-	background: url(/static/art/icons/page_white_text.png) no-repeat 1px 1px !important;
-	display: block;
-	min-height: 18px;
-	padding: 2px 22px;
-}
-.filebrowser .fb-item-options {
-	background: url(/static/art/led-icons/ui_combo_box.png) no-repeat;
-	display: block;
-	width: 16px;
-	height: 16px;
-	text-indent: -500px;
-	overflow: hidden;
-	float: right;
-}
-.filebrowser .fb-item-actions a {
-	display: block;
-	height: 18px;
-	padding-left: 22px;
-	top: 18px;
-}
-.filebrowser .fb-item-actions .fb-rmdir-container {
-	display: none;
-}
-.filebrowser .fb-item-actions a.fb-rmtree {
-	background: url(/static/art/icons/folder_delete.png) no-repeat 1px 1px !important;
-}
-.filebrowser .fb-item-actions a.fb-rm {
-	background: url(/static/art/icons/page_white_delete.png) no-repeat 1px 1px !important;
-}
-.filebrowser .fb-item-actions a.fb-rename {
-	background: url(/static/art/icons/textfield_rename.png) no-repeat 1px 1px !important;
-}
-.filebrowser .fb-item-actions a.fb-chown {
-	background: url(/static/art/icons/group_edit.png) no-repeat 1px 1px !important;
-}
-.filebrowser .fb-item-actions a.fb-chmod {
-	background: url(/static/art/icons/lock_edit.png) no-repeat 1px 1px !important;
-}
-.filebrowser .fb-item-actions a.fb-move-file {
-	background: url(/static/art/icons/page_white_go.png) no-repeat 1px 1px !important;
-}
-.filebrowser .fb-item-actions a.fb-move-dir {
-	background: url(/static/art/icons/folder_go.png) no-repeat 1px 1px !important;
-}
-.filebrowser .fb-item-actions a.fb-viewfile {
-	background: url(/static/art/icons/page_white_magnify.png) no-repeat 1px 1px !important;
-}
-
-.filebrowser .fb-item-actions a.fb-editfile {
-	background: url(/static/art/icons/page_white_edit.png) no-repeat 1px 1px !important;
-}
-
-.filebrowser .fb-item-actions a.fb-downloadfile {
-	background: url(/static/art/icons/page_white_put.png) no-repeat 1px 1px !important;
-}
-
-.filebrowser .context-menu {
-	border-radius: 2px;
-	-moz-border-radius: 2px;
-	-webkit-border-radius: 2px;
-	background: #fff;
-	border: solid #777;
-	border-width: 1px;
-	position: absolute;
-	z-index: 1;
-	display: none;
-	overflow: visible;
-}
-.filebrowser .context-menu * {
-	white-space: nowrap;
-} 
-.filebrowser .context-menu li {
-	border-bottom: 1px solid #ccc;
-	padding: 3px;
-}
-.filebrowser table[data-filters*=HtmlTable] tr.table-tr-selected td .context-menu li a {
-	color: #000;
-	text-decoration: none;
-}
-.filebrowser .context-menu li:hover, .filebrowser .context-menu li:hover a {
-	text-decoration: none;
-	background-color: #3875D7 !important;
-	color: #fff !important;
-}
-.filebrowser .context-menu li:last-child {
-	border: none;
-}
-.filebrowser .jframe_prompt dl.fb-side-by-side {
-	width: 400px;
-}
-.filebrowser .jframe_prompt dl.fb-side-by-side dt {
-	float: left;
-	width: 120px;
-	text-align: left;
-	line-height: 16px;
-}
-.filebrowser .jframe_prompt dl.fb-side-by-side dd {
-	text-align: left;
-	line-height: 16px;
-	padding-bottom: 4px;
-}
-.filebrowser .jframe_prompt dl.fb-side-by-side dd input {
-	line-height: 16px;
-}
-
-.filebrowser .fb-chmod th, .filebrowser .fb-chmod td {
-	padding: 2px 8px;
-	border-bottom: 1px solid #ccc;
-}
-.filebrowser .fb-chmod td {
-	border-right: 1px solid #ccc;
-}
-.filebrowser .fb-chmod .fb-label {
-	text-align: right;
-	border-bottom: none;
-}
-.filebrowser .fb-chmod .fb-empty {
-	border: none;
-}
-.fb-upload {
-	display:block;
-	float:left;
-}
-.fb-noflash {
-	color:#666666;
-	padding-right:12px;
-	text-align:right;
-}
-.fb-noflash a {
-	color: #3e528c;
-}
-.fb-uploader {
-	width: 80%;
-	background: #fff;
-	border: 1px solid #000;
-	position: absolute;
-	border-radius: 4px;
-	-moz-border-radius: 4px;
-	-webkit-border-radius: 4px;
-	-moz-box-shadow: 0 1px 2px #999;
-	-webkit-box-shadow: 0 1px 2px #999;
-	padding: 4px;
-	z-index: 10003;
-	overflow: auto;
-}
-.fb-uploader .fb-cancel-upload {
-	z-index: 1;
-	cursor: pointer;
-	display: block;
-	height: 13px;
-	overflow: hidden;
-	position: absolute;
-	right: 2px;
-	text-indent: 300px;
-	width: 13px;
-	background: url(/static/art/close.png);
-}
-
-
-.fb-uploader a.hover {
-	color: red;
-}
- 
-.fb-uploader .fb-upload-list {
-	height: 100px;
-	overflow: auto;
-	padding: 0;
-	list-style: none;
-	margin: 0 14px 0 0;
-}
- 
-.fb-uploader .fb-upload-list .file-invalid {
-	cursor: pointer;
-	color: #514721;
-	padding-left: 48px;
-	line-height: 24px;
-	background: url(/static/js/ThirdParty/digitarald-fancyupload/assets/error.png) no-repeat 24px 5px;
-	margin-bottom: 1px;
-}
-.fb-uploader .fb-upload-list .file-invalid span {
-	background-color: #fff6bf;
-	padding: 1px;
-}
- 
-.fb-uploader .fb-upload-list .file {
-	line-height: 2em;
-	padding-left: 22px;
-	background: url(/static/js/ThirdParty/digitarald-fancyupload/assets/attach.png) no-repeat 1px 50%;
-}
- 
-.fb-uploader .fb-upload-list .file span,
-.fb-uploader .fb-upload-list .file a {
-	padding: 0 4px;
-}
- 
-.fb-uploader .fb-upload-list .file .file-size {
-	color: #666;
-}
- 
-.fb-uploader .fb-upload-list .file .file-error {
-	color: #8a1f11;
-}
- 
-.fb-uploader .fb-upload-list .file .file-progress {
-	width: 125px;
-	height: 12px;
-	vertical-align: middle;
-	background-image: url(/static/js/ThirdParty/digitarald-fancyupload/assets/progress-bar/progress.gif);
-}
-
-
-/*
-	chooser
-*/
-.filechooser .fb-actions {
-	right: 10px;
-	top: 24px;
-}
-.filechooser .jframe_contents {
-	text-align: left;
-}
-.filechooser .fb-item-options {
-	display: none;
-}
-.filechooser .fb-file-list .not-selectable {
-	opacity: 0.7;
-	filter: alpha(opacity=70);
-	-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
-}
-.filechooser .fb-file-list .not-selectable.table-tr-selected td, .filechooser .fb-file-list .not-selectable.table-tr-selected td a {
-	background-color: red !important;
-}
-
-.filechooser .toolbar .fb_icon {
-	display: none;
-}
-
-/*
-			fileviewer
-*/
-
-.fileviewer .toolbar {
-	height: 0px;
-	overflow: visible;
-}
-
-.toolbar .fv-controls {
-	position: absolute;
-	top: 49px;
-	left: 10px;
-}
-
-.toolbar .fv-path, .toolbar .fe-path {
-	position: absolute;
-	top: 25px;
-	left: 10px;
-	line-height: 16px;
-	background: transparent url(/static/art/icons/page.png) no-repeat scroll;
-	text-indent: 20px;
-	width: 90%;
-}
-.toolbar .fe-buttons {
-	position: absolute;
-}
-
-.fv-status, .fv-changeStatus {
-	padding-right: 6px;
-}
-
-.fv-actions {
-	position: absolute;
-	left: 10px;
-	top: 49px;
-}
-
-.fv-navigation a {
-	float: left;
-	text-indent: -500px;
-	overflow: hidden;
-	width: 16px;
-	height: 16px;
-	padding: 3px;
-	display: block;
-}
-
-.fv-navigation .fv-firstBlock {
-	background: transparent url(../art/fb_offset_begin.png) no-repeat scroll 
-}
-
-.fv-navigation .fv-prevBlock {
-	background: transparent url(../art/fb_offset_previous.png) no-repeat scroll 
-}
-
-.fv-navigation .fv-nextBlock {
-	background: transparent url(../art/fb_offset_next.png) no-repeat scroll	
-}
-
-.fv-navigation .fv-lastBlock {
-	background: transparent url(../art/fb_offset_end.png) no-repeat scroll	
-}
-.fv-status, .fv-changeStatus, .fv-fileInfo {
-	float: left;
-}
-
-.fv-navigation {
-	position: absolute;
-	right: 12px;
-	top: 11px;
-}
-
-.fv-stepInfo {
-	font-size: 10px;
-}
-
-.fv-controlInfo {
-	-moz-border-radius-topleft: 5px;
-	-moz-border-radius-bottomleft: 5px;
-	-webkit-border-radius-topleft: 5px;
-	-webkit-border-radius-bottomleft: 5px;
-}
-
-.fv-controlInfo a {
-	height: 16px;
-	width: 16px;
-	margin-left: 5px;
-}
-.fv-changeBytesForm input {
-	width: 80px;
-}
-.fv-navChange h2 {
-	font-size: 12px;
-	margin-bottom: 4px;
-}
-.fv-navhead {
-	height: 22px; 
-	padding: 6px 8px 7px;
-	border-bottom: 1px solid #000;
-	background: #ccc;
-	overflow: hidden;
-}
-.fv-editBytes {
-	background: url(/static/art/led-icons/pencil.png) left 50% no-repeat;
-}
-
-.fv-changeBytes {
-	background: url(/static/art/led-icons/accept.png) left 50% no-repeat;
-}
-
-.fv-cancelChangeBytes {
-	background: url(/static/art/led-icons/cross.png) left 50% no-repeat;
-}
-
-.fv-fileInfo dt {
-	font-weight: bold;
-	padding:2px 0px;
-}
-
-div.fileviewer .fv-actions a {
-	padding: 6px 8px 6px 25px;
-}
-
-div.fileviewer .fv-download {
-	background: url(/static/art/led-icons/page_white_put.png) left 50%;
-}
-
-div.fileviewer .fv-viewLocation {
-	background: url(/static/art/icons/folder_go.png) left 50%;
-}
-
-div.fileviewer .fv-viewGzip .fv-viewAvro {
-	background: url(/static/art/icons/page_white_zip.png) left 50%;
-}
-
-div.fileviewer .fv-viewBinary {
-	background: url(/static/art/icons/view_binary.png) left 50%;
-}
-
-div.fileviewer .fv-viewText {
-	background: url(/static/art/icons/view_text.png) left 50%;
-}
-
-div.fileviewer .fv-editFile {
-	background: url(/static/art/icons/page_edit.png) left 50%;
-}
-	
-.fv-bold {
-	font-weight: bold;
-}
-
-.fv-italic {
-	font-style: italic;
-}
-
-.fv-byteInfo {
-	-moz-border-radius:3px;
-	-webkit-border-radius:3px;
-	background:#CCCCCC none repeat scroll 0 0;
-	border:1px solid #333333;
-	margin:0 3px;
-	padding:1px 5px !important;
-	font-weight: bold;
-}
-
-.fv-byteInfo input {
-	font-size: 12px;
-	font-family:"Lucida Grande","Lucida Sans Unicode","Trebuchet MS",Helvetica,Arial,sans-serif;
-	background:#CCCCCC none repeat scroll 0 0;
-	border: 1px solid #333;
-	color: black;
-	height: 12px;
-	vertical-align: top;
-}
-
-.fv-byteInfo label.overTxtLabel {
-	color: black;
-	font-size: 12px;
-	display: none; 
-	margin-top: 0px;
-}
-
-.fv-controls .fv-changeBytesForm {
-	display: inline;
-}
-
-.fv-binaryWarning {
-	-moz-border-radius:2px;
-	-webkit-border-radius:2px;
-	background-color: lightYellow;
-	border-bottom: 1px solid black;
-	font-weight: bold;
-	padding: 5px 10px;
-}
-
-.fe-editForm textarea {
-	width: 100%;
-	margin: 0px auto;
-	border: none;
-	font-family: monaco, courier;
-	font-size: 12px;
-	color: #fff;
-	background: #333;
-	padding: 0;
-}
-
-.fe-editForm textarea:focus {
-	outline: none;
-}
-
-.fe-divResize {
-	text-align: right;
-	background: #333;
-	border: 1px solid #333;
-}
-
-div.fileeditor .fe-saveButton {
-	background: url(/static/art/icons/disk.png) left 50%;
-}
-
-div.fileeditor .fe-saveAsButton {
-	background: url(/static/art/icons/disk.png) left 50%;
-}
-
-div.fileeditor .fe-viewLocation {
-	background: url(/static/art/icons/folder_go.png) left 50%;
-}
-
-div.fileeditor .fe-buttons a {
-	-moz-border-radius: 5px;
-	-webkit-border-radius: 5px;
-	padding: 6px 10px 6px 25px;
-	height: 27px;
-}
-
-div.fileeditor .fe-buttons {
-	top: 52px;
-	left: 10px;
-}
-
-.fs-location {
-	margin: 4px 200px 0px 10px;
-	position: absolute;
-}
-
-.fs-locationInput {
-	width: 400px;
-	margin-left: 5px;
-}

+ 0 - 70
apps/filebrowser/src/filebrowser/static/files.html

@@ -1,70 +0,0 @@
-<dl class="fb_files fb_files_top depth0">
-	<dt>
-		<a class="fb_toggle fb_toggled">expand</a>
-		<ul>
-			<li class="fb_name_col">FolderName</li>
-			<li class="fb_date_col">01/04/2009 8:23 PM</li>
-			<li class="fb_size_col">4 KB</li>
-		</ul>
-	</dt>
-	<dd>
-		<dl class="fb_files depth1">
-			<dt>
-				<a class="fb_toggle ">expand</a>
-				<ul>
-					<li class="fb_name_col">SubFolderName</li>
-					<li class="fb_date_col">01/04/2009 8:23 PM</li>
-					<li class="fb_size_col">0 KB</li>
-				</ul>
-			</dt>
-			<dd>
-				<dl class="fb_files depth2">
-					<dt class="fb_file fb_zip">
-						<ul>
-							<li class="fb_name_col">FileName</li>
-							<li class="fb_date_col">01/04/2009 8:23 PM</li>
-							<li class="fb_size_col">4 KB</li>
-						</ul>
-					</dt>
-					<dd></dd>
-					<dt>
-						<a class="fb_toggle fb_toggled">expand</a>
-						<ul>
-							<li class="fb_name_col">SubFolderName</li>
-							<li class="fb_date_col">01/04/2009 8:23 PM</li>
-							<li class="fb_size_col">0 KB</li>
-						</ul>
-					</dt>
-					<dd>
-						<dl class="fb_files depth3">
-							<dt class="depth3 fb_file fb_zip">
-								<ul>
-									<li class="fb_name_col">FileName</li>
-									<li class="fb_date_col">01/04/2009 8:23 PM</li>
-									<li class="fb_size_col">4 KB</li>
-								</ul>
-							</dt>
-							<dd></dd>
-						</dl>
-					</dd>
-					<dt class="depth2 fb_file fb_zip">
-						<ul>
-							<li class="fb_name_col">FileName</li>
-							<li class="fb_date_col">01/04/2009 8:23 PM</li>
-							<li class="fb_size_col">4 KB</li>
-						</ul>
-					</dt>
-					<dd></dd>
-					<dt class="depth2 fb_file fb_zip">
-						<ul>
-							<li class="fb_name_col">FileName</li>
-							<li class="fb_date_col">01/04/2009 8:23 PM</li>
-							<li class="fb_size_col">4 KB</li>
-						</ul>
-					</dt>
-					<dd></dd>
-				</dl>
-			</dd>
-		</dl>
-	</dd>
-</dl>

+ 0 - 1249
apps/filebrowser/src/filebrowser/static/fileuploader.js

@@ -1,1249 +0,0 @@
-/**
- * http://github.com/valums/file-uploader
- * 
- * Multiple file upload component with progress-bar, drag-and-drop. 
- * © 2010 Andrew Valums ( andrew(at)valums.com ) 
- * 
- * Licensed under GNU GPL 2 or later and GNU LGPL 2 or later, see license.txt.
- */    
-
-//
-// Helper functions
-//
-
-var qq = qq || {};
-
-/**
- * Adds all missing properties from second obj to first obj
- */ 
-qq.extend = function(first, second){
-    for (var prop in second){
-        first[prop] = second[prop];
-    }
-};  
-
-/**
- * Searches for a given element in the array, returns -1 if it is not present.
- * @param {Number} [from] The index at which to begin the search
- */
-qq.indexOf = function(arr, elt, from){
-    if (arr.indexOf) return arr.indexOf(elt, from);
-    
-    from = from || 0;
-    var len = arr.length;    
-    
-    if (from < 0) from += len;  
-
-    for (; from < len; from++){  
-        if (from in arr && arr[from] === elt){  
-            return from;
-        }
-    }  
-    return -1;  
-}; 
-    
-qq.getUniqueId = (function(){
-    var id = 0;
-    return function(){ return id++; };
-})();
-
-//
-// Events
-
-qq.attach = function(element, type, fn){
-    if (element.addEventListener){
-        element.addEventListener(type, fn, false);
-    } else if (element.attachEvent){
-        element.attachEvent('on' + type, fn);
-    }
-};
-qq.detach = function(element, type, fn){
-    if (element.removeEventListener){
-        element.removeEventListener(type, fn, false);
-    } else if (element.attachEvent){
-        element.detachEvent('on' + type, fn);
-    }
-};
-
-qq.preventDefault = function(e){
-    if (e.preventDefault){
-        e.preventDefault();
-    } else{
-        e.returnValue = false;
-    }
-};
-
-//
-// Node manipulations
-
-/**
- * Insert node a before node b.
- */
-qq.insertBefore = function(a, b){
-    b.parentNode.insertBefore(a, b);
-};
-qq.remove = function(element){
-    element.parentNode.removeChild(element);
-};
-
-qq.contains = function(parent, descendant){       
-    // compareposition returns false in this case
-    if (parent == descendant) return true;
-    
-    if (parent.contains){
-        return parent.contains(descendant);
-    } else {
-        return !!(descendant.compareDocumentPosition(parent) & 8);
-    }
-};
-
-/**
- * Creates and returns element from html string
- * Uses innerHTML to create an element
- */
-qq.toElement = (function(){
-    var div = document.createElement('div');
-    return function(html){
-        div.innerHTML = html;
-        var element = div.firstChild;
-        div.removeChild(element);
-        return element;
-    };
-})();
-
-//
-// Node properties and attributes
-
-/**
- * Sets styles for an element.
- * Fixes opacity in IE6-8.
- */
-qq.css = function(element, styles){
-    if (styles.opacity != null){
-        if (typeof element.style.opacity != 'string' && typeof(element.filters) != 'undefined'){
-            styles.filter = 'alpha(opacity=' + Math.round(100 * styles.opacity) + ')';
-        }
-    }
-    qq.extend(element.style, styles);
-};
-qq.hasClass = function(element, name){
-    var re = new RegExp('(^| )' + name + '( |$)');
-    return re.test(element.className);
-};
-qq.addClass = function(element, name){
-    if (!qq.hasClass(element, name)){
-        element.className += ' ' + name;
-    }
-};
-qq.removeClass = function(element, name){
-    var re = new RegExp('(^| )' + name + '( |$)');
-    element.className = element.className.replace(re, ' ').replace(/^\s+|\s+$/g, "");
-};
-qq.setText = function(element, text){
-    element.innerText = text;
-    element.textContent = text;
-};
-
-//
-// Selecting elements
-
-qq.children = function(element){
-    var children = [],
-    child = element.firstChild;
-
-    while (child){
-        if (child.nodeType == 1){
-            children.push(child);
-        }
-        child = child.nextSibling;
-    }
-
-    return children;
-};
-
-qq.getByClass = function(element, className){
-    if (element.querySelectorAll){
-        return element.querySelectorAll('.' + className);
-    }
-
-    var result = [];
-    var candidates = element.getElementsByTagName("*");
-    var len = candidates.length;
-
-    for (var i = 0; i < len; i++){
-        if (qq.hasClass(candidates[i], className)){
-            result.push(candidates[i]);
-        }
-    }
-    return result;
-};
-
-/**
- * obj2url() takes a json-object as argument and generates
- * a querystring. pretty much like jQuery.param()
- * 
- * how to use:
- *
- *    `qq.obj2url({a:'b',c:'d'},'http://any.url/upload?otherParam=value');`
- *
- * will result in:
- *
- *    `http://any.url/upload?otherParam=value&a=b&c=d`
- *
- * @param  Object JSON-Object
- * @param  String current querystring-part
- * @return String encoded querystring
- */
-qq.obj2url = function(obj, temp, prefixDone){
-    var uristrings = [],
-        prefix = '&',
-        add = function(nextObj, i){
-            var nextTemp = temp 
-                ? (/\[\]$/.test(temp)) // prevent double-encoding
-                   ? temp
-                   : temp+'['+i+']'
-                : i;
-            if ((nextTemp != 'undefined') && (i != 'undefined')) {  
-                uristrings.push(
-                    (typeof nextObj === 'object') 
-                        ? qq.obj2url(nextObj, nextTemp, true)
-                        : (Object.prototype.toString.call(nextObj) === '[object Function]')
-                            ? encodeURIComponent(nextTemp) + '=' + encodeURIComponent(nextObj())
-                            : encodeURIComponent(nextTemp) + '=' + encodeURIComponent(nextObj)                                                          
-                );
-            }
-        }; 
-
-    if (!prefixDone && temp) {
-      prefix = (/\?/.test(temp)) ? (/\?$/.test(temp)) ? '' : '&' : '?';
-      uristrings.push(temp);
-      uristrings.push(qq.obj2url(obj));
-    } else if ((Object.prototype.toString.call(obj) === '[object Array]') && (typeof obj != 'undefined') ) {
-        // we wont use a for-in-loop on an array (performance)
-        for (var i = 0, len = obj.length; i < len; ++i){
-            add(obj[i], i);
-        }
-    } else if ((typeof obj != 'undefined') && (obj !== null) && (typeof obj === "object")){
-        // for anything else but a scalar, we will use for-in-loop
-        for (var i in obj){
-            add(obj[i], i);
-        }
-    } else {
-        uristrings.push(encodeURIComponent(temp) + '=' + encodeURIComponent(obj));
-    }
-
-    return uristrings.join(prefix)
-                     .replace(/^&/, '')
-                     .replace(/%20/g, '+'); 
-};
-
-//
-//
-// Uploader Classes
-//
-//
-
-var qq = qq || {};
-    
-/**
- * Creates upload button, validates upload, but doesn't create file list or dd. 
- */
-qq.FileUploaderBasic = function(o){
-    this._options = {
-        // set to true to see the server response
-        debug: false,
-        action: '/server/upload',
-        params: {},
-        button: null,
-        multiple: true,
-        maxConnections: 3,
-        // validation        
-        allowedExtensions: [],               
-        sizeLimit: 0,   
-        minSizeLimit: 0,                             
-        // events
-        // return false to cancel submit
-        onSubmit: function(id, fileName){},
-        onProgress: function(id, fileName, loaded, total){},
-        onComplete: function(id, fileName, responseJSON){},
-        onCancel: function(id, fileName){},
-        // messages                
-        messages: {
-            typeError: "{file} has invalid extension. Only {extensions} are allowed.",
-            sizeError: "{file} is too large, maximum file size is {sizeLimit}.",
-            minSizeError: "{file} is too small, minimum file size is {minSizeLimit}.",
-            emptyError: "{file} is empty, please select files again without it.",
-            onLeave: "The files are being uploaded, if you leave now the upload will be cancelled."            
-        },
-        showMessage: function(message){
-            alert(message);
-        }               
-    };
-    qq.extend(this._options, o);
-        
-    // number of files being uploaded
-    this._filesInProgress = 0;
-    this._handler = this._createUploadHandler(); 
-    
-    if (this._options.button){ 
-        this._button = this._createUploadButton(this._options.button);
-    }
-                        
-    this._preventLeaveInProgress();         
-};
-   
-qq.FileUploaderBasic.prototype = {
-    setParams: function(params){
-        this._options.params = params;
-    },
-    getInProgress: function(){
-        return this._filesInProgress;         
-    },
-    _createUploadButton: function(element){
-        var self = this;
-        
-        return new qq.UploadButton({
-            element: element,
-            multiple: this._options.multiple && qq.UploadHandlerXhr.isSupported(),
-            onChange: function(input){
-                self._onInputChange(input);
-            }        
-        });           
-    },    
-    _createUploadHandler: function(){
-        var self = this,
-            handlerClass;        
-        
-        if(qq.UploadHandlerXhr.isSupported()){           
-            handlerClass = 'UploadHandlerXhr';                        
-        } else {
-            handlerClass = 'UploadHandlerForm';
-        }
-
-        var handler = new qq[handlerClass]({
-            debug: this._options.debug,
-            action: this._options.action,         
-            maxConnections: this._options.maxConnections,   
-            onProgress: function(id, fileName, loaded, total){                
-                self._onProgress(id, fileName, loaded, total);
-                self._options.onProgress(id, fileName, loaded, total);                    
-            },            
-            onComplete: function(id, fileName, result){
-                self._onComplete(id, fileName, result);
-                self._options.onComplete(id, fileName, result);
-            },
-            onCancel: function(id, fileName){
-                self._onCancel(id, fileName);
-                self._options.onCancel(id, fileName);
-            }
-        });
-
-        return handler;
-    },    
-    _preventLeaveInProgress: function(){
-        var self = this;
-        
-        qq.attach(window, 'beforeunload', function(e){
-            if (!self._filesInProgress){return;}
-            
-            var e = e || window.event;
-            // for ie, ff
-            e.returnValue = self._options.messages.onLeave;
-            // for webkit
-            return self._options.messages.onLeave;             
-        });        
-    },    
-    _onSubmit: function(id, fileName){
-        this._filesInProgress++;  
-    },
-    _onProgress: function(id, fileName, loaded, total){        
-    },
-    _onComplete: function(id, fileName, result){
-        this._filesInProgress--;                 
-        if (result.error){
-            this._options.showMessage(result.error);
-        }             
-    },
-    _onCancel: function(id, fileName){
-        this._filesInProgress--;        
-    },
-    _onInputChange: function(input){
-        if (this._handler instanceof qq.UploadHandlerXhr){                
-            this._uploadFileList(input.files);                   
-        } else {             
-            if (this._validateFile(input)){                
-                this._uploadFile(input);                                    
-            }                      
-        }               
-        this._button.reset();   
-    },  
-    _uploadFileList: function(files){
-        for (var i=0; i<files.length; i++){
-            if ( !this._validateFile(files[i])){
-                return;
-            }            
-        }
-        
-        for (var i=0; i<files.length; i++){
-            this._uploadFile(files[i]);        
-        }        
-    },       
-    _uploadFile: function(fileContainer){      
-        var id = this._handler.add(fileContainer);
-        var fileName = this._handler.getName(id);
-        
-        if (this._options.onSubmit(id, fileName) !== false){
-            this._onSubmit(id, fileName);
-            this._handler.upload(id, this._options.params);
-        }
-    },      
-    _validateFile: function(file){
-        var name, size;
-        
-        if (file.value){
-            // it is a file input            
-            // get input value and remove path to normalize
-            name = file.value.replace(/.*(\/|\\)/, "");
-        } else {
-            // fix missing properties in Safari
-            name = file.fileName != null ? file.fileName : file.name;
-            size = file.fileSize != null ? file.fileSize : file.size;
-        }
-                    
-        if (! this._isAllowedExtension(name)){            
-            this._error('typeError', name);
-            return false;
-            
-        } else if (size === 0){            
-            this._error('emptyError', name);
-            return false;
-                                                     
-        } else if (size && this._options.sizeLimit && size > this._options.sizeLimit){            
-            this._error('sizeError', name);
-            return false;
-                        
-        } else if (size && size < this._options.minSizeLimit){
-            this._error('minSizeError', name);
-            return false;            
-        }
-        
-        return true;                
-    },
-    _error: function(code, fileName){
-        var message = this._options.messages[code];        
-        function r(name, replacement){ message = message.replace(name, replacement); }
-        
-        r('{file}', this._formatFileName(fileName));        
-        r('{extensions}', this._options.allowedExtensions.join(', '));
-        r('{sizeLimit}', this._formatSize(this._options.sizeLimit));
-        r('{minSizeLimit}', this._formatSize(this._options.minSizeLimit));
-        
-        this._options.showMessage(message);                
-    },
-    _formatFileName: function(name){
-        if (name.length > 33){
-            name = name.slice(0, 19) + '...' + name.slice(-13);    
-        }
-        return name;
-    },
-    _isAllowedExtension: function(fileName){
-        var ext = (-1 !== fileName.indexOf('.')) ? fileName.replace(/.*[.]/, '').toLowerCase() : '';
-        var allowed = this._options.allowedExtensions;
-        
-        if (!allowed.length){return true;}        
-        
-        for (var i=0; i<allowed.length; i++){
-            if (allowed[i].toLowerCase() == ext){ return true;}    
-        }
-        
-        return false;
-    },    
-    _formatSize: function(bytes){
-        var i = -1;                                    
-        do {
-            bytes = bytes / 1024;
-            i++;  
-        } while (bytes > 99);
-        
-        return Math.max(bytes, 0.1).toFixed(1) + ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'][i];          
-    }
-};
-    
-       
-/**
- * Class that creates upload widget with drag-and-drop and file list
- * @inherits qq.FileUploaderBasic
- */
-qq.FileUploader = function(o){
-    // call parent constructor
-    qq.FileUploaderBasic.apply(this, arguments);
-    
-    // additional options    
-    qq.extend(this._options, {
-        element: null,
-        // if set, will be used instead of qq-upload-list in template
-        listElement: null,
-                
-        template: '<div class="qq-uploader">' + 
-                '<div class="qq-upload-drop-area"><span>Drop files here to upload</span></div>' +
-                '<div class="qq-upload-button">Upload a file</div>' +
-                '<ul class="qq-upload-list"></ul>' + 
-             '</div>',
-
-        // template for one item in file list
-        fileTemplate: '<li>' +
-                '<span class="qq-upload-file"></span>' +
-                '<span class="qq-upload-spinner"></span>' +
-                '<span class="qq-upload-size"></span>' +
-                '<a class="qq-upload-cancel" href="#">Cancel</a>' +
-                '<span class="qq-upload-failed-text">Failed</span>' +
-            '</li>',        
-        
-        classes: {
-            // used to get elements from templates
-            button: 'qq-upload-button',
-            drop: 'qq-upload-drop-area',
-            dropActive: 'qq-upload-drop-area-active',
-            list: 'qq-upload-list',
-                        
-            file: 'qq-upload-file',
-            spinner: 'qq-upload-spinner',
-            size: 'qq-upload-size',
-            cancel: 'qq-upload-cancel',
-
-            // added to list item when upload completes
-            // used in css to hide progress spinner
-            success: 'qq-upload-success',
-            fail: 'qq-upload-fail'
-        }
-    });
-    // overwrite options with user supplied
-
-    this._options.
-    qq.extend(this._options, o);       
-
-    this._element = this._options.element;
-    this._element.innerHTML = this._options.template;        
-    this._listElement = this._options.listElement || this._find(this._element, 'list');
-    
-    this._classes = this._options.classes;
-        
-    this._button = this._createUploadButton(this._find(this._element, 'button'));        
-    
-    this._bindCancelEvent();
-    this._setupDragDrop();
-};
-
-// inherit from Basic Uploader
-qq.extend(qq.FileUploader.prototype, qq.FileUploaderBasic.prototype);
-
-qq.extend(qq.FileUploader.prototype, {
-    /**
-     * Gets one of the elements listed in this._options.classes
-     **/
-    _find: function(parent, type){                                
-        var element = qq.getByClass(parent, this._options.classes[type])[0];        
-        if (!element){
-            throw new Error('element not found ' + type);
-        }
-        
-        return element;
-    },
-    _setupDragDrop: function(){
-        var self = this,
-            dropArea = this._find(this._element, 'drop');                        
-
-        var dz = new qq.UploadDropZone({
-            element: dropArea,
-            onEnter: function(e){
-                qq.addClass(dropArea, self._classes.dropActive);
-                e.stopPropagation();
-            },
-            onLeave: function(e){
-                e.stopPropagation();
-            },
-            onLeaveNotDescendants: function(e){
-                qq.removeClass(dropArea, self._classes.dropActive);  
-            },
-            onDrop: function(e){
-                dropArea.style.display = 'none';
-                qq.removeClass(dropArea, self._classes.dropActive);
-                self._uploadFileList(e.dataTransfer.files);    
-            }
-        });
-                
-        dropArea.style.display = 'none';
-
-        qq.attach(document, 'dragenter', function(e){     
-            if (!dz._isValidFileDrag(e)) return; 
-            
-            dropArea.style.display = 'block';            
-        });                 
-        qq.attach(document, 'dragleave', function(e){
-            if (!dz._isValidFileDrag(e)) return;            
-            
-            var relatedTarget = document.elementFromPoint(e.clientX, e.clientY);
-            // only fire when leaving document out
-            if ( ! relatedTarget || relatedTarget.nodeName == "HTML"){               
-                dropArea.style.display = 'none';                                            
-            }
-        });                
-    },
-    _onSubmit: function(id, fileName){
-        qq.FileUploaderBasic.prototype._onSubmit.apply(this, arguments);
-        this._addToList(id, fileName);  
-    },
-    _onProgress: function(id, fileName, loaded, total){
-        qq.FileUploaderBasic.prototype._onProgress.apply(this, arguments);
-
-        var item = this._getItemByFileId(id);
-        var size = this._find(item, 'size');
-        size.style.display = 'inline';
-        
-        var text; 
-        if (loaded != total){
-            text = Math.round(loaded / total * 100) + '% from ' + this._formatSize(total);
-        } else {                                   
-            text = this._formatSize(total);
-        }          
-        
-        qq.setText(size, text);         
-    },
-    _onComplete: function(id, fileName, result){
-        qq.FileUploaderBasic.prototype._onComplete.apply(this, arguments);
-
-        // mark completed
-        var item = this._getItemByFileId(id);                
-        qq.remove(this._find(item, 'cancel'));
-        qq.remove(this._find(item, 'spinner'));
-        
-        if (result.success){
-            qq.addClass(item, this._classes.success);    
-        } else {
-            qq.addClass(item, this._classes.fail);
-        }         
-    },
-    _addToList: function(id, fileName){
-        var item = qq.toElement(this._options.fileTemplate);                
-        item.qqFileId = id;
-
-        var fileElement = this._find(item, 'file');        
-        qq.setText(fileElement, this._formatFileName(fileName));
-        this._find(item, 'size').style.display = 'none';        
-
-        this._listElement.appendChild(item);
-    },
-    _getItemByFileId: function(id){
-        var item = this._listElement.firstChild;        
-        
-        // there can't be txt nodes in dynamically created list
-        // and we can  use nextSibling
-        while (item){            
-            if (item.qqFileId == id) return item;            
-            item = item.nextSibling;
-        }          
-    },
-    /**
-     * delegate click event for cancel link 
-     **/
-    _bindCancelEvent: function(){
-        var self = this,
-            list = this._listElement;            
-        
-        qq.attach(list, 'click', function(e){            
-            e = e || window.event;
-            var target = e.target || e.srcElement;
-            
-            if (qq.hasClass(target, self._classes.cancel)){                
-                qq.preventDefault(e);
-               
-                var item = target.parentNode;
-                self._handler.cancel(item.qqFileId);
-                qq.remove(item);
-            }
-        });
-    }    
-});
-    
-qq.UploadDropZone = function(o){
-    this._options = {
-        element: null,  
-        onEnter: function(e){},
-        onLeave: function(e){},  
-        // is not fired when leaving element by hovering descendants   
-        onLeaveNotDescendants: function(e){},   
-        onDrop: function(e){}                       
-    };
-    qq.extend(this._options, o); 
-    
-    this._element = this._options.element;
-    
-    this._disableDropOutside();
-    this._attachEvents();   
-};
-
-qq.UploadDropZone.prototype = {
-    _disableDropOutside: function(e){
-        // run only once for all instances
-        if (!qq.UploadDropZone.dropOutsideDisabled ){
-
-            qq.attach(document, 'dragover', function(e){
-                if (e.dataTransfer){
-                    e.dataTransfer.dropEffect = 'none';
-                    e.preventDefault(); 
-                }           
-            });
-            
-            qq.UploadDropZone.dropOutsideDisabled = true; 
-        }        
-    },
-    _attachEvents: function(){
-        var self = this;              
-                  
-        qq.attach(self._element, 'dragover', function(e){
-            if (!self._isValidFileDrag(e)) return;
-            
-            var effect = e.dataTransfer.effectAllowed;
-            if (effect == 'move' || effect == 'linkMove'){
-                e.dataTransfer.dropEffect = 'move'; // for FF (only move allowed)    
-            } else {                    
-                e.dataTransfer.dropEffect = 'copy'; // for Chrome
-            }
-                                                     
-            e.stopPropagation();
-            e.preventDefault();                                                                    
-        });
-        
-        qq.attach(self._element, 'dragenter', function(e){
-            if (!self._isValidFileDrag(e)) return;
-                        
-            self._options.onEnter(e);
-        });
-        
-        qq.attach(self._element, 'dragleave', function(e){
-            if (!self._isValidFileDrag(e)) return;
-            
-            self._options.onLeave(e);
-            
-            var relatedTarget = document.elementFromPoint(e.clientX, e.clientY);                      
-            // do not fire when moving a mouse over a descendant
-            if (qq.contains(this, relatedTarget)) return;
-                        
-            self._options.onLeaveNotDescendants(e); 
-        });
-                
-        qq.attach(self._element, 'drop', function(e){
-            if (!self._isValidFileDrag(e)) return;
-            
-            e.preventDefault();
-            self._options.onDrop(e);
-        });          
-    },
-    _isValidFileDrag: function(e){
-        var dt = e.dataTransfer,
-            // do not check dt.types.contains in webkit, because it crashes safari 4            
-            isWebkit = navigator.userAgent.indexOf("AppleWebKit") > -1;                        
-
-        // dt.effectAllowed is none in Safari 5
-        // dt.types.contains check is for firefox            
-        return dt && dt.effectAllowed != 'none' && 
-            (dt.files || (!isWebkit && dt.types.contains && dt.types.contains('Files')));
-        
-    }        
-}; 
-
-qq.UploadButton = function(o){
-    this._options = {
-        element: null,  
-        // if set to true adds multiple attribute to file input      
-        multiple: false,
-        // name attribute of file input
-        name: 'file',
-        onChange: function(input){},
-        hoverClass: 'qq-upload-button-hover',
-        focusClass: 'qq-upload-button-focus'                       
-    };
-    
-    qq.extend(this._options, o);
-        
-    this._element = this._options.element;
-    
-    // make button suitable container for input
-    qq.css(this._element, {
-        position: 'relative',
-        overflow: 'hidden',
-        // Make sure browse button is in the right side
-        // in Internet Explorer
-        direction: 'ltr'
-    });   
-    
-    this._input = this._createInput();
-};
-
-qq.UploadButton.prototype = {
-    /* returns file input element */    
-    getInput: function(){
-        return this._input;
-    },
-    /* cleans/recreates the file input */
-    reset: function(){
-        if (this._input.parentNode){
-            qq.remove(this._input);    
-        }                
-        
-        qq.removeClass(this._element, this._options.focusClass);
-        this._input = this._createInput();
-    },    
-    _createInput: function(){                
-        var input = document.createElement("input");
-        
-        if (this._options.multiple){
-            input.setAttribute("multiple", "multiple");
-        }
-                
-        input.setAttribute("type", "file");
-        input.setAttribute("name", this._options.name);
-        
-        qq.css(input, {
-            position: 'absolute',
-            // in Opera only 'browse' button
-            // is clickable and it is located at
-            // the right side of the input
-            right: 0,
-            top: 0,
-            fontFamily: 'Arial',
-            // 4 persons reported this, the max values that worked for them were 243, 236, 236, 118
-            fontSize: '118px',
-            margin: 0,
-            padding: 0,
-            cursor: 'pointer',
-            opacity: 0
-        });
-        
-        this._element.appendChild(input);
-
-        var self = this;
-        qq.attach(input, 'change', function(){
-            self._options.onChange(input);
-        });
-                
-        qq.attach(input, 'mouseover', function(){
-            qq.addClass(self._element, self._options.hoverClass);
-        });
-        qq.attach(input, 'mouseout', function(){
-            qq.removeClass(self._element, self._options.hoverClass);
-        });
-        qq.attach(input, 'focus', function(){
-            qq.addClass(self._element, self._options.focusClass);
-        });
-        qq.attach(input, 'blur', function(){
-            qq.removeClass(self._element, self._options.focusClass);
-        });
-
-        // IE and Opera, unfortunately have 2 tab stops on file input
-        // which is unacceptable in our case, disable keyboard access
-        if (window.attachEvent){
-            // it is IE or Opera
-            input.setAttribute('tabIndex', "-1");
-        }
-
-        return input;            
-    }        
-};
-
-/**
- * Class for uploading files, uploading itself is handled by child classes
- */
-qq.UploadHandlerAbstract = function(o){
-    this._options = {
-        debug: false,
-        action: '/upload.php',
-        // maximum number of concurrent uploads        
-        maxConnections: 999,
-        onProgress: function(id, fileName, loaded, total){},
-        onComplete: function(id, fileName, response){},
-        onCancel: function(id, fileName){}
-    };
-    qq.extend(this._options, o);    
-    
-    this._queue = [];
-    // params for files in queue
-    this._params = [];
-};
-qq.UploadHandlerAbstract.prototype = {
-    log: function(str){
-        if (this._options.debug && window.console) console.log('[uploader] ' + str);        
-    },
-    /**
-     * Adds file or file input to the queue
-     * @returns id
-     **/    
-    add: function(file){},
-    /**
-     * Sends the file identified by id and additional query params to the server
-     */
-    upload: function(id, params){
-        var len = this._queue.push(id);
-
-        var copy = {};        
-        qq.extend(copy, params);
-        this._params[id] = copy;        
-                
-        // if too many active uploads, wait...
-        if (len <= this._options.maxConnections){               
-            this._upload(id, this._params[id]);
-        }
-    },
-    /**
-     * Cancels file upload by id
-     */
-    cancel: function(id){
-        this._cancel(id);
-        this._dequeue(id);
-    },
-    /**
-     * Cancells all uploads
-     */
-    cancelAll: function(){
-        for (var i=0; i<this._queue.length; i++){
-            this._cancel(this._queue[i]);
-        }
-        this._queue = [];
-    },
-    /**
-     * Returns name of the file identified by id
-     */
-    getName: function(id){},
-    /**
-     * Returns size of the file identified by id
-     */          
-    getSize: function(id){},
-    /**
-     * Returns id of files being uploaded or
-     * waiting for their turn
-     */
-    getQueue: function(){
-        return this._queue;
-    },
-    /**
-     * Actual upload method
-     */
-    _upload: function(id){},
-    /**
-     * Actual cancel method
-     */
-    _cancel: function(id){},     
-    /**
-     * Removes element from queue, starts upload of next
-     */
-    _dequeue: function(id){
-        var i = qq.indexOf(this._queue, id);
-        this._queue.splice(i, 1);
-                
-        var max = this._options.maxConnections;
-        
-        if (this._queue.length >= max && i < max){
-            var nextId = this._queue[max-1];
-            this._upload(nextId, this._params[nextId]);
-        }
-    }        
-};
-
-/**
- * Class for uploading files using form and iframe
- * @inherits qq.UploadHandlerAbstract
- */
-qq.UploadHandlerForm = function(o){
-    qq.UploadHandlerAbstract.apply(this, arguments);
-       
-    this._inputs = {};
-};
-// @inherits qq.UploadHandlerAbstract
-qq.extend(qq.UploadHandlerForm.prototype, qq.UploadHandlerAbstract.prototype);
-
-qq.extend(qq.UploadHandlerForm.prototype, {
-    add: function(fileInput){
-        fileInput.setAttribute('name', 'qqfile');
-        var id = 'qq-upload-handler-iframe' + qq.getUniqueId();       
-        
-        this._inputs[id] = fileInput;
-        
-        // remove file input from DOM
-        if (fileInput.parentNode){
-            qq.remove(fileInput);
-        }
-                
-        return id;
-    },
-    getName: function(id){
-        // get input value and remove path to normalize
-        return this._inputs[id].value.replace(/.*(\/|\\)/, "");
-    },    
-    _cancel: function(id){
-        this._options.onCancel(id, this.getName(id));
-        
-        delete this._inputs[id];        
-
-        var iframe = document.getElementById(id);
-        if (iframe){
-            // to cancel request set src to something else
-            // we use src="javascript:false;" because it doesn't
-            // trigger ie6 prompt on https
-            iframe.setAttribute('src', 'javascript:false;');
-
-            qq.remove(iframe);
-        }
-    },     
-    _upload: function(id, params){                        
-        var input = this._inputs[id];
-        
-        if (!input){
-            throw new Error('file with passed id was not added, or already uploaded or cancelled');
-        }                
-
-        var fileName = this.getName(id);
-                
-        var iframe = this._createIframe(id);
-        var form = this._createForm(iframe, params);
-        form.appendChild(input);
-
-        var self = this;
-        this._attachLoadEvent(iframe, function(){                                 
-            self.log('iframe loaded');
-            
-            var response = self._getIframeContentJSON(iframe);
-
-            self._options.onComplete(id, fileName, response);
-            self._dequeue(id);
-            
-            delete self._inputs[id];
-            // timeout added to fix busy state in FF3.6
-            setTimeout(function(){
-                qq.remove(iframe);
-            }, 1);
-        });
-
-        form.submit();        
-        qq.remove(form);        
-        
-        return id;
-    }, 
-    _attachLoadEvent: function(iframe, callback){
-        qq.attach(iframe, 'load', function(){
-            // when we remove iframe from dom
-            // the request stops, but in IE load
-            // event fires
-            if (!iframe.parentNode){
-                return;
-            }
-
-            // fixing Opera 10.53
-            if (iframe.contentDocument &&
-                iframe.contentDocument.body &&
-                iframe.contentDocument.body.innerHTML == "false"){
-                // In Opera event is fired second time
-                // when body.innerHTML changed from false
-                // to server response approx. after 1 sec
-                // when we upload file with iframe
-                return;
-            }
-
-            callback();
-        });
-    },
-    /**
-     * Returns json object received by iframe from server.
-     */
-    _getIframeContentJSON: function(iframe){
-        // iframe.contentWindow.document - for IE<7
-        var doc = iframe.contentDocument ? iframe.contentDocument: iframe.contentWindow.document,
-            response;
-        
-        this.log("converting iframe's innerHTML to JSON");
-        this.log("innerHTML = " + doc.body.innerHTML);
-                        
-        try {
-            response = eval("(" + doc.body.innerHTML + ")");
-        } catch(err){
-            response = {};
-        }        
-
-        return response;
-    },
-    /**
-     * Creates iframe with unique name
-     */
-    _createIframe: function(id){
-        // We can't use following code as the name attribute
-        // won't be properly registered in IE6, and new window
-        // on form submit will open
-        // var iframe = document.createElement('iframe');
-        // iframe.setAttribute('name', id);
-
-        var iframe = qq.toElement('<iframe src="javascript:false;" name="' + id + '" />');
-        // src="javascript:false;" removes ie6 prompt on https
-
-        iframe.setAttribute('id', id);
-
-        iframe.style.display = 'none';
-        document.body.appendChild(iframe);
-
-        return iframe;
-    },
-    /**
-     * Creates form, that will be submitted to iframe
-     */
-    _createForm: function(iframe, params){
-        // We can't use the following code in IE6
-        // var form = document.createElement('form');
-        // form.setAttribute('method', 'post');
-        // form.setAttribute('enctype', 'multipart/form-data');
-        // Because in this case file won't be attached to request
-        var form = qq.toElement('<form method="post" enctype="multipart/form-data"></form>');
-
-        var queryString = qq.obj2url(params, this._options.action);
-
-        form.setAttribute('action', queryString);
-        form.setAttribute('target', iframe.name);
-        form.style.display = 'none';
-        document.body.appendChild(form);
-
-        return form;
-    }
-});
-
-/**
- * Class for uploading files using xhr
- * @inherits qq.UploadHandlerAbstract
- */
-qq.UploadHandlerXhr = function(o){
-    qq.UploadHandlerAbstract.apply(this, arguments);
-
-    this._files = [];
-    this._xhrs = [];
-    
-    // current loaded size in bytes for each file 
-    this._loaded = [];
-};
-
-// static method
-qq.UploadHandlerXhr.isSupported = function(){
-    var input = document.createElement('input');
-    input.type = 'file';        
-    
-    return (
-        'multiple' in input &&
-        typeof File != "undefined" &&
-        typeof (new XMLHttpRequest()).upload != "undefined" );       
-};
-
-// @inherits qq.UploadHandlerAbstract
-qq.extend(qq.UploadHandlerXhr.prototype, qq.UploadHandlerAbstract.prototype)
-
-qq.extend(qq.UploadHandlerXhr.prototype, {
-    /**
-     * Adds file to the queue
-     * Returns id to use with upload, cancel
-     **/    
-    add: function(file){
-        if (!(file instanceof File)){
-            throw new Error('Passed obj in not a File (in qq.UploadHandlerXhr)');
-        }
-                
-        return this._files.push(file) - 1;        
-    },
-    getName: function(id){        
-        var file = this._files[id];
-        // fix missing name in Safari 4
-        return file.fileName != null ? file.fileName : file.name;       
-    },
-    getSize: function(id){
-        var file = this._files[id];
-        return file.fileSize != null ? file.fileSize : file.size;
-    },    
-    /**
-     * Returns uploaded bytes for file identified by id 
-     */    
-    getLoaded: function(id){
-        return this._loaded[id] || 0; 
-    },
-    /**
-     * Sends the file identified by id and additional query params to the server
-     * @param {Object} params name-value string pairs
-     */    
-    _upload: function(id, params){
-        var file = this._files[id],
-            name = this.getName(id),
-            size = this.getSize(id);
-                
-        this._loaded[id] = 0;
-                                
-        var xhr = this._xhrs[id] = new XMLHttpRequest();
-        var self = this;
-                                        
-        xhr.upload.onprogress = function(e){
-            if (e.lengthComputable){
-                self._loaded[id] = e.loaded;
-                self._options.onProgress(id, name, e.loaded, e.total);
-            }
-        };
-
-        xhr.onreadystatechange = function(){            
-            if (xhr.readyState == 4){
-                self._onComplete(id, xhr);                    
-            }
-        };
-
-        // build query string
-        params = params || {};
-        params['qqfile'] = name;
-        var queryString = qq.obj2url(params, this._options.action);
-
-        xhr.open("POST", queryString, true);
-        xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-        xhr.setRequestHeader("X-File-Name", encodeURIComponent(name));
-        xhr.setRequestHeader("Content-Type", "application/octet-stream");
-        xhr.send(file);
-    },
-    _onComplete: function(id, xhr){
-        // the request was aborted/cancelled
-        if (!this._files[id]) return;
-        
-        var name = this.getName(id);
-        var size = this.getSize(id);
-        
-        this._options.onProgress(id, name, size, size);
-                
-        if (xhr.status == 200){
-            this.log("xhr - server response received");
-            this.log("responseText = " + xhr.responseText);
-                        
-            var response;
-                    
-            try {
-                response = eval("(" + xhr.responseText + ")");
-            } catch(err){
-                response = {};
-            }
-            
-            this._options.onComplete(id, name, response);
-                        
-        } else {                   
-            this._options.onComplete(id, name, {});
-        }
-                
-        this._files[id] = null;
-        this._xhrs[id] = null;    
-        this._dequeue(id);                    
-    },
-    _cancel: function(id){
-        this._options.onCancel(id, this.getName(id));
-        
-        this._files[id] = null;
-        
-        if (this._xhrs[id]){
-            this._xhrs[id].abort();
-            this._xhrs[id] = null;                                   
-        }
-    }
-});

+ 0 - 744
apps/filebrowser/src/filebrowser/static/js/Source/FileBrowser/Hue.FileBrowser.js

@@ -1,744 +0,0 @@
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-/*
----
-description: File Browser
-provides: [Hue.FileBrowser, Hue.FileChooser, Hue.FileSaver, CCS.FileBrowser, CCS.FileChooser, CCS.FileSaver]
-requires: [hue-shared/Hue.JBrowser, fancyupload/FancyUpload3.Attach, More/URI, More/Fx.Reveal, Widgets/Element.Data]
-script: Hue.FileBrowser.js
-
-...
-*/
-ART.Sheet.define('window.filebrowser.browser', {
-	'min-width': 620
-});
-
-ART.Sheet.define('window.filebrowser.alert content', {
-	'padding': 20,
-	'font-size': 14,
-	'text-align': 'center'
-}, 'css');
-
-ART.Sheet.define('window.filechooser.browser.alert', {
-	'header-height': 54,
-	'min-height': 240,
-	'min-width': 300
-});
-ART.Sheet.define('window.filechooser.browser.alert content', {
-	'padding': 0
-}, 'css');
-
-ART.Sheet.define('window.filechooser.browser', {
-	'header-height': 54,
-	'min-height': 240,
-	'min-width' : 300,
-	'footer-height':30 
-});
-
-(function(){
-
-	var filebrowser = {
-	
-		options: {
-			//used for ART styling (see above styles)
-			className: 'art filebrowser browser logo_header',
-			//the prefixed path to the actions
-			//this value is prepended with "/"
-			//and is given the action as a suffix
-			//for example: /filebrowser/view
-			filesystem: 'filebrowser',
-			//either 'view' or 'chooser'
-			//'view' = the main browser; a standard table of files
-			//'chooser' = the same, but customized for the file chooser
-			view: 'view',
-			//filter: either 'file', 'dir', or 'any'
-			//used to enforce choices available in the chooser
-			//ignored in the filebrowser
-			filter: 'any',
-			windowTitler: function(title) {
-				return title + " :: File Browser";
-			}
-		},
-
-		initialize: function(path, options) {
-			this.parent(path, options);
-			this.addEvent('load', this.setup.bind(this));
-			//when an alert is visible, hide the upload swiff
-			//as it sometimes gets "stuck" to the mouse
-			this.addEvents({
-				alert: function(){
-					if (this.uploader) this.uploader.uploader.box.hide();
-				},
-				endAlert: function(){
-					if (this.uploader) this.uploader.uploader.box.show();
-				}
-			});
-			
-			this.jframe.addFilter('rename', function(container) {
-				if (!container.get('html').contains('dest_path')) return;
-				var src = container.getElement('input[name=src_path]');
-				var dest = container.getElement('input[name=dest_path]');
-				if (!src || !dest) return;
-				dest.set('value', src.get('value').split('/').getLast());
-				dest.select.delay(500, dest);
-			});
-		},
-
-		//configures history for file browser
-		setupHistory: function(){
-			//I don't do anything by default
-			//chooser doesn't have a history
-			//browser does
-		},
-
-		//removes ok events for filechooser
-		removeOkEvents: function(){
-			//do nothing by default
-			//filechooser manipulates ok events
-		},
-
-		//adds item click events
-		addRowFocusEvents: function(){
-			//do nothing by default
-			//filechooser adds delegated events
-		},
-
-		//adds fields for saver
-		addSaverInfo: function(){
-			//do nothing by default
-			//filechooser will add fields
-		},
-
-		//add linkers to jFrame for filebrowser
-		addLinkers: function(){
-			this.jframe.addLinkers({
-				'a.fb-move': function(e, link) {
-					e.stop();
-					var toMove = link.get('href').toURI().get('data', true).src_path.split('/').getLast();
-					Hue.saveFile(this, toMove, this.getDirPath(), "Move " + toMove, function(data){
-						var uri = link.get('href').toURI();
-						var params = uri.get('data', true);
-						this.jframe.load({
-							requestPath: link.get('href').split('?')[0],
-							method: 'post',
-							data: {
-								src_path: params.src_path,
-								dest_path: data.path,
-								next: params.next
-							}
-						});
-					}.bind(this), {
-						filesystem: this.options.filesystem,
-						filter: 'dir'
-					});
-				}.bind(this)
-			});
-		},
-
-		//shortcuts for dirlist; the only view we have (in theory)
-		addFBShortcuts: function(){
-			this.jframe.addShortcuts({
-				'Open Selected': {
-					keys: 'enter',
-					shortcut: 'enter',
-					handler: function(e){
-						var table = $(this).getElement('[data-filters*=HtmlTable]');
-						if (!table) return;
-						hTable = table.retrieve('HtmlTable');
-						var selected = hTable.selectedRows[0];
-						if (!selected) return;
-						Hue.JFrame.doubleClickHandler(this.jframe, e, selected);
-					}.bind(this),
-					description: 'Open the selected item.'
-				},
-			//TODO: Make Keyboard shortcuts more cognizant of the focus being on an input field
-				'Remove Selected': {
-					keys: 'keydown:backspace',
-					shortcut: 'backspace',
-					handler: function(e){
-						if ($(e.target).match('input, textarea')) return;
-						e.stop();
-						var table = this.getDirList().retrieve('HtmlTable');
-						//the view only allows one item to be selected at a time currently
-						//but selectedRows is an array, so just always use the first one.
-						if (table.selectedRows[0]) this.jframe.callClick(e, table.selectedRows[0].getElement('a.fb-default-rm'));
-					}.bind(this),
-					description: 'Remove the selected file/folder.'
-				}
-			});
-		},
-
-		makeUploader: function(dest){
-			if (Browser.Plugins.Flash.build) {
-				this.uploader = new Hue.FileBrowser.Uploader(dest, this.jframe, {
-					//the DOM element where we're going to display our results
-					list: $(this).getElement('.fb-upload-list'),
-					listContainer: $(this).getElement('.fb-uploader'),
-					button: $(this).getElement('.fb-upload'),
-					uploaderOptions: {
-						//call this url when we upload a file
-						url: '/' + this.options.filesystem + '/upload_flash',
-						container: this.toolbar
-					}
-				});
-			} else {
-				var uploader = $(this).getElement('.fb-upload');
-				if (uploader) uploader.set('target', '_blank');
-			}
-		},
-
-		//when jframe loads, set up the content
-		setup: function(view){
-			if (!this._shortcutsAdded) {
-				this.addFBShortcuts();
-				this._shortcutsAdded = true;
-			}
-			this.setupHistory();
-			this.addLinkers();
-			this.removeOkEvents();
-			this.addSaverInfo();
-			this.addRowFocusEvents();
-						//make the uploader
-			(function(){
-				//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
-				//the swf file
-				var uploader = $(this).getElement('.fb-upload');
-				if (uploader) this.makeUploader(uploader.get('href').toURI().get('data').dest);
-			}).delay(10, this);
-
-		},
-
-		//returns the file list element
-		getDirList: function(){
-			return $(this).getElement('.fb-file-list');
-		},
-
-		//returns the path relative to the current file system
-		getDirPath: function(){
-			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; 
-		}
-
-
-
-	};
-	
-	/*
-		the filebrowser class
-		arguments
-		* path - the base path from the file system; defaults to '/'
-		* options - see options defined w/ notes above in the filebrowser object
-	*/
-	
-	Hue.FileBrowser = new Class(
-		$merge({
-			Extends: Hue.JBrowser
-		}, filebrowser, {
-			//configures history for file browser
-			setupHistory: function(){
-				this.history.setOptions({
-					editable: true,
-					pathFilter: function(path) {
-						return path.replace('/' + this.options.filesystem + '/' + this.options.view, '').split('?')[0];
-					}.bind(this),
-					showPath: false
-				});
-				this.history.addEvent('selectManual', function(path) {
-					this.jframe.load({
-						requestPath: '/filebrowser/view' + path
-					});
-				}.bind(this));
-			}
-		})
-	);
-	
-	/*
-		the file chooser class; not really meant to be used as a standalone
-		see Hue.chooseFile below
-		The exception is when an application requires the file chooser to launch;
-		then there isn't a JBrowser instance already, so use the constructor
-		
-		arguments:
-		* same as FileBrowser (path, options)
-	*/
-	ART.Sheet.define('window.art.browser.filechooser', {
-		'content-border-bottom-color': hsb(0, 0, 60),
-		'min-width': 600
-	});
-	
-	var FileChooser = new Class(
-		$merge({
-			Extends: Hue.JBrowser.Confirm
-		}, filebrowser, {
-			options: {
-				autosize: false,
-				className: 'art filechooser filebrowser browser alert confirm'
-			},
-			removeOkEvents: function() {
-				//remove the closeWin class; this selector is designed to close the window
-				$(this.getOk()).removeClass('closeWin');
-				//remove any click handlers
-				this.getOk().removeEvents('press');
-			},
-			getOk: function() {
-				return this.alertButtons[1];
-			},
-			getSelected: function(table) {
-				var selectInfo = {'data': null, 'elem' : null};
-				hTable = table.retrieve('HtmlTable');
-				var selected = hTable.selectedRows[0];
-				selectInfo.data = selected.get('data', 'filedata', true);
-				if (!selected) return null;
-				else selectInfo.elem = selected;
-				return selectInfo;
-			}
-		})
-	);
-
-	
-	Hue.FileChooser = new Class({
-		Extends: FileChooser,
-		options: {
-			windowTitler: function() {
-				return this.caption || "Choose a File";
-			}
-		},
-		addFBShortcuts: function() {
-			this.jframe.addShortcuts({
-				'Select Highlighted': {
-					keys: 'enter',
-					shortcut: 'enter',
-					handler: function(e){
-						var table = $(this).getElement('[data-filters*=HtmlTable]');
-						if (!table) return;
-						var selectInfo = this.getSelected(table);
-						if (selectInfo == null) return;
-						var selectData = selectInfo.data;
-						var selected = selectInfo.elem;
-						if (selectData.type == 'dir') Hue.JFrame.doubleClickHandler(this.jframe, e, selected);
-						else if (selectData.type == 'file') this.getOk().fireEvent('press');
-					}.bind(this)
-				},
-				'Close': {
-					keys: 'escape',
-					shortcut: 'escape',
-					handler: function(e) {
-						Keyboard.stop(e);
-						this.hide();
-					}
-				}
-			});
-		}
-
-	});
-
-	Hue.FileSaver = new Class({		 
-		Extends: FileChooser,
-		options: {
-			windowTitler: function() {
-				return this.caption || "Choose Where To Save This File";
-			}.bind(this)
-		},
-		//append an input to the alert, allowing the user to view/enter the path where the file will be saved
-		addSaverInfo: function() {
-			var locationInput = new Element("input", {
-				'type' : 'text',
-				'class': 'fs-locationInput',
-				'value': this.options.fileToMove || ""
-			});
-			var locationDiv = new Element("div", {
-				'class': 'fs-location',
-				'html' : 'File Name:'
-			});
-			locationInput.inject(locationDiv);
-			locationDiv.inject($(this.footer), 'top');
-			this.locationInput = locationInput;
-		},
-		//add events which will occur when rows of filebrowser table are focused 
-		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));
-
-		},
-		//add keyboard shortcuts for filebrowser
-		addFBShortcuts: function(){
-			this.jframe.addShortcuts({
-			'Select Highlighted': {
-				keys: 'enter',
-				shortcut: 'enter',
-				handler: function(e){
-					if (document.activeElement != this.locationInput) { 
-						var table = $(this).getElement('[data-filters*=HtmlTable]');
-						if (!table) return;
-						hTable = table.retrieve('HtmlTable');
-						var selected = hTable.selectedRows[0];
-						if (!selected) return;
-						var selectData = selected.get('data', 'filedata', true);
-						if (selectData.type == 'dir') Hue.JFrame.doubleClickHandler(this.jframe, e, selected);
-						//Leaving this code here for when overwrite does work.
-						/*else if (selectData.type == 'file') {
-							locationInput.set('value', selectData.path.split('/').getLast());
-							this.jframe.confirm("Warning!", "This will overwrite " + selectData.path + ".	 Are you sure you want to do this ?",	 function() {
-							this.getOk().fireEvent('press');
-						}.bind(this), {});
-							confirmDialog.show();
-						}*/
-					} else {
-						this.getOk().fireEvent('press');
-					}
-				}.bind(this),
-				description: 'Select the highlighted row or folder.'
-			}
-			});
-		}
-	});
-
-	/*
-	Brings up a file chooser for a window
-	arguments:
-	* fsPath - the root path from the file system; defaults to '/'
-	* cap - the caption of the window; defaults to "Choose a File"
-	* fn - the callback to execute when the user choose a file
-	* options - options passed to Hue.FileChooser
-		* plus:
-		* filter: (string) either 'file', 'dir', or 'any' to limit choices the user can make
-	*/
-	Hue.chooseFile = function(jbrowser, fsPath, cap, fn, opt){
-		return jbrowser.alert(cap, '', fn || $empty, opt, function(caption, content, callback, options) {
-			$extend(options || {}, {
-				caption: caption || "Choose a File",
-				className: 'art filechooser filebrowser browser alert',
-				resizable: true
-			});
-			var chooser = new Hue.FileChooser("/filebrowser/view" + fsPath, options);
-			//set caption when jframe is done loading
-			chooser.jframe.addEvent('loadComplete', function() {
-				this.setCaption(chooser.getDirPath() + " :: " + caption);
-				chooser.getOk().addEvent('press', function(){
-				var selected = $(chooser).getElement('.table-tr-selected');
-				var error = function(){
-					var msg = "Please choose a directory.";
-					if (options.filter == "file") msg = "Please choose a file.";
-					chooser.alert(caption || "Choose a File", msg);
-					chooser.fireEvent('badSelection', selected);
-				};
-				if (selected) {
-					//If file_filter was part of query, the filtered rows will have a "not-selectable" class.
-					if (selected.hasClass('not-selectable')) {
-						error();
-						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.
-					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();
-						}
-					}
-				} else if (options.filter == "file") {
-					//If nothing is selected, and filter is 'file', show error.
-					error();
-				} else {
-					//If nothing is selected, and filter is 'dir or any', call callback using chooser's current directory as path.
-					callback({
-						path: chooser.getDirPath(),
-						type: 'dir'
-					});
-					chooser.hide();
-				}
-			});
-
-			}.bind(chooser));
-			//add event on click of ok button which handles filtering and passing of file data to callback 
-						return chooser;
-		});
-	};
-	Hue.saveFile = function(jbrowser, toMove, fsPath, cap, fn, opt){
-		return jbrowser.alert(cap, '', fn || $empty, opt, function(caption, content, callback, options) {
-				$extend(options || {}, {
-					caption: caption || "Choose a File",
-					className: 'art filechooser filebrowser browser alert',
-					resizable: true,
-					fileToMove: toMove
-				});
-				var saver = new Hue.FileSaver("/filebrowser/view" + fsPath + "?show_upload=false", options);
-				//Set caption on loadComplete
-				saver.jframe.addEvent('loadComplete', function() {
-					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();
-						}
-					});
-				}.bind(saver));
-				return saver;
-		});
-	};
-})();
-
-//have to hack the FancyUpload class a little because it has a hard-coded path in it
-FancyUpload3.Attach.File2 = new Class({
-	Extends: FancyUpload3.Attach.File,
-	render: function(){
-		var result = this.parent();
-		this.ui.progress.element.src = "/static/js/ThirdParty/digitarald-fancyupload/assets/progress-bar/bar.gif";
-		return result;
-	},
-
-	// To handle errors, we parse out the JSON response.  The stock uploader
-	// uses the HTTP status and error string, which is hard to customize 
-	// in Django.
-	onComplete: function() {
-		response_obj = JSON.decode(this.response.text, true);
-		if (response_obj && response_obj.error) {
-			this.response.error = response_obj.error;
-		}
-		this.parent.apply(this, arguments);
-	}
-});
-
-
-Hue.FileBrowser.Uploader = new Class({
-
-	Implements: Options,
-
-	options: {
-		//the DOM element that is hidden that contains the result list
-		//listContainer: null,
-
-		//the DOM element where we're going to display our results
-		//list,
-
-		//the button that prompts the user to select a local file
-		//button: null
-		uploaderOptions: {
-			//call this url when we upload a file
-			//url: null,
-			//container: null
-			path: '/static/js/ThirdParty/digitarald-fancyupload/source/Swiff.Uploader.swf',
-			//this is the key for the file in the POST params
-			fieldName: 'hdfs_file',
-			method: 'post',
-			appendCookieData: true
-		}
-	},
-
-	initialize: function(dest, jframe, options){
-		this.dest = dest || '/';
-		this.jframe = jframe;
-		this.setOptions(options);
-		this.makeSwf();
-		this.completedFiles = 0;
-	},
-
-	makeSwf: function(){
-		/**
-		 * Uploader instance
-		 */
-		//create an instance of uploader, attach our click behavior to the "upload" button in the toolbar
-		var list = $(this.options.list);
-		var button = (this.options.button);
-		this.uploader = new FancyUpload3.Attach(list, button, $merge({
-			data: {
-				//dest is the destination path (directory) for the file
-				dest: this.dest
-			},
-			fileClass: FancyUpload3.Attach.File2,
-
-			//when we select an invalid file, show an error
-			onSelectFail: function(files) {
-				files.each(function(file) {
-					new Element('li', {
-						'class': 'file-invalid',
-						events: {
-							click: function() {
-								this.destroy();
-							}
-						}
-					}).adopt(
-						new Element('span', {html: file.validationErrorMessage || file.validationError})
-					).inject(this.list, 'bottom');
-				}, this); 
-			},
-
-			//when we succeed, highlight the element and then, after a moment, transition it out
-			//of view
-			onFileSuccess: function(file) {
-				file.ui.element.highlight('#e6efc2');
-				(function(){
-					file.ui.element.nix();
-				}).delay(300);
-				this.completedFiles++;
-			}.bind(this),
-
-			//when the file fails to upload, display the error and a link to retry
-			onFileError: function(file) {
-				file.ui.cancel.set('html', 'Retry').removeEvents().addEvent('click', function() {
-					file.requeue();
-					return false;
-				});
-
-				new Element('span', {
-					html: file.errorMessage,
-					'class': 'file-error'
-				}).inject(file.ui.cancel, 'after');
-				this.completedFiles++;
-			}.bind(this),
-
-			onFileRequeue: function(file) {
-				file.ui.element.getElement('.file-error').destroy();
-
-				file.ui.cancel.set('html', 'Cancel').removeEvents().addEvent('click', function() {
-					file.remove();
-					return false;
-				});
-
-				this.start();
-			},
-
-			//when all files are complete and there are no errors,
-			//hide the upload display and refresh the file browser
-			onComplete: function() {
-				// onComplete might get fired before onFileError does, in which case this
-				// routine will hide the uploader without ever having shown the user the
-				// error message. So, we manually wait until every file has reported its
-				// status.
-				if (this.completedFiles < this.uploader.fileList.length) {
-					this.uploader.fireEvent.delay(100, this.uploader, ['onComplete']);
-					return;
-				}
-				// Every file we tried to upload has reported either success or failure at this point.
-				if (list.getElement('span.file-error')) return;
-				this.hide();
-				this.jframe.refresh();
-			}.bind(this),
-
-			onStop: function(){
-				this.jframe.refresh();
-			}.bind(this),
-
-			//show the file upload display when we start uploading
-			onBeforeStart: this.show.bind(this)
-
-		}, this.options.uploaderOptions));
-		//when we resize jframe, reposition the upload swf
-		var reposition = this.uploader.reposition.bind(this.uploader);
-		this.jframe.addEvent('resize', reposition);
-		this.jframe.markForCleanup(function(){
-			//remove this event on unload
-			this.jframe.removeEvent('resize', reposition);
-		}.bind(this));
-		
-		$(this.jframe).getElements('.fb-cancel-upload').addEvent('click', function(e) {
-			//cancel upload stops the uploader and hides the display of files uploading and refreshes
-			e.stop();
-			if (this.uploader) this.uploader.stop();
-			this.hide();
-			this.jframe.refresh();
-		}.bind(this));
-	},
-
-	//display the upload indicator area
-	show: function(){
-		var list = $(this.options.listContainer);
-		var events = {
-			resize: function(x, y) {
-				//when we resize, reposition the mask and the upload display
-				this.uploadMask.position();
-				this.uploader.position();
-			}.bind(this)
-		};
-		this.jframe.addEvents(events);
-		//if there isn't an uploadMask, create one
-		if (!this.uploadMask) {
-			this.uploadMask = new Mask($(this.jframe), {
-				hideOnClick: true,
-				onHide: function() {
-					//hide the uploader display
-					list.hide();
-					//remove the resize monitor
-					this.jframe.removeEvents(events);
-				}.bind(this)
-			});
-		}
-		//show the mask
-		this.uploadMask.show();
-		//show the upload list
-		list.show().position({ relativeTo: $(this.jframe)});
-	},
-
-	//hide the upload display and the mask
-	hide: function(){
-		if (this.uploadMask) this.uploadMask.hide();
-	}
-});

+ 0 - 106
apps/filebrowser/src/filebrowser/static/js/Source/FileBrowser/Hue.FileEditor.js

@@ -1,106 +0,0 @@
-/*
----
-
-description: File Editor
-provides: [Hue.FileEditor]
-requires: [JFrame/JFrame.Browser, clientcide/PostEditor, /Hue.FileBrowser]
-script: Hue.FileEditor.js
-
-...
-*/
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-ART.Sheet.define('window.browser.fileeditor', {
-	'min-width': 620,
-	'min-height': 310
-});
-
-Hue.FileEditor = new Class({
-
-	Extends: Hue.JBrowser,
-
-	options: {
-		className: 'art browser fileeditor logo_header',
-		displayHistory: false,
-		  prefix: "/filebrowser/edit",
-		  filesystem: "filebrowser"
-	 },
-
-	 getDirPath: function() {
-		  return this.jframe.currentPath.replace(this.options.prefix, '');
-	 },
-
-	initialize: function (path, options) {
-		this.parent(path || '/filebrowser/', options);
-		this.jframe.addRenderers({
-			'saveAsPrompt_popup': function (content) {
-				var saveAs = content.elements.filter('.saveAsPrompt_popup')[0];
-				if(!saveAs) return;
-				var path = this.getDirPath();
-				var file = path.split('/').getLast();
-				var pathNoFile = this.getDirPath().replace('/' + file, '');
-				Hue.saveFile(this, file, pathNoFile, "Save As", function(data) {
-					var form = saveAs.getElement("form");
-					this.jframe.applyFilter('formRequest', saveAs);
-					this.jframe.applyBehavior('FormRequest', form);
-					var request = form.retrieve('form.request');
-					saveAs.getElement('input[name=path]').set('value', data.path);
-					request.send();
-				}.bind(this), {
-						filesystem: this.options.filesystem,
-						filter: 'dir'
-				});
-				return true;
-			}.bind(this) 
-		});
-		this.jframe.addEvents({
-			beforeRenderer: function (content) {
-				var toolbar = content.elements.filter('div.toolbar')[0];
-				if (!toolbar) return;
-				var buttons = toolbar.getElement('.fe-buttons');
-				if (!buttons) return;
-				['saveAs', 'save'].each(function(button) {
-					var link = new Element("a", {
-						'class': 'fe-' + button + 'Button',
-						'data-filters': 'ArtButton',
-						'data-icon-styles': "{'width': 16, 'height': 16}",
-						'events': {
-							'click': function (e) {
-								e.preventDefault();
-								var form = $(this.jframe).getElement(".fe-editForm");
-								var request = form.retrieve('form.request');
-								request.setOptions({
-									extraData: {
-										'save': button
-									}
-								});
-								request.send();
-							}.bind(this)
-						},
-						'html': button.hyphenate().replace("-", " ").capitalize()
-					}).inject(buttons, 'top');
-				}, this);
-			}.bind(this)
-		});
-		this.addEvents({
-			load: function(){
-				$(this.jframe).setStyle('overflow', 'hidden');
-			}.bind(this)
-		});
-		
-	}
-});

+ 0 - 90
apps/filebrowser/src/filebrowser/static/js/Source/FileBrowser/Hue.FileViewer.js

@@ -1,90 +0,0 @@
-/*
----
-description: File Viewer
-provides: [Hue.FileViewer]
-requires: [JFrame/JFrame.Browser]
-script: Hue.FileViewer.js
-
-...
-*/
-
-// Licensed to Cloudera, Inc. under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  Cloudera, Inc. licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-ART.Sheet.define('window.browser.fileviewer', {
-	'min-width': 820 
-});
-
-ART.Sheet.define('window.browser.fileviewer splitview', {
-	'fixed-width': 200,
-	'right-background-color': '#ddd'
-});
-
-
-Hue.FileViewer = new Class({
-
-	Extends: Hue.JBrowser,
-
-	options: {
-		className: 'art browser fileviewer logo_header',
-		displayHistory: false
-	},
-
-	initialize: function(path, options){
-		this.parent(path || '/filebrowser/', options);
-		this.jframe.addShortcuts({
-			'Go To Next Block': {
-				keys: 'v+right',
-				shortcut: 'v + right',
-				handler: function(e) {
-					this._simulateAnchorClick('.fv-nextBlock');
-				}.bind(this),
-				description: 'Navigate to the next block of content.'
-			},
-			'Go To Previous Block': {
-				keys: 'v+left',
-				shortcut: 'v + left',
-				handler: function(e) {
-					this._simulateAnchorClick('.fv-prevBlock');
-				}.bind(this),
-				description: 'Navigate to the previous block of content.'
-			},
-			'Go To First Block': {
-				keys: 'v+up',
-				shortcut: 'v + up',
-				handler: function(e) {
-					this._simulateAnchorClick('.fv-firstBlock');
-				}.bind(this),
-				description: 'Navigate to first block of content.'
-			},
-			'Go To Last Block': {
-				keys: 'v+down',
-				shortcut: 'v + down',
-				handler: function(e) {
-					this._simulateAnchorClick('.fv-lastBlock');
-				}.bind(this),
-				description: 'Navigate to last block of content.'
-			}
-		});
-	},
-
-	_simulateAnchorClick: function(anchorSelector) {
-		var href = $(this).getElement(anchorSelector).get('href');
-		if(href) this.load({requestPath: href});
-	}
-
-	
-
-});

+ 0 - 5
apps/filebrowser/src/filebrowser/static/js/package.yml

@@ -1,5 +0,0 @@
-copyright: Apache License v2.0
-version: 0.9
-description: File Browser
-name: filebrowser
-sources: [Source/FileBrowser/Hue.FileBrowser.js, Source/FileBrowser/Hue.FileViewer.js, Source/FileBrowser/Hue.FileEditor.js]