Permalink
Browse files

OSQA-815: Minify all resources

* I found that osqa.main.min.js hadn't been updated, so fixed the
  minification process and added a new script
* Update yuicompressor to 2.4.7
* Rename viewbox js naming so it's consistent
* Add new compression scripts
  • Loading branch information...
1 parent 3c99bdd commit 0d7d835285b94e16ce2cf25c44f28d3ef1e9e24d Danny Thomas committed with Feb 28, 2012
Showing with 105 additions and 68 deletions.
  1. +5 −0 forum/skins/default/media/compress.bat
  2. +16 −0 forum/skins/default/media/compress.sh
  3. +1 −0 forum/skins/default/media/js/ZeroClipboard.min.js
  4. +0 −1 forum/skins/default/media/js/compress.bat
  5. +1 −0 forum/skins/default/media/js/fixurl.min.js
  6. +1 −32 forum/skins/default/media/js/jquery-1.2.6.min.js
  7. +23 −4 forum/skins/default/media/js/jquery-1.7.1.min.js
  8. +25 −7 forum/skins/default/media/js/jquery-ui-1.8.18.min.js
  9. +1 −0 forum/skins/default/media/js/jquery.ajaxfileupload.min.js
  10. +1 −0 forum/skins/default/media/js/jquery.caret.min.js
  11. +1 −1 forum/skins/default/media/js/jquery.flot.min.js
  12. +1 −0 forum/skins/default/media/js/jquery.form.min.js
  13. +1 −0 forum/skins/default/media/js/jquery.i18n.min.js
  14. +1 −0 forum/skins/default/media/js/jquery.openid.min.js
  15. +1 −0 forum/skins/default/media/js/jquery.validate.pack.min.js
  16. +1 −0 forum/skins/default/media/js/osqa.admin.min.js
  17. +1 −0 forum/skins/default/media/js/osqa.ask.min.js
  18. +1 −1 forum/skins/default/media/js/osqa.main.min.js
  19. +1 −0 forum/skins/default/media/js/osqa.question.min.js
  20. +1 −0 forum/skins/default/media/js/pagedown/Markdown.Converter.min.js
  21. +1 −0 forum/skins/default/media/js/pagedown/Markdown.Editor.min.js
  22. +1 −0 forum/skins/default/media/js/se_hilite.min.js
  23. +1 −0 forum/skins/default/media/js/se_hilite_src.min.js
  24. +0 −9 forum/skins/default/media/js/ui.core.min.js
  25. +0 −12 forum/skins/default/media/js/ui.datepicker.min.js
  26. +1 −0 forum/skins/default/media/js/viewbox.min.css
  27. 0 forum/skins/default/media/js/{viewbox_min.js → viewbox.min.js}
  28. +1 −0 forum/skins/default/media/js/wmd/showdown.min.js
  29. +1 −0 forum/skins/default/media/js/wmd/wmd.min.css
  30. +1 −0 forum/skins/default/media/js/wmd/wmd.min.js
  31. +1 −0 forum/skins/default/media/js/youtube.min.js
  32. +1 −0 forum/skins/default/media/style/admin.min.css
  33. +1 −0 forum/skins/default/media/style/auth.min.css
  34. +1 −0 forum/skins/default/media/style/default.min.css
  35. +1 −0 forum/skins/default/media/style/demo-docs-theme.min.css
  36. +1 −0 forum/skins/default/media/style/djstyle_admin.min.css
  37. +1 −0 forum/skins/default/media/style/jquery-ui-1.8.18.min.css
  38. +1 −0 forum/skins/default/media/style/jquery.autocomplete.min.css
  39. +1 −0 forum/skins/default/media/style/markdown_help.min.css
  40. +1 −0 forum/skins/default/media/style/openid.min.css
  41. +1 −0 forum/skins/default/media/style/prettify.min.css
  42. +1 −0 forum/skins/default/media/style/style.min.css
  43. +1 −0 forum/skins/default/media/style/user.min.css
  44. BIN forum/skins/default/media/{js/yuicompressor-2.4.2.jar → yuicompressor-2.4.7.jar}
  45. +1 −1 forum/skins/default/templates/question.html
@@ -0,0 +1,5 @@
+@echo off
+echo This batch file does nothing. Wildcards seem to be broken, at least they don't work per the examples provided
+echo Use cygwin and compress.sh instead
+rem java -jar yuicompressor-2.4.7.jar -o '.css$:-min.css' style\*.css
+rem java -jar yuicompressor-2.4.7.jar -o '.js$:-min.js' js\*.js
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Compress all js and style files, replacing existing minified versions
+
+for i in `find js/ style/ -type f -name '*.css' -or -name '*.js' -not -name '*.min.css' -not -name '*.min.js'`
+do
+ # From http://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash
+ filename="${i##*/}" # Strip longest match of */ from start
+ dir="${i:0:${#i} - ${#filename}}" # Substring from 0 thru pos of filename
+ base="${i%.[^.]*}" # Strip shortest match of . plus at least one non-dot char from end
+ ext="${i:${#base} + 1}" # Substring from len of base thru end
+
+ filename=${base}.min.${ext}
+ echo "Compressing $i to $filename"
+ java -jar yuicompressor-2.4.7.jar -o $filename $i
+done
Oops, something went wrong.
@@ -1 +0,0 @@
-java -jar yuicompressor-2.4.2.jar --type js --charset utf-8 osqa.main.js -o osqa.main.min.js
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 0d7d835

Please sign in to comment.