[totem] data: Add script to generate a javascript header



commit b9a46707e3f1e705110499e286ca1daa8923339e
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Apr 17 16:48:09 2012 +0100

    data: Add script to generate a javascript header

 data/Makefile.am          |    4 +++-
 data/mime-type-imports.sh |   19 +++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 6dcab81..473647a 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -82,11 +82,13 @@ CLEANFILES += \
 	$(thumbnailer_DATA)
 
 # Content type handling
-nodist_noinst_HEADERS = totem-mime-types.h nautilus-audio-mime-types.h totem-uri-schemes.h
+nodist_noinst_HEADERS = totem-mime-types.h nautilus-audio-mime-types.h totem-uri-schemes.h totem-mime-types.js
 totem-mime-types.h: mime-type-include.sh mime-type-list.txt mime-functions.sh
 	$(AM_V_GEN) $(srcdir)/mime-type-include.sh $(srcdir)/mime-type-list.txt	> $@
 nautilus-audio-mime-types.h: mime-type-include.sh mime-type-list.txt mime-functions.sh
 	$(AM_V_GEN) $(srcdir)/mime-type-include.sh --nautilus $(srcdir)/mime-type-list.txt > $@
+totem-mime-types.js: mime-type-imports.sh mime-type-list.txt mime-functions.sh
+	$(AM_V_GEN) $(srcdir)/mime-type-imports.sh $(srcdir)/mime-type-list.txt	> $@
 totem-uri-schemes.h: mime-type-include.sh mime-type-list.txt mime-functions.sh
 	$(AM_V_GEN) $(srcdir)/uri-scheme-include.sh $(srcdir)/uri-schemes-list.txt > $@
 
diff --git a/data/mime-type-imports.sh b/data/mime-type-imports.sh
new file mode 100755
index 0000000..57d8e40
--- /dev/null
+++ b/data/mime-type-imports.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. `dirname $0`/mime-functions.sh
+
+echo_mime () {
+	echo "    \"$i\","
+}
+
+MIMETYPES=`grep -v '^#' $1 | grep -v x-content/ | grep -v x-scheme-handler/`
+
+echo "/* generated with mime-type-imports.sh in the totem module, don't edit or"
+echo "   commit in the sushi module without filing a bug against totem */"
+
+echo "let videoTypes = ["
+for i in $MIMETYPES ; do
+	echo_mime;
+done
+echo "];"
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]