allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#8026] remove file_chooser.js (unsure of its licensing) and related files. They were unused.
Date Mon, 23 Nov 2015 19:59:42 GMT
Repository: allura
Updated Branches:
  refs/heads/db/8026 [created] 5df150627


[#8026] remove file_chooser.js (unsure of its licensing) and related files.  They were unused.


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5df15062
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5df15062
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5df15062

Branch: refs/heads/db/8026
Commit: 5df1506277b89aed2282f9b76a5a9cd17532a2cc
Parents: 0e6cbbe
Author: Dave Brondsema <dave@brondsema.net>
Authored: Mon Nov 23 14:51:45 2015 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Mon Nov 23 14:51:45 2015 -0500

----------------------------------------------------------------------
 Allura/allura/lib/widgets/form_fields.py        | 35 -------
 .../widgets/resources/js/jquery.file_chooser.js | 96 --------------------
 .../allura/templates/widgets/file_chooser.html  | 21 -----
 ForgeTracker/forgetracker/tracker_main.py       |  1 -
 4 files changed, 153 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/5df15062/Allura/allura/lib/widgets/form_fields.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/form_fields.py b/Allura/allura/lib/widgets/form_fields.py
index e33862f..1bfebcd 100644
--- a/Allura/allura/lib/widgets/form_fields.py
+++ b/Allura/allura/lib/widgets/form_fields.py
@@ -346,41 +346,6 @@ class PageSize(ew_core.Widget):
                 this.form.submit();});''')
 
 
-class FileChooser(ew.InputField):
-    template = 'jinja:allura:templates/widgets/file_chooser.html'
-    validator = fev.FieldStorageUploadConverter()
-    defaults = dict(
-        ew.InputField.defaults,
-        name=None)
-
-    def resources(self):
-        for r in super(FileChooser, self).resources():
-            yield r
-        yield ew.JSLink('js/jquery.file_chooser.js')
-        yield onready('''
-            var num_files = 0;
-            var chooser = $('input.file_chooser').file();
-            chooser.choose(function (e, input) {
-                var holder = document.createElement('div');
-                holder.style.clear = 'both';
-                e.target.parentNode.appendChild(holder);
-                $(holder).append(input.val());
-                $(holder).append(input);
-                input.attr('name', e.target.id + '-' + num_files);
-                input.hide();
-                ++num_files;
-                var delete_link = document.createElement('a');
-                delete_link.className = 'btn';
-                var icon = document.createElement('b');
-                icon.className = 'ico delete';
-                delete_link.appendChild(icon);
-                $(delete_link).click(function () {
-                    this.parentNode.parentNode.removeChild(this.parentNode);
-                });
-                $(holder).append(delete_link);
-            });''')
-
-
 class JQueryMixin(object):
     js_widget_name = None
     js_plugin_file = None

http://git-wip-us.apache.org/repos/asf/allura/blob/5df15062/Allura/allura/lib/widgets/resources/js/jquery.file_chooser.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/jquery.file_chooser.js b/Allura/allura/lib/widgets/resources/js/jquery.file_chooser.js
deleted file mode 100644
index 2cc4f7b..0000000
--- a/Allura/allura/lib/widgets/resources/js/jquery.file_chooser.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF 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.
-*/
-
-jQuery.fn.choose = function(f) {
-	$(this).bind('choose', f);
-};
-
-
-jQuery.fn.file = function() {
-	return this.each(function() {
-		var btn = $(this);
-		var pos = btn.offset();
-
-		function update() {
-			pos = btn.offset();
-			file.css({
-				'top': pos.top,
-				'left': pos.left,
-				'width': btn.width(),
-				'height': btn.height()
-			});
-		}
-
-		btn.mouseover(update);
-
-		var hidden = $('<div></div>').css({
-			'display': 'none'
-		}).appendTo('body');
-
-		var file = $('<div><form></form></div>').appendTo('body').css({
-			'position': 'absolute',
-			'overflow': 'hidden',
-			'-moz-opacity': '0',
-			'filter':  'alpha(opacity: 0)',
-			'opacity': '0',
-			'z-index': '2'
-		});
-
-		var form = file.find('form');
-		var input = form.find('input');
-
-		function reset() {
-			var input = $('<input type="file" multiple>').appendTo(form);
-			input.change(function(e) {
-				input.unbind();
-				input.detach();
-				btn.trigger('choose', [input]);
-				reset();
-			});
-		};
-
-		reset();
-
-		function placer(e) {
-			form.css('margin-left', e.pageX - pos.left - offset.width);
-			form.css('margin-top', e.pageY - pos.top - offset.height + 3);
-		}
-
-		function redirect(name) {
-			file[name](function(e) {
-				btn.trigger(name);
-			});
-		}
-
-		file.mousemove(placer);
-		btn.mousemove(placer);
-
-		redirect('mouseover');
-		redirect('mouseout');
-		redirect('mousedown');
-		redirect('mouseup');
-
-		var offset = {
-			width: file.width() - 25,
-			height: file.height() / 2
-		};
-
-		update();
-	});
-};

http://git-wip-us.apache.org/repos/asf/allura/blob/5df15062/Allura/allura/templates/widgets/file_chooser.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/file_chooser.html b/Allura/allura/templates/widgets/file_chooser.html
deleted file mode 100644
index 7c89594..0000000
--- a/Allura/allura/templates/widgets/file_chooser.html
+++ /dev/null
@@ -1,21 +0,0 @@
-{#-
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF 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.
--#}
-<div>
-   <input type="button" id="{{name}}" class="file_chooser" value="Choose File"/>
-</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/5df15062/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 4eec4d5..45d24b4 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -215,7 +215,6 @@ class W:
     ticket_form = TicketForm()
     subscribe_form = SubscribeForm()
     auto_resize_textarea = ffw.AutoResizeTextarea()
-    file_chooser = ffw.FileChooser()
     ticket_subscribe_form = SubscribeForm(thing='ticket')
     field_admin = TrackerFieldAdmin()
     field_display = TrackerFieldDisplay()


Mime
View raw message