[Pkg-javascript-commits] [jqueryui] 13/14: Make examples work as much as possible

Paul Mathijs Gevers elbrus at moszumanska.debian.org
Sun Oct 30 18:45:08 UTC 2016


This is an automated email from the git hooks/post-receive script.

elbrus pushed a commit to branch master
in repository jqueryui.

commit d157f216e1150381402624ad1bbadd788b24e87f
Author: Paul Gevers <elbrus at debian.org>
Date:   Sat Oct 29 22:46:20 2016 +0200

    Make examples work as much as possible
---
 debian/control                                    |  1 +
 debian/patches/series                             |  1 +
 debian/patches/use_system_files_in_examples.patch | 78 +++++++++++++++++++++++
 debian/rules                                      | 14 ++++
 4 files changed, 94 insertions(+)

diff --git a/debian/control b/debian/control
index 74066ee..fd9d82c 100644
--- a/debian/control
+++ b/debian/control
@@ -36,6 +36,7 @@ Section: doc
 Architecture: all
 Depends:
  libjs-jquery-ui,
+ node-requirejs,
  ${misc:Depends},
 Description: Documentation for JQuery-UI
  jQuery UI provides abstractions for low-level interaction and
diff --git a/debian/patches/series b/debian/patches/series
index 19d83e2..a1fcccd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 add_missing_semicolon.patch
 match_css_source_to_release.patch
