aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/assets/js')
-rw-r--r--app/src/main/assets/js/click_a.js (renamed from app/src/main/assets/js/menu_click.js)12
-rw-r--r--app/src/main/assets/js/click_a.min.js11
-rw-r--r--app/src/main/assets/js/click_interceptor.js19
-rw-r--r--app/src/main/assets/js/click_interceptor_bak.js14
-rw-r--r--app/src/main/assets/js/menu_click.min.js9
5 files changed, 23 insertions, 42 deletions
diff --git a/app/src/main/assets/js/menu_click.js b/app/src/main/assets/js/click_a.js
index 403689eb..d3eb8631 100644
--- a/app/src/main/assets/js/menu_click.js
+++ b/app/src/main/assets/js/click_a.js
@@ -1,15 +1,17 @@
// we will handle click events
-console.log('Registering menu click');
-document.addEventListener('click', function _menuClick(e) {
+console.log('Registering frost_a click');
+
+var _frostAClick = function(e) {
var element = e.target || e.srcElement;
if (element.tagName !== 'A')
element = element.parentNode;
if (element.tagName === 'A' && element.getAttribute('href') !== '#') {
var url = element.getAttribute('href');
- console.log('Click Intercept');
- console.log(url);
+ console.log('Click Intercept', url);
Frost.loadUrl(url);
e.stopPropagation();
e.preventDefault();
}
-}, true);
+}
+
+document.addEventListener('click', _frostAClick, true);
diff --git a/app/src/main/assets/js/click_a.min.js b/app/src/main/assets/js/click_a.min.js
new file mode 100644
index 00000000..ff4a3d4c
--- /dev/null
+++ b/app/src/main/assets/js/click_a.min.js
@@ -0,0 +1,11 @@
+console.log("Registering frost_a click")
+
+;var _frostAClick=function(t){
+var e=t.target||t.srcElement
+;if("A"!==e.tagName&&(e=e.parentNode),"A"===e.tagName&&"#"!==e.getAttribute("href")){
+var r=e.getAttribute("href")
+;console.log("Click Intercept",r),Frost.loadUrl(r),t.stopPropagation(),
+t.preventDefault()
+}
+}
+;document.addEventListener("click",_frostAClick,!0); \ No newline at end of file
diff --git a/app/src/main/assets/js/click_interceptor.js b/app/src/main/assets/js/click_interceptor.js
index 238b31d3..ce55f669 100644
--- a/app/src/main/assets/js/click_interceptor.js
+++ b/app/src/main/assets/js/click_interceptor.js
@@ -1,15 +1,6 @@
-// generic click handler
-document.on('click', function (e) {
- e = e || window.event;
- e.preventDefault();
+// we will handle click events
+console.log('Registering click interceptor');
+document.addEventListener('click', function _menuClick(e) {
var element = e.target || e.srcElement;
- if (element.tagName !== 'A')
- element = element.parentNode;
- if (element.tagName === 'A') {
- var url = element.href;
- console.log('Generic Click Intercept');
- console.log(url);
- // Frost.loadUrl(url);
- }
- return false;
-});
+ console.log(element.tagName);
+}, true);
diff --git a/app/src/main/assets/js/click_interceptor_bak.js b/app/src/main/assets/js/click_interceptor_bak.js
deleted file mode 100644
index d541ccd2..00000000
--- a/app/src/main/assets/js/click_interceptor_bak.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// generic click handler
-document.onclick = function(e) {
- e = e || window.event;
- var element = e.target || e.srcElement;
- if (element.tagName !== 'A')
- element = element.parentNode;
- if (element.tagName === 'A') {
- var url = element.href;
- console.log('Generic Click Intercept');
- console.log(url);
- // Frost.loadUrl(url);
- }
- return false;
-};
diff --git a/app/src/main/assets/js/menu_click.min.js b/app/src/main/assets/js/menu_click.min.js
deleted file mode 100644
index 60671265..00000000
--- a/app/src/main/assets/js/menu_click.min.js
+++ /dev/null
@@ -1,9 +0,0 @@
-console.log("Registering menu click"),document.addEventListener("click",function(e){
-var t=e.target||e.srcElement
-;if("A"!==t.tagName&&(t=t.parentNode),"A"===t.tagName&&"#"!==t.getAttribute("href")){
-var o=t.getAttribute("href")
-;console.log("Click Intercept"),console.log(o),Frost.loadUrl(o),
-e.stopPropagation(),
-e.preventDefault()
-}
-},!0); \ No newline at end of file