mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 13:07:02 +00:00
61 lines
2.2 KiB
Plaintext
61 lines
2.2 KiB
Plaintext
<?xml version="1.0" encoding="UTF-8"?>
|
||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||
<plist version="1.0">
|
||
<dict>
|
||
<key>beforeRunningCommand</key>
|
||
<string>saveActiveFile</string>
|
||
<key>command</key>
|
||
<string>
|
||
[[ ! -z $TM_OBJJ_MASTER_FILE ]] && INDEXFILE="$TM_OBJJ_MASTER_FILE"
|
||
|
||
[[ ! -z $TM_PROJECT_DIRECTORY ]] && INDEXFILE="$TM_PROJECT_DIRECTORY/index.html"
|
||
|
||
[[ ! -z $TM_DIRECTORY ]] && INDEXFILE="$TM_DIRECTORY/index.html"
|
||
|
||
if [ -z "$INDEXFILE" ]; then
|
||
D=`dirname "$TM_FILEPATH"`
|
||
while [ -z `find "$D" -name index.html` ]; do
|
||
D=`dirname "$D"`
|
||
done
|
||
INDEXFILE="${D}/index.html"
|
||
fi
|
||
|
||
[[ -z $INDEXFILE ]] && echo "No start file found. Please set the shell variable 'OBJJ_MASTER_FILE'" && exit 206
|
||
|
||
cat <<-HTML
|
||
<script type="text/javascript" charset="utf-8">
|
||
try {
|
||
if (TextMate.system("", function (task) { })) {
|
||
var __TM_confirm_Status;
|
||
alert = function(s){TextMate.system("\"$DIALOG\" -e -p '{messageTitle=\"JavaScript\";informativeText=\""+s.toString().replace(/\x27/g,"’").replace(/\"/g,'\\\"')+"\";}'",null);};
|
||
confirm = function(s){TextMate.system("\"$DIALOG\" -e -p '{messageTitle=\"JavaScript\";informativeText=\""+s.toString().replace(/\x27/g,"’").replace(/\"/g,'\\\"')+"\";buttonTitles=(\"OK\",\"Cancel\");}'",null).onreadoutput=function(s){__TM_confirm_Status = s != 1;};return(__TM_confirm_Status)};
|
||
}
|
||
} catch(e) {}
|
||
</script>
|
||
<base href="file://${INDEXFILE// /%20}">
|
||
HTML
|
||
cat "$INDEXFILE"
|
||
[[ ! -z $(grep 'objj_exception_setOutputStream' "$INDEXFILE") ]] && exit 205
|
||
cat <<-JS
|
||
<script type="text/javascript" charset="utf-8">
|
||
objj_exception_setOutputStream(function(aString) { console.log(aString);alert(aString) });
|
||
</script>
|
||
JS
|
||
|
||
exit 205
|
||
</string>
|
||
<key>input</key>
|
||
<string>none</string>
|
||
<key>keyEquivalent</key>
|
||
<string>@r</string>
|
||
<key>name</key>
|
||
<string>Run</string>
|
||
<key>output</key>
|
||
<string>showAsTooltip</string>
|
||
<key>scope</key>
|
||
<string>source.js.objj</string>
|
||
<key>uuid</key>
|
||
<string>0C55A19B-3B2D-418F-B7FD-7E64B736F379</string>
|
||
</dict>
|
||
</plist>
|