Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djpowell/1738454 to your computer and use it in GitHub Desktop.
Save djpowell/1738454 to your computer and use it in GitHub Desktop.
Patch to get clojurescript one to work on android, by forcing the load of xpath.js implementation
From e6ec5aee30209240798663ca110bd2fa8cbe48a2 Mon Sep 17 00:00:00 2001
From: David Powell <djpowell@djpowell.net>
Date: Sat, 4 Feb 2012 15:19:11 +0000
Subject: [PATCH] Android claims to support XPath, but doesn't. Force
non-native xpath for platforms that clearly don't have it.
As a side-effect, include xpath.js for everyone.
---
templates/application.html | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/templates/application.html b/templates/application.html
index 30e744f..cddad9a 100644
--- a/templates/application.html
+++ b/templates/application.html
@@ -28,10 +28,18 @@
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
- <!-- Add xpath support to IE. Domina needs this -->
- <!--[if IE]>
- <script type="text/javascript" src="js/xpath.js"></script>
- <![endif]-->
+ <!-- Add xpath support for IE and Android 2.x. Domina needs this -->
+ <script type="text/javascript">
+ if (!document.evaluate && !document.selectNodes) {
+ window.jsxpath = {
+ targetFrame: undefined,
+ exportInstaller: false,
+ useNative: false, /* force non-native implementation */
+ useInnerText: true
+ };
+ }
+ </script>
+ <script type="text/javascript" src="js/xpath.js"></script>
</head>
--
1.7.7.msysgit.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment