Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Commit

Permalink
closes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuellr committed Oct 12, 2011
1 parent 0c13336 commit 048ebd6
Show file tree
Hide file tree
Showing 21 changed files with 557 additions and 301 deletions.
30 changes: 15 additions & 15 deletions weinre.build/scripts/build-target-scripts.py
Expand Up @@ -3,7 +3,7 @@
# ---
# weinre is available under *either* the terms of the modified BSD license *or* the
# MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
#
#
# Copyright (c) 2010, 2011 IBM Corporation
# ---

Expand All @@ -15,47 +15,47 @@

#--------------------------------------------------------------------
def main():

#----------------------------------------------------------------
if len(sys.argv) < 4:
error("expecting parameters piecesHtmlFile srcDir outputDir")

iFileName = sys.argv[1]
srcDirName = sys.argv[2]
oDirName = sys.argv[3]

if not os.path.exists(iFileName): error("input file not found: '" + iFileName + "'")
if not os.path.exists(srcDirName): error("source directory not found: '" + srcDirName + "'")
if not os.path.isdir(srcDirName): error("source directory not a directory: '" + srcDirName + "'")
if not os.path.exists(oDirName): error("output directory not found: '" + oDirName + "'")
if not os.path.isdir(oDirName): error("output directory not a directory: '" + oDirName + "'")

#----------------------------------------------------------------
with open(iFileName, "r") as iFile:
lines = iFile.readlines()

#----------------------------------------------------------------
scripts = []
scriptNames = {}
scriptSrc = {}
scriptMin = {}
scriptSrcPattern = re.compile(r'.*?<script\s+src\s*=\s*"/(.*?)"\s*>\s*</script>.*')

for line in lines:
match = scriptSrcPattern.match(line)
if not match: continue

baseScriptFile = match.group(1)
scriptFile = os.path.join(srcDirName, baseScriptFile)
if scriptFile == "weinre-demo.js": continue
if not os.path.exists(scriptFile): error("script file not found: '" + scriptFile + "'")

scripts.append(scriptFile)
scriptNames[scriptFile] = baseScriptFile

with open(scriptFile, "r") as iFile:
scriptSrc[scriptFile] = iFile.read()

scriptMin[scriptFile] = min(scriptSrc[scriptFile])

# log("read: %s" % scriptFile)
Expand All @@ -73,7 +73,7 @@ def writeMergedFile(oFileName, scripts, scriptNames, srcs):

lines = []
lines.append(";(function(){")

for script in scripts:
lines.append("//==================================================")
lines.append("// file: " + scriptNames[script])
Expand All @@ -82,13 +82,13 @@ def writeMergedFile(oFileName, scripts, scriptNames, srcs):
lines.append(";")
lines.append("")

lines.append("require('weinre/target/Target').getClass().main()")
lines.append("require('weinre/target/Target').main()")
lines.append("})();")
targetScript = "\n".join(lines)

with open(oFileName, "w") as oFile:
oFile.write(targetScript)

log("generated: %s" % oFileName)

#--------------------------------------------------------------------
Expand All @@ -102,7 +102,7 @@ def min(script):
script = patternCommentCPP.sub( "", script)
script = patternIndent.sub( "", script)
script = patternBlankLine.sub( "", script)

return script

#--------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions weinre.web/client/weinre/check-for-webkit.js
@@ -1,10 +1,10 @@
/*
* weinre is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
*
*
* Copyright (c) 2010, 2011 IBM Corporation
*/

if (!navigator.userAgent.match(/webkit/i)) {
alert("This web page is only designed to work in WebKit-based browsers. Sorry. Best of luck.")
alert("This web page is only designed to work in WebKit-based browsers. Sorry. Best of luck.")
}
24 changes: 12 additions & 12 deletions weinre.web/client/weinre/client.css
@@ -1,7 +1,7 @@
/*
* weinre is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
*
*
* Copyright (c) 2010, 2011 IBM Corporation
*/

Expand All @@ -20,46 +20,46 @@
}

.panel.resources .cookie-storage-tree-item {
display: none;
display: none;
}

.panel.resources .frame-storage-tree-item {
display: none;
display: none;
}

.panel.resources .application-cache-storage-tree-item {
display: none;
display: none;
}

.panel.timeline .resources-size-graph-sidebar-item {
display: none;
display: none;
}

#main-status-bar .timeline-category-rendering {
display: none;
display: none;
}

#search {
display: none;
display: none;
}

#search-toolbar-label {
display: none;
display: none;
}

.weinre-connector-item {
font-size: 140%;
}

.weinre-connector-item.target {
text-decoration: underline;
text-decoration: underline;
color: blue;
}

.weinre-connector-item.target.connected {
color: #0D0;
}

.weinre-connector-item.closed {
color: #B00;
}
Expand Down
15 changes: 11 additions & 4 deletions weinre.web/demo/weinre-demo-min.html
@@ -1,7 +1,7 @@
<!--
* weinre is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
*
*
* Copyright (c) 2010, 2011 IBM Corporation
-->

Expand All @@ -10,18 +10,25 @@
<meta name="viewport" content="user-scalable=no, width=device-width, height=device-height">
<title>weinre demo</title>
<link rel="stylesheet" href="weinre-demo.css">
<script src="weinre-demo.js"></script>
<script>try {window.WeinreServerId = location.hash.split("#")[1]} catch(e) {window.WeinreServerId = "anonymous"}</script>
<script src="/target/target-script-min.js"></script>
<script src="weinre-demo.js"></script>

