summaryrefslogtreecommitdiffstats
path: root/htdocs
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2009-01-29 17:38:46 +1100
committerJeremy Kerr <jk@ozlabs.org>2009-01-29 17:38:46 +1100
commitc105cb0f107a7459abc8c33988d2da24582a7a5a (patch)
treeb45da7063fc8a4598e169b61d475d6a915e5641e /htdocs
parent6eb48bb0ca07765185fc21015fe815be18282f07 (diff)
downloadpatchwork-c105cb0f107a7459abc8c33988d2da24582a7a5a.tar.bz2
patchwork-c105cb0f107a7459abc8c33988d2da24582a7a5a.tar.xz
Initial bundle reordering support
todo: * implement ajax reorder api * finish migration script * order patches in bundle view Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'htdocs')
-rw-r--r--htdocs/js/bundle.js41
l---------htdocs/js/jquery-1.2.6.js1
l---------htdocs/js/jquery.tablednd_0_5.js1
3 files changed, 43 insertions, 0 deletions
diff --git a/htdocs/js/bundle.js b/htdocs/js/bundle.js
new file mode 100644
index 0000000..dc4fb9c
--- /dev/null
+++ b/htdocs/js/bundle.js
@@ -0,0 +1,41 @@
+function parse_patch_id(id_str)
+{
+ var i;
+
+ i = id_str.indexOf(':');
+ if (i == -1)
+ return null;
+
+ return id_str.substring(i + 1);
+}
+
+function bundle_handle_drop(table, row)
+{
+ var relative, relation, current;
+ var relative_id, current_id;
+
+ current = $(row);
+ relative = $(current).prev();
+ relation = 'after';
+
+ /* if we have no previous row, position ourselves before the next
+ * row instead */
+ if (!relative.length) {
+ relative = current.next();
+ relation = 'before';
+
+ if (!relative)
+ return;
+ }
+
+ current_id = parse_patch_id(current.attr('id'));
+ relative_id = parse_patch_id(relative.attr('id'));
+
+ alert("put patch " + current_id + " " + relation + " " + relative_id);
+}
+
+$(document).ready(function() {
+ $("#patchlist").tableDnD({
+ onDrop: bundle_handle_drop
+ });
+});
diff --git a/htdocs/js/jquery-1.2.6.js b/htdocs/js/jquery-1.2.6.js
new file mode 120000
index 0000000..cb24de6
--- /dev/null
+++ b/htdocs/js/jquery-1.2.6.js
@@ -0,0 +1 @@
+../../lib/packages/jquery/jquery-1.2.6.js \ No newline at end of file
diff --git a/htdocs/js/jquery.tablednd_0_5.js b/htdocs/js/jquery.tablednd_0_5.js
new file mode 120000
index 0000000..5918e24
--- /dev/null
+++ b/htdocs/js/jquery.tablednd_0_5.js
@@ -0,0 +1 @@
+../../lib/packages/jquery/jquery.tablednd_0_5.js \ No newline at end of file