diff options
| author | Gubolin <gubolin@fantasymail.de> | 2015-01-24 10:21:22 +0100 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2015-01-24 10:21:22 +0100 |
| commit | 75b8d44713c57df638dcb95a84b480aeb7414012 (patch) | |
| tree | ca60159361640d84ed0911d3369a6fe560526838 | |
| parent | 39c061f6a6071d6c4dd3ba5de642226590a5ac47 (diff) | |
| parent | e8c854f84aef6d160cfacb4b6a7a5723716cb72e (diff) | |
| download | snap-75b8d44713c57df638dcb95a84b480aeb7414012.tar.gz snap-75b8d44713c57df638dcb95a84b480aeb7414012.zip | |
Merge branch 'mobileapp' into development
| -rwxr-xr-x | binary.sh | 35 | ||||
| -rw-r--r-- | config.xml | 1 |
2 files changed, 23 insertions, 13 deletions
@@ -7,7 +7,7 @@ fi if [[ $# < 2 ]] then - echo "Usage: binary.sh OPTION PLATFORM [FILE]" + echo "Usage: binary.sh OPTION PLATFORM [FILE/URL]" echo "" echo "OPTIONS:" echo " -m Mobile" @@ -15,9 +15,9 @@ then echo "" echo "PLATFORMS:" echo " Mobile amazon-fireos android blackberry10 firefoxos ios ubuntu wp8 win8 tizen" - echo " Desktop win osx linux32 linux64" + echo " Desktop win32 win64 osx linux32 linux64" echo "" - echo "If FILE is given, it will be #open-ed inside Snap\! immediately" + echo "If FILE/URL is given, it will be #open-ed inside Snap\! immediately. URL will be loaded at runtime." exit 0 fi @@ -28,6 +28,7 @@ scriptdir=$(readlink -e ".") # UglifyJS2 (https://github.com/mishoo/UglifyJS2) ide=true +url=false platform=$2 # presentation mode @@ -40,9 +41,9 @@ if [ $ide == false ] then if [ -f "$3" ] then - content=$(cat $3) + content="'$(cat $3)'" else - ide=true + url=true fi fi @@ -57,21 +58,29 @@ if [ $ide == false ] then # minimize everything rm lang* ypr.js paint.js cloud.js gui.js + rm -r help/ sed -i '/paint\.js"/d' snap.html sed -i '/cloud\.js"/d' snap.html sed -i 's/gui\.js"/binary\.js"/' snap.html - # load custom project from file - sed -i '/sha512\.js"/a\ - <script type="text/javascript" src="code.js"></script> ' snap.html + # load custom project from file or url + if [ $url == false ] + then + sed -i '/sha512\.js"/a\ + <script type="text/javascript" src="code.js"></script> ' snap.html + + echo "var code =" > code.js + echo "$content" >> code.js + echo ";" >> code.js - echo "var code =" > code.js - echo "'$content'" >> code.js - echo ";" >> code.js + sed -i "/ide\.openIn/a\ + ide.droppedText(code); " snap.html + else + sed -i "/ide\.openIn/a\ + ide.droppedText(ide.getURL('$3')); " snap.html + fi - sed -i "/ide\.openIn/a\ - ide.droppedText(code); " snap.html else rm binary.js fi @@ -11,5 +11,6 @@ <content src="snap.html" /> <access origin="*" /> <preference name="Fullscreen" value="true" /> + <preference name="Orientation" value="landscape" /> <icon src="www/snap_logo_sm.png" /> </widget> |
