Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
check for bad versions of Prototype.js; closes #35
  • Loading branch information
pmuellr committed Mar 15, 2011
1 parent 550b801 commit 0df8719d13b2a18c1ad6c8dbf364cd81dfe8cb5d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
@@ -14,7 +14,6 @@

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

<script src="weinre-demo.js"></script>
@@ -26,6 +26,7 @@
<script src="/weinre/common/IDGenerator.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>
<script src="/weinre/target/WiConsoleImpl.transportd.js"></script>
<script src="/weinre/target/WiCSSImpl.transportd.js"></script>
<script src="/weinre/target/WiDatabaseImpl.transportd.js"></script>
@@ -45,7 +46,6 @@

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

<script src="weinre-demo.js"></script>
@@ -14,7 +14,6 @@

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

<script src="weinre-demo.js"></script>
@@ -0,0 +1,28 @@

/*
* 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
*/

//-----------------------------------------------------------------------------
class CheckForProblems

//-----------------------------------------------------------------------------
static method check
checkForOldPrototypeVersion()

//-----------------------------------------------------------------------------
function checkForOldPrototypeVersion
var badVersion = false

if (typeof Prototype == "undefined") return
if (!Prototype.Version) return

if (Prototype.Version.match(/^1\.5.*/)) badVersion = true
if (Prototype.Version.match(/^1\.6.*/)) badVersion = true

if (badVersion) {
alert("Sorry, weinre is not support in versions of Prototype earlier than 1.7")
}
@@ -14,6 +14,7 @@ requireClass ../common/Callback
requireClass ../common/MessageDispatcher
requireClass ../common/Weinre

requireClass ./CheckForProblems
requireClass ./NodeStore
requireClass ./CSSStore
requireClass ./ElementHighlighter
@@ -34,6 +35,8 @@ class Target

//-----------------------------------------------------------------------------
static method main
CheckForProblems.check()

Weinre.target = new Target()
Weinre.target.initialize()

0 comments on commit 0df8719

Please sign in to comment.