Commit 8c450317 authored by nextime's avatar nextime

Minified and unified css and js

parent 3cd0cc84
This source diff could not be displayed because it is too large. You can view the blob instead.
<?
$GUIDEBUG=TRUE;
$GUIDEBUG=FALSE;
$BASEGUIPATH=str_replace("/index.php","",$_SERVER['PHP_SELF']);
$FSPATH=realpath(dirname(__FILE__)."/..");
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,7 +4,7 @@
var ttsEnabled=<?=$_DOMOTIKA['tts']?>;
var slideEnabled=<?=$_DOMOTIKA['slide']?>;
var speechEnabled='<?=$_DOMOTIKA['webspeech']?>';
var speechEnabled='<?=$_DOMOTIKA["webspeech"]?>';
//var scroller = new AppScroll({
// toolbar: $('#topbar')[0],
......
#!/bin/bash
mydir=`dirname $0`
cd $mydir
# java -jar ../compiler.jar --js $i --js_output_file $i.compressed
YUI="/usr/bin/yui-compressor"
CSS="../../resources/bootstrap/css/bootstrap.min.css
../../resources/glyphicons/css/bootstrap-glyphicons.css
../../resources/full-glyphicons/css/glyphicons.css
../../resources/bootstrap-switch/static/stylesheets/bootstrap-switch.css
css/style.css"
JS="
../../resources/js/jquery-1.10.2.min.js
../../resources/jquery-color/jquery.color.js
../../resources/hammer.js/hammer.js
../../resources/hammer.js/plugins/hammer.fakemultitouch.js
js/starthammer.js
../../resources/hammer.js/plugins/jquery.hammer.js/jquery.hammer.js
../../resources/bootstrap/js/bootstrap.min.js
../../resources/js/respond.min.js
../../resources/bootstrap-switch/static/js/bootstrap-switch.min.js
../../resources/Snap.js/snap.min.js
../../resources/AppScroll.js/AppScroll.min.js
../../resources/EventSource/eventsource.js
../../resources/js/jquery.easing.1.3.min.js
../../resources/js/jquery.alterclass.js
js/fastclick.js
js/speech.js
js/domotika.js
"
echo -n > css/combined.min.css
echo -n > js/combined.min.js
export IFS="
"
for c in $CSS
do
o=`basename $c`
echo compressing $c ...
rm -f /tmp/$o.compressed
if [[ "$c" != *min.css ]] ; then
$YUI --type css -o /tmp/$o.compressed $c >/dev/null 2>&1
else
echo "already minified..."
cp $c /tmp/$o.compressed
fi
cat /tmp/$o.compressed >> css/combined.min.css
done
for j in $JS
do
echo compressing $j
o=`basename $j`
rm -f /tmp/$o.compressed
if [[ "$j" != *min.js ]] ; then
#java -jar ../../../tools/compiler.jar --js $mydir/$j --js_output_file /tmp/$o.compressed >/dev/null 2>&1
$YUI --type js --nomunge -o /tmp/$o.compressed $j >/dev/null 2>&1
if [ -f /tmp/$o.compressed ] ; then
cat /tmp/$o.compressed >> js/combined.min.js
else
echo "cannot use closure, use htmlcompressor..."
#sed -e 's/ \/\/.*$//' $mydir/$j > /tmp/$o.pass1
#java -jar ../../../tools/htmlcompressor-1.5.3.jar --nomunge -o /tmp/$o.compressed /tmp/$o.pass1
cp $mydir/$j /tmp/$o.compressed
cat /tmp/$o.compressed >> js/combined.min.js
fi
else
echo "already minified..."
cat $j >> js/combined.min.js
fi
done
......@@ -23,5 +23,4 @@
<link href="<?=$BASEGUIPATH;?>/css/style.css" rel="stylesheet" media="screen" />
<? } else { ?>
<link href="<?=$BASEGUIPATH;?>/css/combined.min.css" rel="stylesheet" media="screen" />
<link href="<?=$BASEGUIPATH;?>/css/style.css" rel="stylesheet" media="screen" />
<? } ?>
/*! Hammer.JS - v1.0.6 - 2014-01-02
/* Hammer.JS - v1.0.6 - 2014-01-02
* http://eightmedia.github.com/hammer.js
*
* Copyright (c) 2014 Jorik Tangelder <j.tangelder@gmail.com>;
......@@ -1375,4 +1375,4 @@ Hammer.gestures.Transform = {
else {
window.Hammer = Hammer;
}
})(this);
\ No newline at end of file
})(this);
......@@ -6,9 +6,11 @@
*/
Hammer.plugins.fakeMultitouch = function() {
// keeps the start position to keep it centered
var start_pos = false;
// test for msMaxTouchPoints to enable this for IE10 with only one pointer (a mouse in all/most cases)
Hammer.HAS_POINTEREVENTS = navigator.msPointerEnabled &&
navigator.msMaxTouchPoints && navigator.msMaxTouchPoints >= 1;
......@@ -20,6 +22,7 @@
*/
Hammer.event.getTouchList = function(ev, eventType) {
// get the fake pointerEvent touchlist
if(Hammer.HAS_POINTEREVENTS) {
return Hammer.PointerEvent.getTouchList();
}
......@@ -29,14 +32,17 @@
}
// reset on start of a new touch
if(eventType == Hammer.EVENT_START) {
start_pos = false;
}
// when the shift key is pressed, multitouch is possible on desktop
// why shift? because ctrl and alt are taken by osx and linux
if(ev.shiftKey) {
// on touchstart we store the position of the mouse for multitouch
if(!start_pos) {
start_pos = {
pageX: ev.pageX,
......@@ -48,6 +54,7 @@
var distance_y = start_pos.pageY - ev.pageY;
// fake second touch in the opposite direction
return [
{
identifier: 1,
......@@ -64,6 +71,7 @@
];
}
// normal single touch
else {
start_pos = false;
return [
......@@ -78,4 +86,4 @@
};
};
})(window.Hammer);
\ No newline at end of file
})(window.Hammer);
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment