diff options
author | Allan Wang <me@allanwang.ca> | 2019-02-05 23:16:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-05 23:16:29 -0500 |
commit | 8e3bfc168009c8682c4f6191d655f3ca10ae9f21 (patch) | |
tree | cf8419a06e193c08622ead5e6854b995a5eeba77 /app/src/main/assets/js | |
parent | 83fb36f666fbb934b74b5f763b8ffb2e56ca7761 (diff) | |
parent | ddfc310fde5f50ba52ef930287449c2e08faaca8 (diff) | |
download | frost-8e3bfc168009c8682c4f6191d655f3ca10ae9f21.tar.gz frost-8e3bfc168009c8682c4f6191d655f3ca10ae9f21.tar.bz2 frost-8e3bfc168009c8682c4f6191d655f3ca10ae9f21.zip |
Merge pull request #1334 from AllanWang/fix/offline-crash
Fix/offline crash
Diffstat (limited to 'app/src/main/assets/js')
22 files changed, 0 insertions, 808 deletions
diff --git a/app/src/main/assets/js/click_a.coffee b/app/src/main/assets/js/click_a.coffee deleted file mode 100644 index e032b4ad..00000000 --- a/app/src/main/assets/js/click_a.coffee +++ /dev/null @@ -1,48 +0,0 @@ -prevented = false - -_frostAClick = (e) -> - - ### - # Commonality; check for valid target - ### - element = e.target or 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" - if !prevented - url = element.getAttribute("href") - console.log "Click Intercept #{url}" - # if frost is injected, check if loading the url through an overlay works - if Frost?.loadUrl(url) == true - e.stopPropagation() - e.preventDefault() - else - console.log "Click Intercept Prevented" - return - -### -# On top of the click event, we must stop it for long presses -# Since that will conflict with the context menu -# Note that we only override it on conditions where the context menu -# Will occur -### - -_frostPreventClick = -> - console.log "Click prevented" - prevented = true - return - -document.addEventListener "click", _frostAClick, true -clickTimeout = undefined -document.addEventListener "touchstart", ((e) -> - clickTimeout = setTimeout(_frostPreventClick, 400) - return -), true -document.addEventListener "touchend", ((e) -> - prevented = false - clearTimeout clickTimeout - return -), true diff --git a/app/src/main/assets/js/click_a.js b/app/src/main/assets/js/click_a.js deleted file mode 100644 index e3ea7f31..00000000 --- a/app/src/main/assets/js/click_a.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; - -(function () { - - /* - * On top of the click event, we must stop it for long presses - * Since that will conflict with the context menu - * Note that we only override it on conditions where the context menu - * Will occur - */ - var _frostAClick, _frostPreventClick, clickTimeout, prevented; - - prevented = false; - - _frostAClick = function _frostAClick(e) { - /* - * Commonality; check for valid target - */ - var element, url; - 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") { - if (!prevented) { - url = element.getAttribute("href"); - console.log("Click Intercept " + url); - // if frost is injected, check if loading the url through an overlay works - if ((typeof Frost !== "undefined" && Frost !== null ? Frost.loadUrl(url) : void 0) === true) { - e.stopPropagation(); - e.preventDefault(); - } - } else { - console.log("Click Intercept Prevented"); - } - } - }; - - _frostPreventClick = function _frostPreventClick() { - console.log("Click prevented"); - prevented = true; - }; - - document.addEventListener("click", _frostAClick, true); - - clickTimeout = void 0; - - document.addEventListener("touchstart", function (e) { - clickTimeout = setTimeout(_frostPreventClick, 400); - }, true); - - document.addEventListener("touchend", function (e) { - prevented = false; - clearTimeout(clickTimeout); - }, true); -}).call(undefined);
\ No newline at end of file diff --git a/app/src/main/assets/js/click_debugger.coffee b/app/src/main/assets/js/click_debugger.coffee deleted file mode 100644 index 057bb207..00000000 --- a/app/src/main/assets/js/click_debugger.coffee +++ /dev/null @@ -1,14 +0,0 @@ -# for desktop only - -_frostAContext = (e) -> - - ### - # Commonality; check for valid target - ### - element = e.target or e.currentTarget or e.srcElement - if !element - return - console.log "Clicked element: #{element.tagName} #{element.className}" - return - -document.addEventListener 'contextmenu', _frostAContext, true diff --git a/app/src/main/assets/js/click_debugger.js b/app/src/main/assets/js/click_debugger.js deleted file mode 100644 index 71db586a..00000000 --- a/app/src/main/assets/js/click_debugger.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -(function () { - // for desktop only - var _frostAContext; - - _frostAContext = function _frostAContext(e) { - /* - * Commonality; check for valid target - */ - var element; - element = e.target || e.currentTarget || e.srcElement; - if (!element) { - return; - } - console.log('Clicked element: ' + element.tagName + ' ' + element.className); - }; - - document.addEventListener('contextmenu', _frostAContext, true); -}).call(undefined);
\ No newline at end of file diff --git a/app/src/main/assets/js/context_a.coffee b/app/src/main/assets/js/context_a.coffee deleted file mode 100644 index 0dca1b7f..00000000 --- a/app/src/main/assets/js/context_a.coffee +++ /dev/null @@ -1,59 +0,0 @@ -# context menu for links -# largely mimics click_a.js -# we will also bind a listener here to notify the activity not to deal with viewpager scrolls -longClick = false - -_frostAContext = (e) -> - Frost?.longClick true - longClick = true - - ### - # Commonality; check for valid target - ### - - element = e.target or e.currentTarget or e.srcElement - if !element - return - if element.tagName != "A" - element = element.parentNode - #Notifications is two layers under - if element.tagName != "A" - element = element.parentNode - if element.tagName == "A" and element.getAttribute("href") != "#" - url = element.getAttribute("href") - if !url - return - text = element.parentNode.innerText - # check if image item exists, first in children and then in parent - image = element.querySelector("[style*=\"background-image: url(\"]") - if !image - image = element.parentNode.querySelector("[style*=\"background-image: url(\"]") - if image - imageUrl = window.getComputedStyle(image, null).backgroundImage.trim().slice(4, -1) - console.log "Context image: #{imageUrl}" - Frost?.loadImage imageUrl, text - e.stopPropagation() - e.preventDefault() - return - # check if true img exists - img = element.querySelector("img[src*=scontent]") - if img - imgUrl = img.src - console.log "Context img #{imgUrl}" - Frost?.loadImage imgUrl, text - e.stopPropagation() - e.preventDefault() - return - console.log "Context Content #{url} #{text}" - Frost?.contextMenu url, text - e.stopPropagation() - e.preventDefault() - return - -document.addEventListener "contextmenu", _frostAContext, true -document.addEventListener "touchend", ((e) -> - if longClick - Frost?.longClick false - longClick = false - return -), true diff --git a/app/src/main/assets/js/context_a.js b/app/src/main/assets/js/context_a.js deleted file mode 100644 index b39a6542..00000000 --- a/app/src/main/assets/js/context_a.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; - -(function () { - // context menu for links - // largely mimics click_a.js - // we will also bind a listener here to notify the activity not to deal with viewpager scrolls - var _frostAContext, longClick; - - longClick = false; - - _frostAContext = function _frostAContext(e) { - /* - * Commonality; check for valid target - */ - var element, image, imageUrl, img, imgUrl, text, url; - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.longClick(true); - } - longClick = true; - element = e.target || e.currentTarget || e.srcElement; - if (!element) { - return; - } - 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") !== "#") { - url = element.getAttribute("href"); - if (!url) { - return; - } - text = element.parentNode.innerText; - // check if image item exists, first in children and then in parent - image = element.querySelector("[style*=\"background-image: url(\"]"); - if (!image) { - image = element.parentNode.querySelector("[style*=\"background-image: url(\"]"); - } - if (image) { - imageUrl = window.getComputedStyle(image, null).backgroundImage.trim().slice(4, -1); - console.log("Context image: " + imageUrl); - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.loadImage(imageUrl, text); - } - e.stopPropagation(); - e.preventDefault(); - return; - } - // check if true img exists - img = element.querySelector("img[src*=scontent]"); - if (img) { - imgUrl = img.src; - console.log("Context img " + imgUrl); - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.loadImage(imgUrl, text); - } - e.stopPropagation(); - e.preventDefault(); - return; - } - console.log("Context Content " + url + " " + text); - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.contextMenu(url, text); - } - e.stopPropagation(); - e.preventDefault(); - } - }; - - document.addEventListener("contextmenu", _frostAContext, true); - - document.addEventListener("touchend", function (e) { - if (longClick) { - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.longClick(false); - } - longClick = false; - } - }, true); -}).call(undefined);
\ No newline at end of file diff --git a/app/src/main/assets/js/document_watcher.coffee b/app/src/main/assets/js/document_watcher.coffee deleted file mode 100644 index 11cf7d53..00000000 --- a/app/src/main/assets/js/document_watcher.coffee +++ /dev/null @@ -1,24 +0,0 @@ -# emit key once half the viewport is covered - -isReady = -> - if not (document?.body?) - return false - return document.body.scrollHeight > innerHeight + 100 - -if isReady() - console.log("Already ready") - Frost?.isReady() - return - -console.log("Injected document watcher") - -observer = new MutationObserver(() -> - if isReady() - observer.disconnect() - Frost?.isReady() - console.log("Documented surpassed height in #{performance.now()}") -) - -observer.observe document, - childList: true - subtree: true
\ No newline at end of file diff --git a/app/src/main/assets/js/document_watcher.js b/app/src/main/assets/js/document_watcher.js deleted file mode 100644 index 4613dc87..00000000 --- a/app/src/main/assets/js/document_watcher.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; - -(function () { - // emit key once half the viewport is covered - var isReady, observer; - - isReady = function isReady() { - if (!((typeof document !== "undefined" && document !== null ? document.body : void 0) != null)) { - return false; - } - return document.body.scrollHeight > innerHeight + 100; - }; - - if (isReady()) { - console.log("Already ready"); - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.isReady(); - } - return; - } - - console.log("Injected document watcher"); - - observer = new MutationObserver(function () { - if (isReady()) { - observer.disconnect(); - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.isReady(); - } - return console.log("Documented surpassed height in " + performance.now()); - } - }); - - observer.observe(document, { - childList: true, - subtree: true - }); -}).call(undefined);
\ No newline at end of file diff --git a/app/src/main/assets/js/header_badges.coffee b/app/src/main/assets/js/header_badges.coffee deleted file mode 100644 index e9702751..00000000 --- a/app/src/main/assets/js/header_badges.coffee +++ /dev/null @@ -1,4 +0,0 @@ -# bases the header contents if it exists -header = document.getElementById("mJewelNav") -if header != null - Frost?.handleHeader header.outerHTML diff --git a/app/src/main/assets/js/header_badges.js b/app/src/main/assets/js/header_badges.js deleted file mode 100644 index 13447229..00000000 --- a/app/src/main/assets/js/header_badges.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -(function () { - // bases the header contents if it exists - var header; - - header = document.getElementById("mJewelNav"); - - if (header !== null) { - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.handleHeader(header.outerHTML); - } - } -}).call(undefined);
\ No newline at end of file diff --git a/app/src/main/assets/js/header_hider.coffee b/app/src/main/assets/js/header_hider.coffee deleted file mode 100644 index 40510c79..00000000 --- a/app/src/main/assets/js/header_hider.coffee +++ /dev/null @@ -1,11 +0,0 @@ -header = document.querySelector('#header') - -if !header - return - -jewel = header.querySelector('#mJewelNav') - -if !jewel - return - -header.style.display = 'none'
\ No newline at end of file diff --git a/app/src/main/assets/js/header_hider.js b/app/src/main/assets/js/header_hider.js deleted file mode 100644 index f29887ee..00000000 --- a/app/src/main/assets/js/header_hider.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -(function () { - var header, jewel; - - header = document.querySelector('#header'); - - if (!header) { - return; - } - - jewel = header.querySelector('#mJewelNav'); - - if (!jewel) { - return; - } - - header.style.display = 'none'; -}).call(undefined);
\ No newline at end of file diff --git a/app/src/main/assets/js/media.coffee b/app/src/main/assets/js/media.coffee deleted file mode 100644 index a15a5279..00000000 --- a/app/src/main/assets/js/media.coffee +++ /dev/null @@ -1,30 +0,0 @@ -# we will handle media events -_frostMediaClick = (e) -> - - element = e.target or e.srcElement - if !element?.dataset.sigil?.toLowerCase().includes("inlinevideo") - return - - i = 0 - while !element.hasAttribute("data-store") - if ++i > 2 - return - element = element.parentNode - - try - dataStore = JSON.parse(element.dataset.store) - catch e - return - - url = dataStore.src - - if !url || !url.startsWith("http") - return - - console.log "Inline video #{url}" - if Frost?.loadVideo url, dataStore.animatedGifVideo - e.stopPropagation() - e.preventDefault() - return - -document.addEventListener "click", _frostMediaClick, true
\ No newline at end of file diff --git a/app/src/main/assets/js/media.js b/app/src/main/assets/js/media.js deleted file mode 100644 index 5b1a3776..00000000 --- a/app/src/main/assets/js/media.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; - -(function () { - // we will handle media events - var _frostMediaClick; - - _frostMediaClick = function _frostMediaClick(e) { - var dataStore, element, i, ref, url; - element = e.target || e.srcElement; - if (!(element != null ? (ref = element.dataset.sigil) != null ? ref.toLowerCase().includes("inlinevideo") : void 0 : void 0)) { - return; - } - i = 0; - while (!element.hasAttribute("data-store")) { - if (++i > 2) { - return; - } - element = element.parentNode; - } - try { - dataStore = JSON.parse(element.dataset.store); - } catch (error) { - e = error; - return; - } - url = dataStore.src; - if (!url || !url.startsWith("http")) { - return; - } - console.log("Inline video " + url); - if (typeof Frost !== "undefined" && Frost !== null ? Frost.loadVideo(url, dataStore.animatedGifVideo) : void 0) { - e.stopPropagation(); - e.preventDefault(); - } - }; - - document.addEventListener("click", _frostMediaClick, true); -}).call(undefined);
\ No newline at end of file diff --git a/app/src/main/assets/js/menu.coffee b/app/src/main/assets/js/menu.coffee deleted file mode 100644 index 384496f7..00000000 --- a/app/src/main/assets/js/menu.coffee +++ /dev/null @@ -1,42 +0,0 @@ -# click menu and move contents to main view -viewport = document.querySelector("#viewport") -root = document.querySelector("#root") -if !viewport - console.log "Menu.js: viewport is null" -if !root - console.log "Menu.js: root is null" -y = new MutationObserver((mutations) -> - viewport.removeAttribute "style" - root.removeAttribute "style" - return -) -y.observe viewport, attributes: true -y.observe root, attributes: true -x = new MutationObserver(() -> - menu = document.querySelector(".mSideMenu") - if menu != null - x.disconnect() - console.log "Found side menu" - while root.firstChild - root.removeChild root.firstChild - while menu.childNodes.length - console.log "append" - viewport.appendChild menu.childNodes[0] - Frost?.emit 0 - setTimeout (-> - y.disconnect() - console.log "Unhook styler" - return - ), 500 - return -) -jewel = document.querySelector("#mJewelNav") -if !jewel - console.log "Menu.js: jewel is null" -x.observe jewel, - childList: true - subtree: true -menuA = document.querySelector("#bookmarks_jewel").querySelector("a") -if !menuA - console.log "Menu.js: jewel is null" -menuA.click()
\ No newline at end of file diff --git a/app/src/main/assets/js/menu.js b/app/src/main/assets/js/menu.js deleted file mode 100644 index bfdca4a3..00000000 --- a/app/src/main/assets/js/menu.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; - -(function () { - // click menu and move contents to main view - var jewel, menuA, root, viewport, x, y; - - viewport = document.querySelector("#viewport"); - - root = document.querySelector("#root"); - - if (!viewport) { - console.log("Menu.js: viewport is null"); - } - - if (!root) { - console.log("Menu.js: root is null"); - } - - y = new MutationObserver(function (mutations) { - viewport.removeAttribute("style"); - root.removeAttribute("style"); - }); - - y.observe(viewport, { - attributes: true - }); - - y.observe(root, { - attributes: true - }); - - x = new MutationObserver(function () { - var menu; - menu = document.querySelector(".mSideMenu"); - if (menu !== null) { - x.disconnect(); - console.log("Found side menu"); - while (root.firstChild) { - root.removeChild(root.firstChild); - } - while (menu.childNodes.length) { - console.log("append"); - viewport.appendChild(menu.childNodes[0]); - } - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.emit(0); - } - setTimeout(function () { - y.disconnect(); - console.log("Unhook styler"); - }, 500); - } - }); - - jewel = document.querySelector("#mJewelNav"); - - if (!jewel) { - console.log("Menu.js: jewel is null"); - } - - x.observe(jewel, { - childList: true, - subtree: true - }); - - menuA = document.querySelector("#bookmarks_jewel").querySelector("a"); - - if (!menuA) { - console.log("Menu.js: jewel is null"); - } - - menuA.click(); -}).call(undefined);
\ No newline at end of file diff --git a/app/src/main/assets/js/menu_debug.coffee b/app/src/main/assets/js/menu_debug.coffee deleted file mode 100644 index 54b265f4..00000000 --- a/app/src/main/assets/js/menu_debug.coffee +++ /dev/null @@ -1,42 +0,0 @@ -# click menu and move contents to main view -viewport = document.querySelector("#viewport") -root = document.querySelector("#root") -if !viewport - console.log "Menu.js: viewport is null" -if !root - console.log "Menu.js: root is null" -y = new MutationObserver((mutations) -> - viewport.removeAttribute "style" - root.removeAttribute "style" - return -) -y.observe viewport, attributes: true -y.observe root, attributes: true -x = new MutationObserver((mutations) -> - menu = document.querySelector(".mSideMenu") - if menu != null - x.disconnect() - console.log "Found side menu" - while root.firstChild - root.removeChild root.firstChild - while menu.childNodes.length - console.log "append" - viewport.appendChild menu.childNodes[0] - Frost?.handleHtml viewport.outerHTML - setTimeout (-> - y.disconnect() - console.log "Unhook styler" - return - ), 500 - return -) -jewel = document.querySelector("#mJewelNav") -if !jewel - console.log "Menu.js: jewel is null" -x.observe jewel, - childList: true - subtree: true -menuA = document.querySelector("#bookmarks_jewel").querySelector("a") -if !menuA - console.log "Menu.js: jewel is null" -menuA.click() diff --git a/app/src/main/assets/js/menu_debug.js b/app/src/main/assets/js/menu_debug.js deleted file mode 100644 index 7ecbf276..00000000 --- a/app/src/main/assets/js/menu_debug.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; - -(function () { - // click menu and move contents to main view - var jewel, menuA, root, viewport, x, y; - - viewport = document.querySelector("#viewport"); - - root = document.querySelector("#root"); - - if (!viewport) { - console.log("Menu.js: viewport is null"); - } - - if (!root) { - console.log("Menu.js: root is null"); - } - - y = new MutationObserver(function (mutations) { - viewport.removeAttribute("style"); - root.removeAttribute("style"); - }); - - y.observe(viewport, { - attributes: true - }); - - y.observe(root, { - attributes: true - }); - - x = new MutationObserver(function (mutations) { - var menu; - menu = document.querySelector(".mSideMenu"); - if (menu !== null) { - x.disconnect(); - console.log("Found side menu"); - while (root.firstChild) { - root.removeChild(root.firstChild); - } - while (menu.childNodes.length) { - console.log("append"); - viewport.appendChild(menu.childNodes[0]); - } - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.handleHtml(viewport.outerHTML); - } - setTimeout(function () { - y.disconnect(); - console.log("Unhook styler"); - }, 500); - } - }); - - jewel = document.querySelector("#mJewelNav"); - - if (!jewel) { - console.log("Menu.js: jewel is null"); - } - - x.observe(jewel, { - childList: true, - subtree: true - }); - - menuA = document.querySelector("#bookmarks_jewel").querySelector("a"); - - if (!menuA) { - console.log("Menu.js: jewel is null"); - } - - menuA.click(); -}).call(undefined);
\ No newline at end of file diff --git a/app/src/main/assets/js/notif_msg.coffee b/app/src/main/assets/js/notif_msg.coffee deleted file mode 100644 index 1c3f8e38..00000000 --- a/app/src/main/assets/js/notif_msg.coffee +++ /dev/null @@ -1,22 +0,0 @@ -# binds callbacks to an invisible webview to take in the search events -finished = false -x = new MutationObserver((mutations) -> - _f_thread = document.querySelector("#threadlist_rows") - if !_f_thread - return - console.log "Found message threads #{_f_thread.outerHTML}" - Frost?.handleHtml _f_thread.outerHTML - finished = true - x.disconnect() - return -) -x.observe document, - childList: true - subtree: true -setTimeout (-> - if !finished - finished = true - console.log "Message thread timeout cancellation" - Frost?.handleHtml "" - return -), 20000 diff --git a/app/src/main/assets/js/notif_msg.js b/app/src/main/assets/js/notif_msg.js deleted file mode 100644 index 134ad4f0..00000000 --- a/app/src/main/assets/js/notif_msg.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; - -(function () { - // binds callbacks to an invisible webview to take in the search events - var finished, x; - - finished = false; - - x = new MutationObserver(function (mutations) { - var _f_thread; - _f_thread = document.querySelector("#threadlist_rows"); - if (!_f_thread) { - return; - } - console.log("Found message threads " + _f_thread.outerHTML); - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.handleHtml(_f_thread.outerHTML); - } - finished = true; - x.disconnect(); - }); - - x.observe(document, { - childList: true, - subtree: true - }); - - setTimeout(function () { - if (!finished) { - finished = true; - console.log("Message thread timeout cancellation"); - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.handleHtml(""); - } - } - }, 20000); -}).call(undefined);
\ No newline at end of file diff --git a/app/src/main/assets/js/textarea_listener.coffee b/app/src/main/assets/js/textarea_listener.coffee deleted file mode 100644 index 950f663e..00000000 --- a/app/src/main/assets/js/textarea_listener.coffee +++ /dev/null @@ -1,22 +0,0 @@ -# focus listener for textareas -# since swipe to refresh is quite sensitive, we will disable it -# when we detect a user typing -# note that this extends passed having a keyboard opened, -# as a user may still be reviewing his/her post -# swiping should automatically be reset on refresh - -_frostFocus = (e) -> - element = e.target or e.srcElement - console.log "Frost focus", element.tagName - if element.tagName == "TEXTAREA" - Frost?.disableSwipeRefresh true - return - -_frostBlur = (e) -> - element = e.target or e.srcElement - console.log "Frost blur", element.tagName - Frost?.disableSwipeRefresh false - return - -document.addEventListener "focus", _frostFocus, true -document.addEventListener "blur", _frostBlur, true diff --git a/app/src/main/assets/js/textarea_listener.js b/app/src/main/assets/js/textarea_listener.js deleted file mode 100644 index 41d77159..00000000 --- a/app/src/main/assets/js/textarea_listener.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -(function () { - // focus listener for textareas - // since swipe to refresh is quite sensitive, we will disable it - // when we detect a user typing - // note that this extends passed having a keyboard opened, - // as a user may still be reviewing his/her post - // swiping should automatically be reset on refresh - var _frostBlur, _frostFocus; - - _frostFocus = function _frostFocus(e) { - var element; - element = e.target || e.srcElement; - console.log("Frost focus", element.tagName); - if (element.tagName === "TEXTAREA") { - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.disableSwipeRefresh(true); - } - } - }; - - _frostBlur = function _frostBlur(e) { - var element; - element = e.target || e.srcElement; - console.log("Frost blur", element.tagName); - if (typeof Frost !== "undefined" && Frost !== null) { - Frost.disableSwipeRefresh(false); - } - }; - - document.addEventListener("focus", _frostFocus, true); - - document.addEventListener("blur", _frostBlur, true); -}).call(undefined);
\ No newline at end of file |