[Pkg-javascript-commits] [SCM] flot branch, master, updated. debian/0.6-1-33-g9759e10

Marcelo Jorge Vieira metal at alucinados.com
Thu May 30 21:03:08 UTC 2013


The following commit has been merged in the master branch:
commit a2cfa774fe9c79485d7b30d050c8ac52926ce2ca
Author: Marcelo Jorge Vieira <metal at alucinados.com>
Date:   Wed May 29 15:49:26 2013 -0300

    Removed embedded code from jquery.flot.resize.js

diff --git a/debian/control b/debian/control
index b1e15f9..870d35b 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
 Uploaders: Marcelo Jorge Vieira (metal) <metal at debian.org>
 Build-Depends: debhelper (>= 7.0.50~), node-uglify, libjs-jquery-mousewheel,
- libjs-jquery-event-drag
+ libjs-jquery-event-drag, libjs-jquery-resize
 Standards-Version: 3.9.4
 Homepage: http://code.google.com/p/flot/
 Vcs-Browser: http://git.debian.org/?p=pkg-javascript/flot.git
diff --git a/debian/jquery.flot.resize.js b/debian/jquery.flot.resize.js
new file mode 100644
index 0000000..2fa46cf
--- /dev/null
+++ b/debian/jquery.flot.resize.js
@@ -0,0 +1,49 @@
+/* Flot plugin for automatically redrawing plots as the placeholder resizes.
+
+Copyright (c) 2007-2013 IOLA and Ole Laursen.
+Licensed under the MIT license.
+
+It works by listening for changes on the placeholder div (through the jQuery
+resize event plugin) - if the size changes, it will redraw the plot.
+
+There are no options. If you need to disable the plugin for some plots, you
+can just fix the size of their placeholders.
+
+*/
+
+(function ($) {
+    var options = { }; // no options
+
+    function init(plot) {
+        function onResize() {
+            var placeholder = plot.getPlaceholder();
+
+            // somebody might have hidden us and we can't plot
+            // when we don't have the dimensions
+            if (placeholder.width() == 0 || placeholder.height() == 0)
+                return;
+
+            plot.resize();
+            plot.setupGrid();
+            plot.draw();
+        }
+        
+        function bindEvents(plot, eventHolder) {
+            plot.getPlaceholder().resize(onResize);
+        }
+
+        function shutdown(plot, eventHolder) {
+            plot.getPlaceholder().unbind("resize", onResize);
+        }
+        
+        plot.hooks.bindEvents.push(bindEvents);
+        plot.hooks.shutdown.push(shutdown);
+    }
+    
+    $.plot.plugins.push({
+        init: init,
+        options: options,
+        name: 'resize',
+        version: '1.0'
+    });
+})(jQuery);
diff --git a/debian/rules b/debian/rules
index 380419b..33c90ef 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,6 +8,9 @@ override_dh_auto_build:
 	cat /usr/share/javascript/jquery-mousewheel/jquery.mousewheel.min.js >> jquery.flot.navigate.js
 	cat /usr/share/javascript/jquery-event-drag/jquery.event.drag.min.js >> jquery.flot.navigate.js
 	cat debian/jquery.flot.navigate.js >> jquery.flot.navigate.js
+	# jquery.flot.resize.js
+	cat /usr/share/javascript/jquery-resize/jquery.ba-resize.min.js > jquery.flot.resize.js
+	cat debian/jquery.flot.resize.js >> jquery.flot.resize.js
 	for file in `ls *.js`; do \
 		uglifyjs -o $${file%.js}.min.js $$file; \
 	done
@@ -15,6 +18,7 @@ override_dh_auto_build:
 override_dh_auto_clean:
 	rm -f *.min.js
 	rm -f jquery.flot.navigate.js
+	rm -f jquery.flot.resize.js
 
 get-orig-source:
 	OUTDIR=$$PWD ; \
@@ -33,6 +37,7 @@ get-orig-source:
 	rm -f jquery.js ; \
 	rm -f excanvas.js ; \
 	rm -f jquery.flot.navigate.js ; \
+	rm -f jquery.flot.resize.js ; \
 	rm -f .travis.yml ; \
 	rm -f .gitignore ; \
 	rm -rf examples/shared ; \

-- 
flot



More information about the Pkg-javascript-commits mailing list