<script type="text/javascript">
require("weinre/common/Weinre").getClass().showNotImplemented()
require("weinre/common/Weinre").showNotImplemented()
</script>

</head>

<body onload="onLoad()">
<input id="button-start-stuff" type="button" value="start stuff">

<p>exceptions in callbacks<p>
<input id="button-error-DOM-event" type="button" value="DOM addEventHandler">
<input id="button-error-window-event" type="button" value="window addEventHandler">
<input id="button-error-XHR-event" type="button" value="XHR addEventHandler">
<input id="button-error-setTimeout" type="button" value="setTimeout()">
<input id="button-error-setInterval" type="button" value="setInterval()">

<h1>this is a green h1</h1>
<h1 class="blue">this is a blue h1</h1>
<h1 style="color:red">this is a red h1</h1>
Expand Down
19 changes: 14 additions & 5 deletions weinre.web/demo/weinre-demo-pieces.html
Expand Up @@ -9,7 +9,9 @@
<head>
<meta name="viewport" content="user-scalable=no, width=device-width, height=device-height">
<title>weinre demo</title>

<link rel="stylesheet" href="weinre-demo.css">
<script>window.WeinreServerURL = location.protocol + "//" + location.hostname + ":" + location.port</script>
<script>try {window.WeinreServerId = location.hash.split("#")[1]} catch(e) {window.WeinreServerId = "anonymous"}</script>
<script src="/modjewel-require.js"></script>
<script type="text/javascript">require("modjewel").warnOnRecursiveRequire(true)</script>
<script src="/weinre/common/Ex.transportd.js"></script>
Expand All @@ -21,9 +23,9 @@
<script src="/weinre/common/Binding.transportd.js"></script>
<script src="/weinre/common/Callback.transportd.js"></script>
<script src="/weinre/common/EventListeners.transportd.js"></script>
<script src="/weinre/common/Native.transportd.js"></script>
<script src="/weinre/common/IDGenerator.transportd.js"></script>
<script src="/weinre/common/MethodNamer.transportd.js"></script>
<script src="/weinre/common/HookLib.transportd.js"></script>
<script src="/weinre/target/Console.transportd.js"></script>
<script src="/add-css-properties.js"></script>
<script src="/weinre/target/CheckForProblems.transportd.js"></script>
Expand All @@ -44,20 +46,27 @@
<script src="/weinre/target/Timeline.transportd.js"></script>
<script src="/weinre/target/SqlStepper.transportd.js"></script>
<script src="/weinre/target/WeinreExtraClientCommandsImpl.transportd.js"></script>
<script src="/weinre/target/HookSites.transportd.js"></script>
<script src="/weinre/target/ExceptionalCallbacks.transportd.js"></script>
<script src="/interfaces/all-json-idls-min.js"></script>
<script src="weinre-demo.js"></script>

<script type="text/javascript">
require("weinre/common/Weinre").showNotImplemented()
require('weinre/target/Target').main()
</script>

<link rel="stylesheet" href="weinre-demo.css">
<script src="weinre-demo.js"></script>
</head>

<body onload="onLoad()">
<input id="button-start-stuff" type="button" value="start stuff">

<p>exceptions in callbacks<p>
<input id="button-error-DOM-event" type="button" value="DOM addEventHandler">
<input id="button-error-window-event" type="button" value="window addEventHandler">
<input id="button-error-XHR-event" type="button" value="XHR addEventHandler">
<input id="button-error-setTimeout" type="button" value="setTimeout()">
<input id="button-error-setInterval" type="button" value="setInterval()">

<h1>this is a green h1</h1>
<h1 class="blue">this is a blue h1</h1>
<h1 style="color:red">this is a red h1</h1>
Expand Down
14 changes: 11 additions & 3 deletions weinre.web/demo/weinre-demo.html
@@ -1,7 +1,7 @@
<!--
* weinre is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
*
*
* Copyright (c) 2010, 2011 IBM Corporation
-->

Expand All @@ -10,17 +10,25 @@
<meta name="viewport" content="user-scalable=no, width=device-width, height=device-height">
<title>weinre demo</title>
<link rel="stylesheet" href="weinre-demo.css">
<script src="weinre-demo.js"></script>
<script>try {window.WeinreServerId = location.hash.split("#")[1]} catch(e) {window.WeinreServerId = "anonymous"}</script>
<script src="/target/target-script.js"></script>
<script src="weinre-demo.js"></script>

<script type="text/javascript">
require("weinre/common/Weinre").getClass().showNotImplemented()
require("weinre/common/Weinre").showNotImplemented()
</script>
</head>

<body onload="onLoad()">
<input id="button-start-stuff" type="button" value="start stuff">

<p>exceptions in callbacks<p>
<input id="button-error-DOM-event" type="button" value="DOM addEventHandler">
<input id="button-error-window-event" type="button" value="window addEventHandler">
<input id="button-error-XHR-event" type="button" value="XHR addEventHandler">
<input id="button-error-setTimeout" type="button" value="setTimeout()">
<input id="button-error-setInterval" type="button" value="setInterval()">

<h1>this is a green h1</h1>
<h1 class="blue">this is a blue h1</h1>
<h1 style="color:red">this is a red h1</h1>
Expand Down

0 comments on commit 048ebd6

Please sign in to comment.