+use_system_files_in_examples.patch
diff --git a/debian/patches/use_system_files_in_examples.patch b/debian/patches/use_system_files_in_examples.patch
new file mode 100644
index 0000000..d9b45a0
--- /dev/null
+++ b/debian/patches/use_system_files_in_examples.patch
@@ -0,0 +1,78 @@
+Description: The upstream examples don't use the Debian installed versions of
+ files and the Debian packaging doesn't work with the provided relative
+ paths. This patch makes the examples use the system-wide files. (Most required
+ changes are done via sed commands in debian/rules).
+Author: Paul Gevers <elbrus at debian.org>
+Forwarded: not-needed
+
+Index: jqueryui/demos/effect/removeClass.html
+===================================================================
+--- jqueryui.orig/demos/effect/removeClass.html
++++ jqueryui/demos/effect/removeClass.html
+@@ -5,8 +5,8 @@
+ 	<meta name="viewport" content="width=device-width, initial-scale=1">
+ 	<title>jQuery UI Effects - removeClass Demo</title>
+ 	<link rel="stylesheet" href="../../themes/base/all.css">
+-	<script src="../../external/jquery/jquery.js"></script>
+-	<script src="../../ui/effect.js"></script>
++	<script src="/usr/share/javascript/jquery/jquery.js"></script>
++	<script src="/usr/share/javascript/jquery-ui/ui/effect.js"></script>
+ 	<link rel="stylesheet" href="../demos.css">
+ 	<style>
+ 	.toggler { width: 500px; height: 200px; position: relative; }
+Index: jqueryui/demos/slider/multiple-vertical.html
+===================================================================
+--- jqueryui.orig/demos/slider/multiple-vertical.html
++++ jqueryui/demos/slider/multiple-vertical.html
+@@ -5,11 +5,11 @@
+ 	<meta name="viewport" content="width=device-width, initial-scale=1">
+ 	<title>jQuery UI Slider - Multiple sliders</title>
+ 	<link rel="stylesheet" href="../../themes/base/all.css">
+-	<script src="../../external/jquery/jquery.js"></script>
+-	<script src="../../ui/core.js"></script>
+-	<script src="../../ui/widget.js"></script>
+-	<script src="../../ui/mouse.js"></script>
+-	<script src="../../ui/slider.js"></script>
++	<script src="/usr/share/javascript/jquery/jquery.js"></script>
++	<script src="/usr/share/javascript/jquery-ui/ui/core.js"></script>
++	<script src="/usr/share/javascript/jquery-ui/ui/widget.js"></script>
++	<script src="/usr/share/javascript/jquery-ui/ui/mouse.js"></script>
++	<script src="/usr/share/javascript/jquery-ui/ui/slider.js"></script>
+ 	<link rel="stylesheet" href="../demos.css">
+ 	<style>
+ 	#eq > span {
+Index: jqueryui/demos/tooltip/custom-style.html
+===================================================================
+--- jqueryui.orig/demos/tooltip/custom-style.html
++++ jqueryui/demos/tooltip/custom-style.html
+@@ -4,7 +4,7 @@
+ 	<meta charset="utf-8">
+ 	<meta name="viewport" content="width=device-width, initial-scale=1">
+ 	<title>jQuery UI Tooltip - Custom Styling</title>
+-	<link rel="stylesheet" href="../../themes/base/tooltip.css">
++	<link rel="stylesheet" href="/usr/share/javascript/jquery-ui/css/base/tooltip.css">
+ 	<link rel="stylesheet" href="../demos.css">
+ 	<script src="../../external/requirejs/require.js"></script>
+ 	<script src="../bootstrap.js">
+Index: jqueryui/demos/bootstrap.js
+===================================================================
+--- jqueryui.orig/demos/bootstrap.js
++++ jqueryui/demos/bootstrap.js
+@@ -78,15 +78,10 @@ function fixPaths( modules ) {
+ document.documentElement.className = "demo-loading";
+ 
+ require.config( {
+-	baseUrl: window.location.pathname.indexOf( "demos/" ) !== -1 ? "../../ui" : "../../../ui",
++	baseUrl: "/usr/share/javascript/jquery-ui/ui",
+ 	paths: {
+-		jquery: "../external/jquery/jquery",
+-		external: "../external/"
++		jquery: "/usr/share/javascript/jquery/jquery",
+ 	},
+-	shim: {
+-		"external/globalize/globalize.culture.de-DE": [ "external/globalize/globalize" ],
+-		"external/globalize/globalize.culture.ja-JP": [ "external/globalize/globalize" ]
+-	}
+ } );
+ 
+ // Replace effects all shortcut modules with all the effects modules
diff --git a/debian/rules b/debian/rules
index d27fb02..da38161 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,11 @@ version = $(shell dpkg-parsechangelog -SVersion | cut -d - -f 1 | sed 's/+dfsg//
 %:
 	dh $@
 
+override_dh_auto_configure:
+	find demos -name "*.html" -exec sed --in-place "s#\.\./\.\./themes/base/all\.css#/usr/share/javascript/jquery-ui/themes/base/jquery-ui.css#" {} \;
+	find demos -name "*.html" -exec sed --in-place "s#\.\./\.\./external/requirejs/require\.js#/usr/lib/nodejs/require.js#" {} \;
+	dh_auto_configure
+
 override_dh_auto_build: jquery-ui.js jquery-ui.min.js themes/base/jquery-ui.css
 	for file in $$(find ui -name '*.js'); do \
 		uglifyjs $$file --output $${file%.js}.min.js --compress; \
@@ -66,3 +71,12 @@ override_dh_auto_test: jquery-ui.js jquery-ui.min.js themes/base/jquery-ui.css
 # http://jqueryui.com
 	diff -Bw debian/reference-jquery-ui.js jquery-ui.js
 	diff -Bw debian/reference-jquery-ui.css themes/base/jquery-ui.css
+
+override_dh_compress:
+# examples/autocomplete/search.php is needed for some examples to work;
+# unfortunately this doesn't help with file browsing
+	dh_compress --exclude=search.php
+
+override_dh_auto_clean:
+	find demos -name "*.html" -exec sed --in-place "s#/usr/share/javascript/jquery-ui/themes/base/jquery-ui\.css#../../themes/base/all.css#" {} \;
+	find demos -name "*.html" -exec sed --in-place "s#/usr/lib/nodejs/require\.js#../../external/requirejs/require.js#" {} \;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/jqueryui.git



More information about the Pkg-javascript-commits mailing list