aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js/context_a.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/assets/js/context_a.js')
-rw-r--r--app/src/main/assets/js/context_a.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/app/src/main/assets/js/context_a.js b/app/src/main/assets/js/context_a.js
new file mode 100644
index 00000000..5e09ffcd
--- /dev/null
+++ b/app/src/main/assets/js/context_a.js
@@ -0,0 +1,31 @@
+//context menu for links
+//largely mimics click_a.js
+if (!window.hasOwnProperty('frost_context_a')) {
+ console.log('frost_context_a frost_click_a');
+ window.frost_context_a = true;
+
+ var _frostAContext = function(e) {
+
+
+ /*
+ * Commonality; check for valid target
+ */
+ var element = e.target || e.srcElement;
+ if (element.tagName !== 'A') element = element.parentNode;
+ //Notifications is two layers under
+ if (element.tagName !== 'A') element = element.parentNode;
+ if (element.tagName === 'A' && element.getAttribute('href') !== '#') {
+ var url = element.getAttribute('href');
+ if (url.includes('photoset_token')) return;
+
+
+
+ console.log('Context Intercept', url);
+ Frost.contextMenu(url);
+ e.stopPropagation();
+ e.preventDefault();
+ }
+ }
+
+ document.addEventListener('contextmenu', _frostAContext, true);
+}