diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f0f7daf --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +.DS_Store +node_modules +build +dist +.svelte-kit +.env +!.env.example +vite.config.js.timestamp-* +vite.config.ts.timestamp-* +pb_data +/pb_data +.vscode +.svelte-kit +*.lockb +*lock.yaml +__pycache__ \ No newline at end of file diff --git a/README.md b/README.md index 956d46e..e0fd841 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,23 @@ +## in10search Tab Manager AI -##in10search +- Horizontal Tabs in Browser Sidepanel with Search +## Ideas for Future Development -####GEAR: Google with Enhanced Auto-loading Results +- Ask ChatGPT About Text Content of All Open Tabs +- readability extract article, cite -####READ: Reading-Mode with Entity Analysis and Definitions +- scroll and highlight the query words on result +- tree tab view and history view +- autogen suggested [Tab Groups](https://developer.chrome.com/docs/extensions/reference/tabGroups/) -####WORD: Wikipedia On-page Research Definition +- auto keywords generator and search query builder related keywords +- backup & close a read-it-later list - -####SWAG: Swipe Webcam Arm Gestures - - - -####CATS: Ctrl+F Across-all Tabs Search - - - -####VAST: Voice Activated Search Trigger - - - -####HITS: Historical Interactive Timeline for Session +- show current url & title when full screen diff --git a/cats/alltabfind-popup.html b/cats/alltabfind-popup.html deleted file mode 100644 index bfec618..0000000 --- a/cats/alltabfind-popup.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - Search Tabs - - - - - -
-
- - \ No newline at end of file diff --git a/cats/alltabfind.js b/cats/alltabfind.js deleted file mode 100644 index 495af47..0000000 --- a/cats/alltabfind.js +++ /dev/null @@ -1,215 +0,0 @@ -//browser action dropdown with chrome.api permissions - -//on popup load -var d = document; -var textStart = "Start typing to find all the words in the content of open tabs."; - -d.addEventListener('DOMContentLoaded', function() { - //fill with pre-existing text - if (!localStorage["searchText"]) - localStorage["searchText"] = ""; - - if (localStorage["searchText"].length > 0) { - d.getElementById("inSearch").value = localStorage["searchText"]; - onSearchType(); - } else { - d.getElementById("tabDisplay").innerHTML = ""; - d.getElementById("tabMessage").innerHTML = textStart; - } - - //focus search box and have it auto process keys - var searchBox = d.getElementById("inSearch"); - - - - searchBox.onkeyup = function() { - - clearTimeout(window.searchBoxThrottle); - - window.searchBoxThrottle = setTimeout(onSearchType, 500); - - }; - - - searchBox.focus(); - searchBox.select(); -}); - -//on typing into search box, query all the open tabs -function onSearchType() { - localStorage["searchText"] = d.getElementById("inSearch").value.trim(); - - if (localStorage["searchText"].length == 0) { - d.getElementById("tabDisplay").innerHTML = ""; - d.getElementById("tabMessage").innerHTML = textStart; - return; - } - - //scrape all tabs html, inject content-level script into each tab that scrapes its html, returns into callback - chrome.windows.getAll({ populate: true }, function(winArray) { - for (var w in winArray) { - chrome.tabs.getAllInWindow(winArray[w].id, - function(tabs) { - for (var i in tabs) { - chrome.tabs.executeScript(tabs[i].id, { - code: "chrome.extension.sendMessage({type: 'getHTML', tabId: " + tabs[i].id + - ", title: document.title, content: document.body.innerHTML});" - }); - } - } - ); - } - - //after tabs processed - setTimeout(function() { - var tabMessage = d.getElementById("tabMessage"); - - //if results found - if (d.getElementById("tabDisplay").innerHTML.length > 0) { - - //TODO all windows? - //shade current tab - chrome.tabs.query({ active: true, currentWindow: true }, function(tabCurrent) { - if (d.getElementById("tab" + tabCurrent[0].id) != null) - d.getElementById("tab" + tabCurrent[0].id).className += " currentTab"; - - }); - - //create a Move all tabs link - var a = d.createElement('a'); - a.setAttribute('href', '#'); - a.innerText = "Move all results to new window"; - tabMessage.innerHTML = ""; - tabMessage.appendChild(a); - - //process Move all tabs click - a.addEventListener("click", function() { - var tabDivs = document.getElementById("tabDisplay").getElementsByClassName("tabDiv"); - var tabIds = []; - - for (var i = 0; i < tabDivs.length; i++) - if (tabDivs[i].hasAttribute("id")) - tabIds.push(parseFloat(tabDivs[i].id.substring(3))); - - chrome.windows.create({ tabId: tabIds[0], focused: true }, function(win) { - chrome.tabs.move(tabIds, { windowId: win.id, index: -1 }); - }); - }); - - - - - } else { //if no results found - if (d.getElementById("inSearch").value.length > 0) - tabMessage.innerHTML = "No results were found."; - else - tabMessage.innerHTML = textStart; - } - }, 300); - }); -} - - -//on tab result click, go to that tab -function onClickTabResult(e) { - var tabID = parseFloat(e.target.id.substring(3)); - var searchText = localStorage["searchText"]; - - chrome.tabs.get(tabID, function(tab) { - chrome.windows.get(tab.windowId, function(win) { - chrome.windows.update(win.id, { focused: true }) - }); - }); - - - chrome.tabs.update(tabID, { active: true }); - - var searchSplit = searchText.trim().split(" "); - - //highlight on page the last word searched for - chrome.tabs.executeScript(tabID, { - code: "window.find('" + searchSplit[searchSplit.length - 1] + "', false, false, true, false, true, false);" - }); -} - - - - -/**** CHROME API ****/ - -//process content text for each tab -chrome.extension.onMessage.addListener(function(request, sender, sendResponse) { - if (request.type == "getHTML") { - var tabId = request.tabId; - var title = request.title; - var tabDisplay = d.getElementById("tabDisplay"); - - //strip HTML of tags - var content = title + " " + request.content - .replace(//gi, '').replace(//gi, '') - .replace(//gi, '').replace(/<(.|\n)+?>/gi, ''); - - - //delete from tab display if already listed - if (d.getElementById("tab" + tabId) != null) { - tabDisplay.removeChild(d.getElementById("tab" + tabId)); - } - - //search to find all words in tab content - var foundAllWords = true; - var searchText = d.getElementById("inSearch").value.trim().toLowerCase(); - var searchSplit = searchText.split(" "); - - for (var i in searchSplit) - if (searchSplit[i].length > 0) - if (content.toLowerCase().indexOf(searchSplit[i]) == -1) - foundAllWords = false; - - //quit if all words not found - if (!foundAllWords) - return; - - - //create title - var tabDiv = d.createElement("div"); - tabDiv.setAttribute("class", "tabDiv"); - tabDiv.setAttribute("id", "tab" + tabId); - tabDiv.addEventListener("click", onClickTabResult); - - if (title.length > 45) - title = title.substr(0, 45) + "…"; - - tabDiv.innerHTML = title; - - //create favIcon - chrome.tabs.get(tabId, function(tab) { - if (tab.favIconUrl.length > 0) { - if (d.getElementById("tab" + tab.id).getElementsByTagName("img").length == 0) { - var img = d.createElement('img'); - img.setAttribute('src', tab.favIconUrl); - img.setAttribute('width', '16px'); - img.setAttribute('height', '16px'); - d.getElementById("tab" + tab.id).insertBefore(img, d.getElementById("tab" + tab.id).firstChild); - } - } - }); - - //create snippet substring - var indexHit = content.toLowerCase().indexOf(searchSplit[i]); - var priorText = indexHit > 50 ? 50 : indexHit; - var dispString = content.substr(Math.max(indexHit - 50, 0), priorText) + - "" + content.substr(indexHit, searchSplit[i].length) + "" + - content.substr(indexHit + searchSplit[i].length, 50); - - var tabDesc; - tabDesc = d.createElement("div"); - tabDesc.setAttribute("class", "tabDesc"); - tabDesc.setAttribute("id", "des" + tabId); - tabDesc.addEventListener("click", onClickTabResult); - tabDesc.innerHTML = dispString; - - //attach to result display - tabDiv.appendChild(tabDesc); - tabDisplay.appendChild(tabDiv); - } -}); diff --git a/config/TODO.md b/config/TODO.md deleted file mode 100644 index 655b7b0..0000000 --- a/config/TODO.md +++ /dev/null @@ -1,42 +0,0 @@ -###TODO - - -####fix -https>http - webrequest api -detection of mouseover path -arrows should inf scroll/click next -going to news with web results inf scroll pages on bottom - -####features: -infinitescroll check errs -pre-load 3 ahead -group up tabs by what you searched for to get there -pin rez page - star a a few to go abck to them - - -####DONE -autoload google search result on mouse over -restyle google search page -put past iframes in background, then if needed recall instantly -infinite scroll 100 -scroll and highlight the query words on result. window.find broken - - - -openerTabId for subnav of grez - -GREAT SUCCESS - -debate AROUND(5) synergy - -cache: if 404 - - "applications": { - "gecko": { - "id": "in10search@mozilla.org", - "strict_min_version": "46.0" - } -} - - -auto synonyms \ No newline at end of file diff --git a/config/api-install.js b/config/api-install.js deleted file mode 100644 index bd16c88..0000000 --- a/config/api-install.js +++ /dev/null @@ -1,9 +0,0 @@ -//toodo when from google clicked on new page new tab - -chrome.runtime.onInstalled.addListener(function(eventInstall) { - if (eventInstall.reason == "install") - chrome.tabs.create({ url: chrome.extension.getURL("/config/options.html") }, function(tab) {}); - - -}); - diff --git a/config/globalcontent.js b/config/globalcontent.js deleted file mode 100644 index 73f35c7..0000000 --- a/config/globalcontent.js +++ /dev/null @@ -1,62 +0,0 @@ - - - - -window.addEventListener("keydown", onKeyDown, false); - - - -function onKeyDown(e) { - - - if (e.keyCode == 82 && e.altKey && e.ctrlKey) { - - - chrome.runtime.sendMessage({ action: 'read' }, function(res) {}) - - - } - - if (e.keyCode == 191) { - - - - chrome.runtime.sendMessage({ action: 'word-key', selectionText: getSelection() + "" }, function(res) {}) - - - } - - - //tab = search text shortcut - if (e.keyCode == 9 && !e.altKey && !e.ctrlKey) { - - - - - - - - /* - //quit if pressing tab in input box - var i = e.target; - if (i instanceof HTMLImageElement || i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i.textbox || - (i.textContent && i.textContent=='') || (i.ownerDocument && i.ownerDocument.designMode && i.ownerDocument.designMode.match(/on/i)) ) - return; - - var t = window.getSelection().toString(); - - if (t.length > 0) { - chrome.extension.sendMessage({ - type: "openTab", - url: "http://www.google.com/search?q="+t - }); - - } else { - //if already on google results page, then load first result - if (document.location.host.match(/google/gi) && document.getElementsByClassName("g").length>0) - document.location = document.getElementsByClassName("r")[0].getElementsByTagName("a")[0].href; - } - - */ - } -} diff --git a/config/icon/in10-icon-clear.png b/config/icon/in10-icon-clear.png deleted file mode 100644 index da36b4c..0000000 Binary files a/config/icon/in10-icon-clear.png and /dev/null differ diff --git a/config/icon/in10-icon16.png b/config/icon/in10-icon16.png deleted file mode 100644 index 32a8855..0000000 Binary files a/config/icon/in10-icon16.png and /dev/null differ diff --git a/config/icon/in10-icon64.png b/config/icon/in10-icon64.png deleted file mode 100644 index 0374777..0000000 Binary files a/config/icon/in10-icon64.png and /dev/null differ diff --git a/config/options.html b/config/options.html deleted file mode 100644 index eab69ed..0000000 --- a/config/options.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - Options - - - - - - -
-
-
-
- - - - - diff --git a/config/options.js b/config/options.js deleted file mode 100644 index bb9b87f..0000000 --- a/config/options.js +++ /dev/null @@ -1,64 +0,0 @@ -localStorage['alex']=24 - -window.addConfig = function(id, label, checked) { - - - window.config.innerHTML += ''; - - setTimeout(function(){ //timeout required or else only last elem's event gets sets - //persist settings forever - window[id].addEventListener("change", function(){ - var opts = {}; - opts[id] = this.checked; - chrome.storage.sync.set(opts); - },1) - - window[id].parentNode.addEventListener("mouseover", function(){ - - helpInfo.textContent = help[id]; - - helpInfo.style.color = window[id].checked ? "#4285F5" : "#939393"; - - },1) - - },1) -} - - chrome.storage.sync.get({ - enableAutoload: 1, - enableHoverMode: 1, - enablePulsateQuery: 1, - enableInfiniteScroll: 1, - enableSolarizedColor: false - }, function(opts) { - - - addConfig('enableAutoload', 'Enable Autoload', opts.enableAutoload); - addConfig('enableHoverMode', 'Hover Mode', opts.enableHoverMode); - addConfig('enablePulsateQuery', 'Pulsate Query', opts.enablePulsateQuery); - addConfig('enableInfiniteScroll', 'Infinite Scroll', opts.enableInfiniteScroll) - addConfig('enableSolarizedColor', 'Solarize', opts.enableSolarizedColor) - - - }); - - -var help = {}; -help['enableAutoload']="Disable all enhancements to Google search results, but can enable anytime from the results page."; -help['enableHoverMode']="Only mouse over the result item to load page in iframe, instead of clicking on the snippet text."; -help['enablePulsateQuery']="Blink in yellow and highlight the first search result location on the target page."; -help['enableInfiniteScroll']="Instead of pagination, keep auto loading the next 10 results."; -help['enableSolarizedColor']="Invert colors on results page for a dark nighttime mode, except for images."; - - - -helpInfo.textContent = help['default'] = "Search GEAR enhances Google web results, to load the target website for each result on the right side of the page." - -config.addEventListener("mouseleave", function(e) { - - helpInfo.textContent = help['default']; - helpInfo.style.color = "#4285F5"; - -}, 0) diff --git a/gear/api-xhr.js b/gear/api-xhr.js deleted file mode 100644 index 13d977a..0000000 --- a/gear/api-xhr.js +++ /dev/null @@ -1,139 +0,0 @@ -/* HERE BE DRAGONS! - - |\___/| - (,\ /,)\ - / / \ - (@_^_@)/ \ - W//W_/ \ - (//) | \ - (/ /) _|_ / ) \ - (// /) '/,_ _ _/ (~^-. - (( // )) ,-{ _ `. - (( /// )) '/\ / | - (( ///)) `. { } - ((/ )) .----~-.\ \-' - ///.----..> \ - ///-._ _ _ _} -*/ - - -chrome.runtime.onMessage.addListener(function(request, sender, callback) { - - - if (request.action == "xhr") { - - if (request.url.endsWith('pdf')) - return callback("pdf"); - - var xhr = new XMLHttpRequest(); - xhr.onload = function() { - - console.log(xhr) - callback(xhr.responseText); - }; - xhr.onerror = function(e) { - console.log(e) - callback(xhr); - }; - xhr.open('GET', request.url, true); - //TODO pdfs - //xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - xhr.send(); - return true; // prevents the callback from being called too early on return - } -}); - - - - - -/***** REQUEST **** -chrome.webRequest.onBeforeSendHeaders.addListener(function(req) { - - if (req.tabId < 1) return {}; - - // if (!req.tabId < 1) return {}; - - chrome.tabs.get(req.tabId, function(tab) { - - console.log(tab.url) - //make sure this request is coming from our app on google search page - if (tab.url.search(/https:\/\/.+\.google\.com/i) > -1 && tab.url.indexOf("google.com/url?") == -1) { - - var domain = "*"; - for (var i in req.requestHeaders) - if (req.requestHeaders[i].name == 'Origin') { - domain = req.requestHeaders[i].value; - break; - } - - localStorage.setItem(req.requestId, domain) - - return { requestHeaders: req.requestHeaders }; - } else { - return; - } - - }) - - -}, { urls: [""] }, ['blocking', 'requestHeaders']); - - - - -/***** RESPONSE ***** -chrome.webRequest.onHeadersReceived.addListener(function(res) { - - var domain = localStorage.getItem(res.requestId); - - //direct click of google search > rez in same tab - - console.log(!!domain) - if (!domain) - return; //only process requests from this app - - - // localStorage.removeItem(res.requestId); - - var isSetCSP = 0; - - - - for (var i in res.responseHeaders) { - if (res.responseHeaders[i].name == 'Access-Control-Allow-Origin') - res.responseHeaders[i].value = domain; - - else if (res.responseHeaders[i].name == 'Allow') - res.responseHeaders[i].value = 'POST, GET, OPTIONS, PUT, DELETE'; - - - else if (res.responseHeaders[i].name.toLowerCase() == 'x-frame-options') - res.responseHeaders[i].value = ''; - } - - return { responseHeaders: res.responseHeaders }; -}, { urls: [""] }, ['blocking', 'responseHeaders']); - - -*/ - - - -/* LOGGING DEBUG */ - -DEBUG = false; - -if(DEBUG){ -chrome.webRequest.onBeforeSendHeaders.addListener(function(req) { - console.groupCollapsed("REQ " + req.url); - console.log(JSON.stringify(req, null, 2)) - console.groupEnd(); -}, { urls: [""] }, ['blocking', 'requestHeaders']); - -chrome.webRequest.onHeadersReceived.addListener(function(res) { - console.groupCollapsed("%cRESPONSE " + res.url, "color:green;"); - console.log("%c" + JSON.stringify(res, 0, 1), 'background: rgb(220,255,220)') - console.groupEnd(); -}, { urls: [""] }, ['blocking', 'responseHeaders']); -} \ No newline at end of file diff --git a/gear/autoload.js b/gear/autoload.js deleted file mode 100644 index ffdc693..0000000 --- a/gear/autoload.js +++ /dev/null @@ -1,333 +0,0 @@ -document.addEventListener("DOMContentLoaded", function() { - - //only on specific pages of web results - if (!$(".hdtb-msel") || !$(".hdtb-msel").textContent || ["All", "Videos", "News", "Shopping", "News", "Books"].indexOf($(".hdtb-msel").textContent) == -1) { - document.querySelector('html').classList.add("disableAutoloadApp"); - return - - } - - - - //listen to mouse over on container of .g then detect if on .g, - //to avoid having to bind listeners to new .g when those get added - - $("#ires").addEventListener("mouseover", function(e) { - - //if no-hover mode - if (window.enableHoverMode && !window.enableHoverMode.checked) return; - - for (var i in e.path) - if (e.path[i].classList && Array.prototype.indexOf.call(e.path[i].classList, "g") > -1) { - doMouseOver(e.path[i]); - - break; - } - - }, 0) - - $("#ires").addEventListener("click", function(e) { - for (var i in e.path) - if (e.path[i].classList && Array.prototype.indexOf.call(e.path[i].classList, "g") > -1) { - doMouseOver(e.path[i]); - - break; - } - }, 0) - - $("#ires").addEventListener("mouseout", function(e) { - - for (var i in e.path) - if (e.path[i].classList && Array.prototype.indexOf.call(e.path[i].classList, "g") > -1) { - doMouseOut(); - - break; - } - }, 0) - - - }) //end dom loaded - - - - -//TODO youtube autoplay suprpression - - -//clear intent-to-load timer if user leaves mouse from g in <300ms -function doMouseOut(g) { - clearTimeout(window.loadPageAfterDelayTimeout); -} - - -function doMouseOver(g) { - - //clear prior intent-to-load timers - clearTimeout(window.loadPageAfterDelayTimeout); - - - //start transition to demonstrate "intent to action" - // g.className += " current" - - - //set a intent-to-load page in 300ms timer, to avoid trigger from fast mouse swipes across whole screen - window.loadPageAfterDelayTimeout = setTimeout(function() { - - //clear flag to delay mouseover intent longer, set when scrolling - window.longDelayHover = false; - - - //hide prior rFrames - document.querySelectorAll('.current').forEach(function(cur) { - if (g != cur) - cur.className = 'g'; - }) - - if (document.querySelector('.show')) - document.querySelector('.show').className = ''; - - - - //highlight current .g - g.classList.add("current") - - - - - var url = g.querySelector('h3 a,a').href; - - var rez = document.querySelector("#rez"); - if (!rez) return; - - - - //use preloadId to check if rFrame already loaded then show it - - if (preloadId = g.querySelector('h3 a,a').dataset.preload) { - - if (rez.querySelector("#" + preloadId)) { - rez.querySelector("#" + preloadId).style.opacity = 0; - - rez.querySelector("#" + preloadId).className = 'show'; - onFrameShow() - } - - } else { //create new iframe for target - - //set preloadid token into .g link for later recall - g.querySelectorAll('a')[0].dataset.preload = preloadId = "i" + $("#rez").childNodes.length; - - - - xhrFrame(url, preloadId, function(rFrame) { - - //show iframe - rFrame.className = 'show'; - rFrame.style.opacity = 0; - - //apply scripts to target page dom in the iframe - setTimeout(onFrameShow, 130) - - }) - - - - }; // end create new iframe - - - //TODO timeout for preloaded - }, window.longDelayHover ? 700 : g.querySelector('h3 a,a').dataset.preload ? 50 : 350) //loadPageAfterDelayTimeout - - -} - - -function xhrFrame(url, preloadId, callback) { - //TODO pdf.js - - - - //get target page's html via a bypass cors xhr executed from background.j, inserting scrapped html into iframe - chrome.runtime.sendMessage({ action: 'xhr', url: url }, function(responseText) { - - if (responseText && responseText.error) - console.log(responseText.error) - - - - var domain = (url.match(/(http:\/\/|https:\/\/)[^\/]+/gi) || [""])[0]; - - //allow relative resource paths to load using the target's domain - responseText = responseText && responseText.replace(/]*>/i, "" + - ""); - - //error fallback: set iframe src to be served thru hkrnews.com proxy which spoofs headers - //var targetUrl = (location.protocol=="https:"?"https:":"http:") + "//hkrnews.com/get?url=" + url; - - - //create a blank iframe with unique id - var rFrame = document.createElement('iframe'); - - if (!url.endsWith('pdf')) - rFrame.setAttribute('sandbox', 'allow-same-origin allow-scripts allow-forms'); - - rFrame.id = preloadId; - - - - rez.appendChild(rFrame); - rFrame.addEventListener("load", function(e) { - console.log(e) - //this is for redirects on a[href] by user in iframe - - }, 0) - - - // var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; - - // var observer = new MutationObserver(onFrameShow); - - // observer.observe(rFrame.contentDocument.querySelector("html"), { childList: true, subtree: true }); - - - // if (url.endsWith('pdf')) - // alert(responseText.length) - - //set blank iframe html to be the xhr html - if (url.indexOf("youtube") > -1 || (url.indexOf("www.google.com") > -1 && url.indexOf("chrome.google.com") == -1) - || url.endsWith('pdf')) //|| !responseText) - rFrame.src = url; - - else - - rFrame.contentDocument.querySelector("html").innerHTML = responseText; - - - - //NO ERRORS - //console.clear(); - - callback(rFrame) - - - - }); //end xhr - -} - - -//apply scripts to target page dom in the iframe -function onFrameShow() { - - //TODO with timeout not always done - // $("#rez .show").onload =function() { - - if ($(".show").style) - $(".show").style.opacity = 1; - - - //match solarize except images - - if ($(".show").contentDocument) { - - if (document.body.classList.contains("solar")) - $(".show").contentDocument.body.classList.add("solar"); - else - $(".show").contentDocument.body.classList.remove("solar"); - } - - - //highlight on result page, the subtext from .g result, first phrase/sentence - var g = document.querySelector('.current'); - if (!g) return; - - var queryTextNode = g.querySelectorAll(".st")[0] ? g.querySelectorAll(".st")[0].cloneNode(1) : false; - if (queryTextNode && queryTextNode.querySelector(".f")) - queryTextNode.removeChild(queryTextNode.querySelector(".f")) - var queryText = queryTextNode ? queryTextNode.textContent.replace(/\.\.\.(.?)+/, '').trim() : false; - - - //execute commands in the window context of iframe - var rWindow = $("#rez .show").contentWindow; - if (!rWindow) return; - - - if (rWindow.getSelection().rangeCount) rWindow.getSelection().collapseToStart(); - //window.find(aString, aCaseSensitive, aBackwards, aWrapAround, aWholeWord, aSearchInFrames, aShowDialog); - var found = rWindow.find(queryText, 0, 0, 0, 0, 1, 1); - - - //searching first subtext phrase can fail if iframe has it as multiline, so find just bold word - if (!found) { - var queryBoldWord = g.querySelectorAll("em")[0]; - if (queryBoldWord) - var found = rWindow.find(queryBoldWord.textContent, 0, 0, 0, 0, 1, 1); - } - - //scroll to position selection to middle - if (!$(".show").contentWindow.getSelection().isCollapsed) { - //position highlighted to top - $(".show").contentWindow.getSelection().anchorNode.parentNode.scrollIntoView(1); - - //position highlighted to middle - $(".show").contentWindow.document.body.scrollTop -= $(".show").contentWindow.innerHeight / 2 - 30 - - } - - //query terms to highlight, by each word, on target iframe - - var q = document.querySelector("#searchform input[name=q]").value; - console.log(q) - var q2 = "((?=.*" + (q.match(/"([^"]+)"|[\w]+/gi) || []).join(")(?=.*").replace(/\"/g, '') + ")).+" - - console.log(q2) - - // debugger - - // - // rWindow.document.body.innerHTML = rWindow.document.body.innerHTML - // .replace(new RegExp("" + q2 + "", "gi"), "$1") - - - - - - // on the target iframe, pulsate the first found phrase string - if (found && window.enablePulsateQuery.checked) { - - var throbTimesToPulsate = 2; - - - function throb() { - var selNode = rWindow.getSelection().anchorNode.parentNode; - selNode.style.backgroundColor = "#a2c2fa"; - - setTimeout(function() { - - selNode.style.backgroundColor = ""; - - if (--throbTimesToPulsate) - setTimeout(function() { - throb(); - - }, 400) - - }, 500) - } - - throb() - - } - - - - //TODO - //enable keyEvents to bubble up to main page - rWindow.onkeydown = keyDownHandler; - - rWindow.focus(); - - - - -}; //end onFrameShow diff --git a/gear/css/gear-restylegoogle.css b/gear/css/gear-restylegoogle.css deleted file mode 100644 index 2cae940..0000000 --- a/gear/css/gear-restylegoogle.css +++ /dev/null @@ -1,94 +0,0 @@ - -.mslg{ - display: flex; -} -.mslg .vsc { - width: 100% !important; -} -.mslg>td{ - width: 200px; -} - -.nrgt{ -margin: 0 !important; -} - -/* restyle google default page */ - -html:not(.disableAutoloadApp) #center_col, -html:not(.disableAutoloadApp) #res { - margin-left: 0 !important; - padding-left: 0; -} -html:not(.disableAutoloadApp) .g { - margin-bottom: 15px; - padding-left: 15px; - overflow: hidden; - cursor: pointer; - border-radius: 5px; -} - - - -} -html:not(.disableAutoloadApp) body:not(.resizing) .g { - cursor: pointer; -} - -html:not(.disableAutoloadApp) .hdtb-mitem.hdtb-imb { - margin-left: 15px !important; -} - -html:not(.disableAutoloadApp) #footcnt, -html:not(.disableAutoloadApp) .rgsep, -html:not(.disableAutoloadApp) #extrares, -html:not(.disableAutoloadApp) #foot { - display: none; -} - -html:not(.disableAutoloadApp) #hdtbSum { - border: 0 !important; -} - -html:not(.disableAutoloadApp) #slim_appbar { - margin-left: 0px !important; -} - -/* shrink searchbox */ - -html:not(.disableAutoloadApp) #tsf{ - max-width: 33% !important; -} -html:not(.disableAutoloadApp) .sfibbbc{ - max-width: 100% !important; -} - -/* google search topbar fixed */ - -html:not(.disableAutoloadApp) #searchform { - position: fixed !important; -} - -#searchform.fixed:not(:hover), -#searchform.fixed:not(:hover) * { - visibility: hidden; - background: none; -} - - -html:not(.disableAutoloadApp) #gbw>div>div { - position: fixed; - right: 0px; -} - -html:not(.disableAutoloadApp) #ab_ctls { - /* right: 0px; - top: -29px;*/ -} - - -html:not(.disableAutoloadApp) { - /*opacity: 0; */ - /*transition: .5s;*/ -} - diff --git a/gear/css/gear-style.css b/gear/css/gear-style.css deleted file mode 100644 index bf97e6b..0000000 --- a/gear/css/gear-style.css +++ /dev/null @@ -1,228 +0,0 @@ -#rez { - border: 0; - height: 100%; - z-index: 102; - background: white; - position: fixed; - right: -15px; - -} - -#rez iframe { - height: 100%; - width: 100%; - border: 0; - position: absolute; - top: 0; - right: 0; - opacity: 0; - visibility: hidden; - volume:0; -} - -#rez iframe video{ - volume: 0; -} - -#rez iframe.show { - visibility: visible; - opacity: 1; - transition-delay: 0, .5s; - transition: opacity .5s ease-in-out; - background: white; - volume:1; -} - -.current { - background: aliceblue; - __transition: 0.1s .5s; - transition: opacity 0.2s 0 ease; -} -.current::before{ - content: "\2022"; - color: #4285F5; - float: left; - margin-top: -12px; - margin-left: -14px; - font-size: 3em; - -} - - -.solar .current { - background: #BDE0FF; -} - - - -/* solar */ -.solar{ - -webkit-filter: sepia(50%) opacity(90%) invert(100%); ; - _transition: 1.5s; -} -body:not(.solar){ - _transition: 1.5s; -} -.solar img{ - -webkit-filter: invert(100%) !important; - transition: 1.5s; -} -#cnt{ - background: white; -} - - - - -.pin{ - height: 32px; - width: 32px; - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAAEEfUpiAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFEUlEQVRYw7VXaWxUVRT+zn3vzUxLC6VgSwuFBGjBhcjehSBLiTUqIQYSNgkCGsrygxiNP0wwBOOW+IulU0sLP0rBmKDGLf4oiAk7JWgToa/DHiANVAQ6nc68d+/xR/vaN9OZ6WL9kknecs93vnPuOee+IWaGG7pzMWtfkwJAetcNA0DDtikkAGDccGOis5JiOQQAzN7fxI6ZAAAChXLTjdLuB4o55e4Tq74Xx9wK87RUXAwADOCS4xUA5lU2vyMVF6caYgMDSNXFp1EMjlMHDdumEACAmcHMWHzALHOu3b+omxNXn4qyQ4GohVEi3W4cF8Ltd1yGZ6ZzXbjfrIgSWeQ3WTHCtmIvukLsXjBrXxMzA0QxEbhdEPW4mrm3R4twLNxJuLS9h6E7nCJ/kz9eHnrtp4OSyuZ6W6l8qZDXTeYS30tjLCK2Wmy7jDvLojOXyw/fWNMnwYgUbSkAGBod1QR9YQiCLuhaVpr+8r02a1nckpyz32TFDCHoA6X4c7d0AeBijPwoBW8fu52jusgc47wMY4lXE0fyMz1FDKDYb9bHEkQpKDt4rehhu30mUViGRg/OlhdkJSRwMHtfExdPSMs6fyf4HgiZGV7t0K8bJp2Kyxq7r9P3XOV4+53ol7AOAGD3iZbcMzfbskFk//zWxMZ4axISLKkJrH4UknXuZz5d1JzanL+pz0Iq9ptngxH1WuzzDlttXHigeXOfBJKRmZmi18V79ySs/H0SzJ+Q9mJLm/WTRmiNfefR6Nyi6sCcpARfvpobykjRt9iMUc9n+Yp0QTd1QfDp4n1bceGJTZMvJExikd88pwv6KmSpAyNT9GVtYVlpKR7DADQCLmyNLudugnVf3xrx18OOfwDAEPTEUjw8WRv3CuFKa6cxAOSm66932XW3cUmleSweQfeZolTP3Lr12Prdp9NHHZKJAE0jmhe2+Y2khVTkN/dYkrcjCaZlp4w9tGL8vYSVGHtAxKIh2TxwFuiC7sYzTvWIqqQ5cODVaYeHqVUQpoYlzxNA8+nygl0JZcW254y9A2vnqBBWHr0x2avRYQwASedBIiyoav5kpE8/dz9ovSIVlysXhSDAEPTDmDT9w2/fjD9DBi3gparm1e2WqjM0WhuxuV+RejU6ebq8YGGi92IgkYdtrtGIGsEo7LeN5AVzK8zQkAjQBPbYiqdpRC26oD/d7ZoMtmJfaXVgTdnB68/95xoorQmsfdQua4UAxo/wzL/31NoWkbyKEkVI1JE1TC9pCVqXLm7t3Yj6QAvwcUjWejQ6PnqYvvPOY+ukYta6BnXAklzn0ekBALYkcgSh3FI86kHQ+i6e84QZWFQdIJ8mxra2239I5syuSHZphI2W4qgPHo0opAl8lpNuNIQlGx0We8O28mT4tMYf10+8PKguKPGb34clL+2axJ1HkU6XpcJvUvGOZIQ+Xew+tTl/56DnwIq661Ov/21doTgJIwKy04zprUG7NqL4BfcSBjDSp60LWurdiOQZ2Wl6yS/rJ50ZVAbmVpgsVfLi5M4ev68YNwVhfFjyWIr5Fr2Y4BTssw3PbynQRR+mBCAiOcdWXByJcd75l6jze3BQAgDIC1un0OhUo4wwcDADGanaSgDWkI3i0urAqqClPo7YPAnkqk7XlhiCQmkeWl+/Kf+b/ort1xwo9Ju3peK8I+vy9Pz0VIkhRJ+juNhvNtqS82ZkD0sfauf9EqARjj/7jHd41fJxbfgf8C9oxdzAhSw0rQAAAABJRU5ErkJggg==') -} - - - - - - - -/* settings */ - -#sblsbb { - position: relative; -} - -#settings-btn{ - text-align: center; - border-bottom-left-radius: 0; - border-top-left-radius: 0; - height: 40px; - margin: 0; - padding: 0; - width: 40px; - min-width: 38px !important; - background-color: #4285f4; - border: none; - position: absolute; - top: 0; - margin-left: -1px; - left: 100%; - background-height: 40px; - color: black; - background-size: 30px; - background-repeat: no-repeat; - background-position: center; -} - -#settings { - position: absolute; - left:100%; - z-index: 1000; - width: 120%; - - font-family: 'Roboto', Verdana; - font-size: 11pt; - - display: flex; - justify-content: space-between; - flex-wrap: wrap; - background-color: rgb(241, 241, 241); - - padding: 0px 12px 6px; - border-bottom: 1px solid #e5e5e5; - - height: 49px; - overflow: hidden; - margin-right: 54px; - - height: initial; - overflow: visible; - - transition: 1s; - - opacity:1; -} - - -#settings-btn:not(:hover) #settings{ - display: none; - opacity: 0; -} - - - - -.resizing{ - cursor: e-resize !important; -} - - - -/*page result Dashboard*/ - -#dashSearch{ - position: absolute; - top: 58px; - z-index: 9999; - display: flex; - - flex-direction: column; - background: rgba(255,255,255,.5); - border-radius: 15px; - padding: 5px 2px; -} - - -#dashSearch div { - - width: 32px; - height: 32px; - padding: 0; - cursor:pointer; - margin: 0; - outline: 0; - border: 0; - transition: all .3s ease 0s; - text-align: center; - display: inline-block; -} - - -#dashSearch div:not(:hover) { - opacity: .5; -} - -#btnRead{ - background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAAHdbkFIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjc2OUM5NzRGMzI3RDExRTY4MzhGRTVFMTNFRDUzNkQxIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjc2OUM5NzUwMzI3RDExRTY4MzhGRTVFMTNFRDUzNkQxIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NzY5Qzk3NEQzMjdEMTFFNjgzOEZFNUUxM0VENTM2RDEiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NzY5Qzk3NEUzMjdEMTFFNjgzOEZFNUUxM0VENTM2RDEiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6lLSK3AAAFb0lEQVR42mL8//8/Az7AsvjCbxgbpJIRSQ7MZwISn9AEkenrTAwEAPUULAbiQCRHgug0IFZkARJ8aJpgvpkNwgABxEhsOKCHgRwQPwSJsWDxO4p1dAyHKVBHngbiPJDjgXgROEAWnf+FHgaXgFgfJgAQQATDgRAAhRPIBD0gvowlKIqAuB+IzwGxIZocyMnFICeC0hMvVACbc3CJ3wBiDSYGCsHgMIAXT1oCARkc4hpUiUaAAKLYAIrDALngmQfEiUBcBcTtONRfhCY6RmQX7EBT1AYNUJjfxJH4etgyrDueGACF9Asccv8HT0IaNQABxCk14A0Q1wCxAjSlKQPxdyD+DOWDsBUQtwDxQnhSRjIgDkq3IIltgGb3//hcwIgDxwNxAFK5iBVTnJ0BAohiA6hZHCCDnUDMA8TeQPyBCvakA/EMtDoebzp8Co3x90hFCQjfA2JJApa1oOn5D7UcewhAG1q8aBUhLqAIxM+Q+PrQup6UeHwNxCLUyom/yNDzhqpFwYCXRaMOGHUArRyQBC0PuIBYE4ijgXgBtGAiBpyEVm2OQCyGVHlgNEJZcLV38ABQKVkHbckhF17CQDwTiIOB2ByKiQoBPnzVHRSDHBoObRpKA/FcLMXtG6jlIDABiLWJMJeRhcgg/QvEq6AYGcQCsS20M/RlSFbHAAE04A4YLQdwtYhA8ZIBzVaUAgEg3gpNpO6khMAMqEMuQodISAWVUP3voa2rp+RGgR50fOY/WpsbG5CENtv+Q3uKRKUBkOJiIn1VDVUPGvwQRRIvhIo/gzbbCAFdaNcWPqbUAzXgNZEOAY28vEIKoT4SogY2ZgRKD5+Z8LXXaNguHC0HRh0w6oBRB4w6YNQBI9MBWIcyWXB0y2D9OFFoD8caiH2J7G6BmmAbgXg3tOECak19x9koRePLMiDGQR9B8RUg7gDiViR1uUh8kOGgmasIaHMMBuShDRdQd00C2gVkJ+QA0NhgHAEfrmWAjPtNhvJBPjSD9qgPQfuONE0DwdCWEyi6QPM666HsuaRaDgS8TMT0YKHpYAIWAx4zIAaUYeAitCfNQozZxIbANWjLF6bxEhY18VA5A2gv+i9RPSMys5Q+NL2AWsOHGSDTyaO9Y7IAQID2rZ6lgSCITpGIEkVUDIiNBEW0TmGKpBIRmzQKQRAEsbfyB/gH7INgIzamSC02afwobLVQ0UbkBBUNYuREnOHecet5SUxyZxLcBw+S7N3t7Mve3O7MXNMV+PfPolYNT3hBcrtjcEf3LToeCYmuMS+Y237PgCRCHgYcv+R5tpipJg44BRteYJMBG5N/cQtIkmuFWaDv4docMx3AYNO4ttpXATb0NOID4lS+VKMeyFIhrxj5zszW8q/g2CzOta+TJycO7gdkzPEQHqSdrsZz5gFzl3ncYEcdzFWQlBXkOJYy9ir0Esf6jSnmInOarLSLipIIYHoIMAHOMUcDMKqLGVG+RwIavGCHrDIIL5jVfIBJ7Q9TrwO0AFoALYAWQAugBdACaAG0AFoALYAWwIVaAvPy8tApOXmubmxjwy2w23slp27PgK2+CKBuJTfBWvb8ksFIMGeZM672cJnPNvbJKio6Iivf81anQJ+VGtW3u/yARIuvyModST7pBHRD+iv+4jeBXYc6SVZxlAQ3oj7ZWwz5PB2jYKJMe4m5R1ZB3qGrTcrIpFJwgX5GqAL1AWJMH/MR/8Atps0zqGJAue+HMFjxCSPgYJX+ZGBLoOCjDl8kkNK6G9DAzLtT/MGD6/heUJz+MGZbP/NJOl4PUGCZtvPMZfIuJqw08GuyasZzuJ3a8jEohm8wY+TkljNwcF5OL6McF8O5Z0EaqJOjeiX4z/EF0HtIEQEsMOsAAAAASUVORK5CYII=') no-repeat center center;; -background-size: 100%; - -/* - margin-top: 5px !important;*/ - -} - -#btnTab{ - background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAAHdbkFIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjgyMEFGNjFDMzI3RDExRTY4NUI4QkJEMjk3MkJDRjNCIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjgyMEFGNjFEMzI3RDExRTY4NUI4QkJEMjk3MkJDRjNCIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6ODIwQUY2MUEzMjdEMTFFNjg1QjhCQkQyOTcyQkNGM0IiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6ODIwQUY2MUIzMjdEMTFFNjg1QjhCQkQyOTcyQkNGM0IiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4oDOZtAAAEb0lEQVR42mL8//8/Az7AAiIWX/iNLg7XxYRFkzMQu6CYgKwDHSCbwAjFMPAJlxUtSIoZsSmoxfAFEBQB8Tw0hXwgAiCAGAmGA74wiDVgxXCDCxR7IbvhFxCzIilig4rBw+EHkrdgkoy4gvo3VBLkjm24AgoGvGFu4MMSBqkwBkAAEQwHQgBXesEabugAPRz/48DIwYczOX1CS1KMaEHLgBT2jLjSIzaQgkUjzLI5yKkNF5gDU4gGGNGT629CAYYEzqKYRGk0AgQQxQYwMVAIiElIs6GxQTAhkaQZPRawASkgXgHFMLAHlwHbgdgDj2EiQPwGnwvwaWZESx+MuApnPhx54T+2FEhsNP7H4xKS0gFIMy+2/MBChEa84hSnRGQDPhNQ+5lQQvpPdl6A+mkeEeqTqJ6dAQKIYgOoGQkDAuCRSKBMoqjIwVWWEZMR8IF9QOxItRAgAzjhkWNFbgQRmwbm4mkeEINhFv/HYflPQiEQSkQZhM/H/wmUW/9JyQW8JFr8C4fFjIRKKHLTABuuIIVayoxk8WccTSaKygFYQzoVR2eDC09bDUUfC4W5CFfjj+i6bfCUhGjgKR3swJDkQ0o4vFR0ANdobYgPAATQaAiMOoAaLSKymsSwFhE1QoCcVPyZWlHwf6DSABc1LKekNgxhQBohxAI+APFOIBamlQMWEZC/QIzl6FHAT2Gj9DSS5frkpIEPFDZMTPFYfpWWBdEcaBMLl+Ug+UhS0sAnaHSQAvBZDnKcMykhwEhly9loWRcQsnw9EPPQygGELAf1mgMYEKOhWDs+5JYDoEarFAHLU4hpopMbAtJ4LAeBCGL7B5REASMOy7FVUv9wJXBKEyHIwDVolmMD6rTsGYUSoWbGaJuQFAdQo6FBtBksOAqJTxQ6gIfYop0FR8qmZuf0M7FRMIcGUdzLQMIYESgvr8JXd5MA/gLxcgbIYOZo53RwOwAgwAY8CkZ8DIwGwGAZHqHSMAklQBKImxggw+y0Aj9iDVizqNE1pzYga9aNnAAA4kEVAPTyOAz8ptbgzFDzOEmNQVoBGQYSRq2IiEnWoVYLPGGALKVhpBCvpJbniUkBoBE3ayAWoHPVLAOtER5AxUAeBg0/6tMjC/BAk6ryAGVLULcoidYex5cFXg6Q55Fns1mhkfCLBM+XQlPOH0pTwF8cYodxyFEKzkMdT26MIw+KeZBasBOr+BsQe0IbErQAlHocZz1PzVqAlUYeJzWpoy/86ANinaHWGaKGx0GNKVBfPhOI7xPb/R/oAOClosdTkJI9sf5YMZAtQVAvr5BEjyPncdCamo8U1DCpA50F/kIbN4wM+GcT5uBQA4r1z2R4HK99A1UGYHPYHCIChxCATUguJNasge4Ok7LyjhhwmoHEWd7hNiT2ZqhUg4MGjA6KktCA4B1gt/IykL6Kg6wA4MbRRX46SCORg4GCSV1sWSBziKVieyD+Qs0AmAVNanVAfIMBscZisICvDJD1X+FQdx6nxLDRucHRanA0AEY2AADg2xkO/zSh/gAAAABJRU5ErkJggg==') no-repeat center center;; -background-size: 100%; - - /*margin-top: 5px !important;*/ -} - - - -#btnFind:after{ - content: '\0027B7'; -} - -#btnBack:after{ - content: '\01F519'; -} - -#btnFind:after, -#btnBack:after{ - font-size: 32px; - color: #a2cffa; -} - - - diff --git a/gear/css/uiLoader.css b/gear/css/uiLoader.css deleted file mode 100644 index 80f335b..0000000 --- a/gear/css/uiLoader.css +++ /dev/null @@ -1,63 +0,0 @@ -/* ...loader */ - -.loader:before, -.loader:after, -.loader { - border-radius: 50%; - width: 2.2em; - height: 2.2em; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-animation: load7 1.4s infinite ease-in-out; - animation: load7 1.4s infinite ease-in-out; -} -.loader { - color: #4285F5; - font-size: 8px; - margin: 80px auto; - margin-top: 30%; - position: relative; - text-indent: -9999em; - -webkit-transform: translateZ(0); - -ms-transform: translateZ(0); - transform: translateZ(0); - -webkit-animation-delay: -0.16s; - animation-delay: -0.16s; -} -.loader:before { - left: -3.5em; - -webkit-animation-delay: -0.32s; - animation-delay: -0.32s; -} -.loader:after { - left: 3.5em; -} -.loader:before, -.loader:after { - content: ''; - position: absolute; - top: 0; -} -@-webkit-keyframes load7 { - 0%, - 80%, - 100% { - box-shadow: 0 2.5em 0 -1.3em; - } - 40% { - box-shadow: 0 2.5em 0 0; - } -} -@keyframes load7 { - 0%, - 80%, - 100% { - box-shadow: 0 2.5em 0 -1.3em; - } - 40% { - box-shadow: 0 2.5em 0 0; - } -} - - - diff --git a/gear/css/uiToggle.css b/gear/css/uiToggle.css deleted file mode 100644 index 0783eac..0000000 --- a/gear/css/uiToggle.css +++ /dev/null @@ -1,45 +0,0 @@ -/* uiToggle Android-style checkbox */ - -.uiToggle { - cursor: pointer; - position: relative; - display: inline-block; - margin: 15px 8px; -} - -.uiToggle input { - visibility: hidden; - margin-left: 45px; -} - -input:checked~.uiToggle-ball { - background: #4285F5; - left: 26px; -} - -input:checked~.uiToggle-slide { - background: #a2c2fa; -} - -.uiToggle-slide { - display: block; - width: 50px; - height: 20px; - background: #939393; - border-radius: 10px; - position: absolute; - top: 0; - transition: .5s; -} - -.uiToggle-ball { - height: 28px; - width: 28px; - border-radius: 50%; - background: white; - position: absolute; - top: -4px; - left: -4px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); - transition: .5s; -} diff --git a/gear/pageinit.js b/gear/pageinit.js deleted file mode 100644 index fd722dc..0000000 --- a/gear/pageinit.js +++ /dev/null @@ -1,378 +0,0 @@ -//fadeIn the page -setTimeout(function() { - document.querySelector("html").style.opacity = 1; - -}, 100) - -//pull settings from account sync -if (chrome.storage.sync) -chrome.storage.sync.get({ - enableAutoload: 1, - enableHoverMode: 1, - enablePulsateQuery: 1, - enableInfiniteScroll: 1, - enableSolarizedColor: 0, - enableSwag: 0 -}, function(options) { - for (var i in options) - localStorage[i] = options[i]; - - - //before dom content loaded, to reduce twitch - if (localStorage['enableAutoload'] != "true") { - document.querySelector('html').classList.add("disableAutoloadApp"); //remove the css restylings - } else{ - - - - - - - - - - } - -}); - - -//util$ -function $(s) { - var e = document.querySelectorAll(s); - return e.length == 1 ? e[0] : e; -}; - -NodeList.prototype.forEach = Array.prototype.forEach; - - - - -function xhr(url, cb) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.onload = cb(xhr.responseText) - xhr.onerror = function() { - console.log(xhr) - }; - xhr.send(); -} - - - -document.addEventListener("DOMContentLoaded", function() { - - - //DISABLE - return - - - - //only on specific pages of web results - if (!$(".hdtb-msel") || !$(".hdtb-msel").textContent || ["All", "Videos", "News", "Shopping", "News", "Books"].indexOf($(".hdtb-msel").textContent) == -1) { - document.querySelector('html').classList.add("disableAutoloadApp"); - return - - } - try{ - - //force http to avoid mixed content CSP block of http iframes on https google - if (location.protocol == "https:" && typeof window.localStorage !== 'undefined' && localStorage['enableAutoload']=="true") - location.href = location.href.replace("https", "http") + "&gws_rd=ssl"; - } catch(e){ - window.enablein10 = false; - } - - // alert($(".hdtb-msel").length) - // return; - - - //SETTINGS - - - var icon = chrome.extension.getURL("config/icon/in10-icon-clear.png") - - window.sblsbb.innerHTML += ""; - - - - // $("#searchform form").innerHTML += ''; - - window.addConfig = function(id, label, checked, onchange) { - - $("#settings").innerHTML += ''; - - setTimeout(function() { //timeout required or else only last elem's event gets sets - //persist settings forever - window[id].addEventListener("change", function() { - localStorage[id] = this.checked; - var options = {}; - options[id] = this.checked; - chrome.storage.sync.set(options); - if (onchange) onchange() - }, 1) - - - //reinit settings to apply on load, except reload functions - if (window[id] && id != "enableAutoload" ) - window[id].dispatchEvent(new Event('change')); - - }, 1) - - } - - - addConfig('enableAutoload', 'Enable Autoload', 1, function() { - setTimeout(function() { - location.reload(); - }, 500); - }); - - //if extension disabled, quit after setting the enable switch - if (localStorage['enableAutoload'] != "true") return; - - - addConfig('enableHoverMode', 'Hover Mode', 1); - addConfig('enablePulsateQuery', 'Pulsate Query', 1); - addConfig('enableInfiniteScroll', 'Infinite Scroll', 1, function() { - $("#foot").style.display = window.enableInfiniteScroll.checked ? "none" : "block"; - //TODO move cur page up - }); - - addConfig('enableSwag', 'Turn Your SWAG On', 0, function(){ - - - if(window.enableSwag.checked) { - - - chrome.runtime.sendMessage({ action: "swag"}, function(){}) - - } else { - chrome.runtime.sendMessage({ action: "swag-stop"}, function(){}) - } - - }) - - addConfig('enableSolarizedColor', 'Solarize', 0, function() { - if (window.enableSolarizedColor.checked) { - document.body.classList.add("solar"); - if ($(".show").contentDocument) $(".show").contentDocument.body.classList.add("solar"); - } else { - document.body.classList.remove("solar"); - if ($(".show").contentDocument) $(".show").contentDocument.body.classList.remove("solar"); - } - }); - - //move google's settings button - // window.searchform.appendChild(window.ab_ctls) - - - //search icon widget -- small ui - - - //if links list has been resized, then remember that width - if (localStorage["linkwidth"] && localStorage["linkwidth"] < 800) - $("#ires").style['max-width'] = localStorage["linkwidth"] + 'px'; - - - - - - //#rez container for iframes, and takes up half the page fixed position - var rez = document.createElement('section'); - rez.id = 'rez'; - - var dashSearch = "" - - rez.innerHTML = "
"+dashSearch; - document.body.insertBefore(rez, document.body.firstChild); - - //dash search - btnRead.addEventListener("click", function(){ - - - - },1) - - btnTab.addEventListener("click", function(){ - - window.open(document.querySelector(".current a").href, "_blank"); - - },1) - - btnBack.addEventListener("click", function(){ - - $("#rez .show").contentWindow.history.back(); - - },1) - - btnFind.addEventListener("click", function(){ - - - $("#rez .show").contentWindow.find(); - - },0) - - - - - function positionRez() { - if (!window.rez || !window.settings || !$(".g")[0]) return; - - var rezWidth = document.body.clientWidth - $(".g")[0].clientWidth; - var rezTop = Math.max(0, $(".sfbg.nojsv").getBoundingClientRect().bottom + 1); - if (document.body.scrollTop>rezTop) - rezTop=0 - - - rez.style.width = rezWidth + "px"; - rez.style.top = rezTop + "px"; - - //config bar - var configWidth = document.body.clientWidth - $("#searchform form").clientWidth - $("#gbw>div>div").clientWidth + 20; - window.settings.style.width = configWidth + "px"; - - // during scrolling, make the intentional lag of mouse hover slightly longer - window.longDelayHover = true; - - - // show or "hide unless hovered" the topbar - searchform.className = document.body.scrollTop>60 ? "fixed" : ""; - - }; - - - - - - - - - - //IFRAME resizable - window.dragSidebar = false; - $("#rcnt").addEventListener('mousemove', function(e) { - - if (ires.getBoundingClientRect().right < e.offsetX) - $("body").classList.add('resizing'); - else if (!dragSidebar) - $("body").classList.remove('resizing'); - }, 1) - - $("#rcnt").addEventListener('mouseout', function(e) { - if (!dragSidebar) - $("body").classList.remove('resizing'); - }, 1) - - $("#rcnt").addEventListener('mousedown', function(e) { - var start = e.offsetX; - - if( ires.getBoundingClientRect().right > e.offsetX ) - return; - - - dragSidebar = true; - - - - document.body.addEventListener('mousemove', function(e) { - e.preventDefault(); - }, 1) - document.body.addEventListener('mouseup', dragSidebarOnMouseUp, 1) - - - $("#rez .show").contentWindow.addEventListener('mouseup', dragSidebarOnMouseUp, 1) - - - - }, 1); - - function dragSidebarOnMouseUp(e) { - - - this.removeEventListener('mousemove', 1); - - this.removeEventListener('mouseup', 1); - - if (dragSidebar) { - - dragSidebar = false; - - var newLinkWidth = e.pageX + (this == document.body ? 0 : $("#rez .show").getBoundingClientRect().left); - - $("#ires").style['max-width'] = newLinkWidth + 'px'; - - localStorage["linkwidth"] = newLinkWidth; - - positionRez() - } - } - - - - - - //FIRST LOAD - - - //load first result link in iframe - window.firstLink = setInterval(function() { - if (document.querySelectorAll(".srg .g")[0]) - clearInterval(window.firstLink); - - document.querySelectorAll(".srg .g")[0].dispatchEvent(new Event('click', { 'bubbles': true })); - }, 200) - - - //preload frames for background cache - setTimeout(function() { - - return; //off - - - var gs = $(".srg .g"); - - for (var i = 1; i < 4; i++) { - - //set preloadid token into .g link for later recall - var url = gs[i].querySelector('h3 a, a').href; - - if (url.indexOf('youtube.com') == -1) { - - gs[i].querySelectorAll('a')[0].dataset.preload = preloadId = "i" + ($("#rez").childNodes.length - 1 + i); - - - - xhrFrame(url, preloadId, function(rFrame) { - - // rFrame.style.opacity = 0; - // rFrame.style.visibility="visible"; - - - //apply scripts to target frame, useful in pre-cache for scroll position - onFrameShow(); - - }) - - - } - - - - - } - - - }, 7000) - - - //listeners - window.addEventListener("resize", positionRez, 1) - window.addEventListener("scroll", positionRez, 1) - positionRez() - setTimeout(positionRez, 1000) //after new dom elements are loaded - -}) //end dom loaded diff --git a/hits/hits-api.js b/hits/hits-api.js deleted file mode 100644 index eca5597..0000000 --- a/hits/hits-api.js +++ /dev/null @@ -1,40 +0,0 @@ - - -//listen for tab navigation changes, record opener tab id -//chrome.webNavigation - -chrome.webRequest.onBeforeSendHeaders.addListener(function(req) { - - - console.log(req.tabId) - - if (req.tabId < 1) return {}; - - chrome.tabs.get(req.tabId, function(tab) { - - console.log(tab.url) - console.log(tab.openerTabId) - - - - - }) - - - - - -}, { urls: [""] }, [ 'requestHeaders']); - - - -//record how long on each site -chrome.tabs.onActivated.addListener(function(info){ - - - console.log(Date.now() + " " + info.tabId) - - -}) - - diff --git a/libs/jqcloud-1.0.4.min.js b/libs/jqcloud-1.0.4.min.js deleted file mode 100644 index 960a429..0000000 --- a/libs/jqcloud-1.0.4.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * jQCloud Plugin for jQuery - * - * Version 1.0.4 - * - * Copyright 2011, Luca Ongaro - * Licensed under the MIT license. - * - * Date: 2013-05-09 18:54:22 +0200 -*/ -(function(e){"use strict";e.fn.jQCloud=function(t,n){var r=this,i=r.attr("id")||Math.floor(Math.random()*1e6).toString(36),s={width:r.width(),height:r.height(),center:{x:(n&&n.width?n.width:r.width())/2,y:(n&&n.height?n.height:r.height())/2},delayedMode:t.length>50,shape:!1,encodeURI:!0,removeOverflowing:!0};n=e.extend(s,n||{}),r.addClass("jqcloud").width(n.width).height(n.height),r.css("position")==="static"&&r.css("position","relative");var o=function(){var s=function(e,t){var n=function(e,t){return Math.abs(2*e.offsetLeft+e.offsetWidth-2*t.offsetLeft-t.offsetWidth)t.weight?-1:0});var u=n.shape==="rectangular"?18:2,a=[],f=n.width/n.height,l=function(o,l){var c=i+"_word_"+o,h="#"+c,p=6.28*Math.random(),d=0,v=0,m=0,g=5,y="",b="",w;l.html=e.extend(l.html,{id:c}),l.html&&l.html["class"]&&(y=l.html["class"],delete l.html["class"]),t[0].weight>t[t.length-1].weight&&(g=Math.round((l.weight-t[t.length-1].weight)/(t[0].weight-t[t.length-1].weight)*9)+1),w=e("").attr(l.html).addClass("w"+g+" "+y),l.link?(typeof l.link=="string"&&(l.link={href:l.link}),n.encodeURI&&(l.link=e.extend(l.link,{href:encodeURI(l.link.href).replace(/'/g,"%27")})),b=e("").attr(l.link).text(l.text)):b=l.text,w.append(b);if(!!l.handlers)for(var E in l.handlers)l.handlers.hasOwnProperty(E)&&typeof l.handlers[E]=="function"&&e(w).bind(E,l.handlers[E]);r.append(w);var S=w.width(),x=w.height(),T=n.center.x-S/2,N=n.center.y-x/2,C=w[0].style;C.position="absolute",C.left=T+"px",C.top=N+"px";while(s(w[0],a)){if(n.shape==="rectangular"){v++,v*u>(1+Math.floor(m/2))*u*(m%4%2===0?1:f)&&(v=0,m++);switch(m%4){case 1:T+=u*f+Math.random()*2;break;case 2:N-=u+Math.random()*2;break;case 3:T-=u*f+Math.random()*2;break;case 0:N+=u+Math.random()*2}}else d+=u,p+=(o%2===0?1:-1)*u,T=n.center.x-S/2+d*Math.cos(p)*f,N=n.center.y+d*Math.sin(p)-x/2;C.left=T+"px",C.top=N+"px"}if(n.removeOverflowing&&(T<0||N<0||T+S>n.width||N+x>n.height)){w.remove();return}a.push(w[0]),e.isFunction(l.afterWordRender)&&l.afterWordRender.call(w)},c=function(i){i=i||0;if(!r.is(":visible")){setTimeout(function(){c(i)},10);return}i=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0, -r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;d0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K); -if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" + + diff --git a/src/pages/options/index.ts b/src/pages/options/index.ts new file mode 100644 index 0000000..f3079a4 --- /dev/null +++ b/src/pages/options/index.ts @@ -0,0 +1,2 @@ + +console.log(1) \ No newline at end of file diff --git a/src/pages/popup/index.html b/src/pages/popup/index.html new file mode 100644 index 0000000..f27a896 --- /dev/null +++ b/src/pages/popup/index.html @@ -0,0 +1,11 @@ + + + + + Popup + + +
+ + + diff --git a/src/pages/popup/index.ts b/src/pages/popup/index.ts new file mode 100644 index 0000000..11aa12e --- /dev/null +++ b/src/pages/popup/index.ts @@ -0,0 +1,10 @@ +import Main from '../../../cite/Main.svelte'; + +function restoreMain() { + const app = new Main({ + target: document.body, + props: { context: 'popup' }, + }); +} + +document.addEventListener('DOMContentLoaded', restoreMain); diff --git a/src/pages/sidepanel/index.html b/src/pages/sidepanel/index.html new file mode 100644 index 0000000..7ce4ab4 --- /dev/null +++ b/src/pages/sidepanel/index.html @@ -0,0 +1,11 @@ + + + + + Sidepanel + + +
+ + + diff --git a/src/pages/sidepanel/index.ts b/src/pages/sidepanel/index.ts new file mode 100644 index 0000000..02fc87b --- /dev/null +++ b/src/pages/sidepanel/index.ts @@ -0,0 +1,10 @@ +import Main from '../../tabsearch/Main.svelte'; + +function restoreMain() { + const app = new Main({ + target: document.body, + props: { context: 'popup' }, + }); +} + +document.addEventListener('DOMContentLoaded', restoreMain); diff --git a/src/tabsearch/Main.svelte b/src/tabsearch/Main.svelte new file mode 100644 index 0000000..8792a28 --- /dev/null +++ b/src/tabsearch/Main.svelte @@ -0,0 +1,247 @@ + + +
+ +
+ {#each results as result} + + {:else} +
{tabMessage}
+ {/each} +
+
+ + diff --git a/src/tabsearch/Result.svelte b/src/tabsearch/Result.svelte new file mode 100644 index 0000000..02ccfa6 --- /dev/null +++ b/src/tabsearch/Result.svelte @@ -0,0 +1,60 @@ + + + +
+
{@html dispString}
+
+ + diff --git a/svelte.config.js b/svelte.config.js new file mode 100644 index 0000000..9a3adfb --- /dev/null +++ b/svelte.config.js @@ -0,0 +1,7 @@ +import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; + +export default { + // Consult https://svelte.dev/docs#compile-time-svelte-preprocess + // for more information about preprocessors + preprocess: vitePreprocess(), +}; diff --git a/swag/swag-api.js b/swag/swag-api.js deleted file mode 100644 index 00334d2..0000000 --- a/swag/swag-api.js +++ /dev/null @@ -1,32 +0,0 @@ - - -chrome.runtime.onMessage.addListener(function(request, sender, callback) { - - - if (request.action == "swag-stop") - swag.stop(); - - if (request.action == "swag") - swag.start().onRight = function() { - - // 2s delay between swags - if (Date.now() - (window.lastSwagTime || 0) < 2000) - return; - - - chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) { - - if (tabs[0].url.indexOf("google.com") > -1) - chrome.tabs.executeScript(tabs[0].id, { code: "navNext()" }); - else { //nav thru tabs - - - - } - }) - - //save for later - window.lastSwagTime = Date.now(); - } - -}); diff --git a/swag/swag.js b/swag/swag.js deleted file mode 100644 index 59092ce..0000000 --- a/swag/swag.js +++ /dev/null @@ -1,268 +0,0 @@ - -var swag = { - visible: 1, //debugger show the motion cam on page - sensitivity: 50, //value from 0 to 100% sensitive - filteredTotal: 0, //number of changed pixel after filtering - minTotalChange: 400, //300 //minimum total number of pixels that need to change, before we decide that a gesture is happening - minDirChange: 6, //minimum number of pixels that need to change to assert a directional change - state: 0, //States: 0 waiting for gesture, 1 waiting for next move after gesture, 2 waiting for gesture to end - - stream: 0, - video: 0, - context: 0, - priorFrame: false, - priorGesture: {}, - onRight: null, - onLeft: null -} - - - -swag.start = function() { - - - //init - var sdiv = document.createElement("div"); - - sdiv.innerHTML = '
' + - '
' - - if (swag.visible) - document.body.appendChild(sdiv) - - - swag.video = sdiv.querySelector("video"); - - // alert(swag.video) - - swag.context = sdiv.querySelector("#out").getContext('2d'); - - - - - if (!navigator.webkitGetUserMedia) //firefox - navigator.webkitGetUserMedia = navigator.mozGetUserMedia; - - navigator.webkitGetUserMedia({video: 1}, function(stream) { - - swag.stream = stream; - - swag.video.src = window.URL.createObjectURL(stream); - - swag.video.play(); - - setInterval(swag.process, 40); //fps - - }, function() {}); - - return this -}; - -swag.stop = function() { - // debugger - swag.stream.getTracks()[0].stop(); -}; - -swag.process = function() { - - var video = swag.video, - context = swag.context, - priorFrame = swag.priorFrame, - minDirChange = swag.minDirChange, - width = video.width, - height = video.height; - - swag.context.drawImage(video, 0, 0, width, height); - - var currentFrame = context.getImageData(0, 0, width, height); - - skinFilter.apply(currentFrame) - - - - //calculate the difference map - - var delt = context.createImageData(width, height), - totalx = 0, - totaly = 0, - totald = 0; //total number of changed pixels - - if (!priorFrame) { - swag.priorFrame = currentFrame; - return; - } - - var totaln = delt.width * delt.height, - pix = totaln * 4, - maxAssessableColorChange = 256 * 3; - - while ((pix -= 4) >= 0) { - //find the total change in color for this pixel-set - var d = Math.abs(currentFrame.data[pix] - priorFrame.data[pix]) + - Math.abs(currentFrame.data[pix + 1] - priorFrame.data[pix + 1]) + - Math.abs(currentFrame.data[pix + 2] - priorFrame.data[pix + 2]); //don't do [pix+3] because alpha doesn't change - - if (d > maxAssessableColorChange * Math.abs((swag.sensitivity - 100) / 100)) { - - //if there has been significant change in color, mark the changed pixel - delt.data[pix] = 0; //R - delt.data[pix + 1] = 0; //G - delt.data[pix + 2] = d / 3; //B - delt.data[pix + 3] = 255; //alpha - totald += 1; - totalx += ((pix / 4) % delt.width); - totaly += (Math.floor((pix / 4) / delt.height)); - } else { - - //otherwise keep it the same color - delt.data[pix] = currentFrame.data[pix]; - delt.data[pix + 1] = currentFrame.data[pix + 1]; - delt.data[pix + 2] = currentFrame.data[pix + 2]; - delt.data[pix + 3] = currentFrame.data[pix + 3]; //change to 0 to hide user video - } - } - - - //draw the diff - swag.context.putImageData(delt, 0, 0); - - var movement = { - x: totalx / totald, - y: totaly / totald, - d: totald //delta (or total change) - }; - var filteringFactor = 0.9; - - //filtering - swag.filteredTotal = (filteringFactor * swag.filteredTotal) + ((1 - filteringFactor) * movement.d); - - var dfilteredTotal = movement.d - swag.filteredTotal, - good = dfilteredTotal > swag.minTotalChange; //check that total pixel change is grater than threshold - - //console.log(good, dfilteredTotal); - if (swag.state == 0) { - if (good) { - //found a gesture, waiting for next move - swag.state = 1; - swag.priorGesture = movement; - } - - } else if (swag.state == 1) { - //got next move, do something based on direction - swag.state = 2; - - var dx = movement.x - swag.priorGesture.x, - dy = movement.y - swag.priorGesture.y, - - dirx = Math.abs(dy) < Math.abs(dx); //(dx,dy) is on a bowtie - - //console.log(dirx, dx, dy); - if (dx < -minDirChange && dirx) - if (swag.onRight) swag.onRight() - else if (dx > minDirChange && dirx) - if (swag.onLeft) swag.onLeft() - - - } else if (swag.state == 2) { - //wait for gesture to end - if (!good) { - swag.state = 0; //gesture ended - } - - } - - - - swag.priorFrame = currentFrame; -} - - - -skinFilter = { - huemin: 0.0, - huemax: 0.1, - satmin: 0.3, - satmax: 1.0, - valmin: 0.4, - valmax: 1.0, - rgb2hsv: function (r, g, b){ - r = r / 255; - g = g / 255; - b = b / 255; - - var max = Math.max(r, g, b), - min = Math.min(r, g, b), - - h, s, v = max, - - d = max - min; - - if (max === 0) { - s = 0; - } else { - s = d/max; - } - - if (max == min) { - h = 0; // achromatic - } else { - switch(max){ - case r: - h = (g - b) / d + (g < b ? 6 : 0); - break; - case g: - h = (b - r) / d + 2; - break; - case b: - h = (r - g) / d + 4; - break; - default: - break; - } - h /= 6; - } - - return [h, s, v]; - }, - apply: function(currentFrame) { - var totalPix = currentFrame.width * currentFrame.height, - indexValue = totalPix * 4, - countDataBigAry = 0; - - for (var y = 0; y < currentFrame.height; y++) - { - for (var x = 0 ; x < currentFrame.width ; x++) - { - indexValue = x + y * currentFrame.width; - var r = currentFrame.data[countDataBigAry], - g = currentFrame.data[countDataBigAry+1], - b = currentFrame.data[countDataBigAry+2], - a = currentFrame.data[countDataBigAry+3], - - hsv = this.rgb2hsv(r,g,b); - - //when the hand is too close (hsv[0] > 0.59 && hsv[0] < 1.0) - //skin range on HSV values - if ( ( (hsv[0] > this.huemin && hsv[0] < this.huemax) || (hsv[0] > 0.59 && hsv[0] < 1.0) ) && (hsv[1] > this.satmin && hsv[1] < this.satmax) && (hsv[2] > this.valmin && hsv[2] < this.valmax) ) { - currentFrame[countDataBigAry] = r; - currentFrame[countDataBigAry+1] = g; - currentFrame[countDataBigAry+2] = b; - currentFrame[countDataBigAry+3] = a; - } else { - currentFrame.data[countDataBigAry] = 255; - currentFrame.data[countDataBigAry+1] = 255; - currentFrame.data[countDataBigAry+2] = 255; - currentFrame.data[countDataBigAry+3] = 0; - } - countDataBigAry = indexValue * 4; - } - } - return currentFrame; - } -} - - -// COMPARISON OF THREE COLOUR SPACES IN SKIN DETECTION (2009) -// http://wwwsst.ums.edu.my/data/file/Su7YcHiV9AK5.pdf -// https://github.com/hadimichael/gest.js -// Copyright (c) 2013, Hadi Michael (http://hadi.io) MIT LICENSE \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..c4628b9 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@tsconfig/svelte/tsconfig.json", + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "module": "ESNext", + "resolveJsonModule": true, + "allowJs": true, + "checkJs": true, + "isolatedModules": true + }, + "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte", "src-x/pages/sidepanel/index.ts"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..d2acd88 --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,10 @@ +// vite tsconfig +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler" + }, + "include": ["vite.config.ts", "src/manifest.config.ts", "package.json"] +} diff --git a/vast/googlevoice-content.js b/vast/googlevoice-content.js deleted file mode 100644 index c0495f3..0000000 --- a/vast/googlevoice-content.js +++ /dev/null @@ -1,14 +0,0 @@ -window.clickVoice = setInterval(function() { - - if (document.querySelector(".gsst_a")) { - - setTimeout(function(){ - document.querySelector(".gsst_a").dispatchEvent(new Event("click", { bubbles: true })); - },500) - - clearInterval(window.clickVoice); - document.title = "LISTENING"; - - } - - }, 1); diff --git a/vast/googlevoice.js b/vast/googlevoice.js deleted file mode 100644 index 4e80fde..0000000 --- a/vast/googlevoice.js +++ /dev/null @@ -1,21 +0,0 @@ -chrome.commands.onCommand.addListener(function(command) { - - chrome.windows.getCurrent(function(win) { - - chrome.windows.update(win.id, { focused: true, drawAttention: true }) - - }) - - - - chrome.tabs.create({ url: "https://www.google.com/?gws_rd=ssl" }, function(googleTab) { - - chrome.tabs.executeScript(googleTab.id, { - runAt: "document_end", - file: "vast/googlevoice-content.js" - }); - - }); - - -}); diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..beb21b5 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,25 @@ +import { crx } from "@crxjs/vite-plugin"; +import { svelte } from "@sveltejs/vite-plugin-svelte"; +import { defineConfig } from "vite"; +import manifest from "./src/manifest.config"; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [svelte(), crx({ manifest })], + // HACK: https://github.com/crxjs/chrome-extension-tools/issues/696 + // https://github.com/crxjs/chrome-extension-tools/issues/746 + server: { + port: 5173, + strictPort: true, + hmr: { + clientPort: 5173, + }, + }, + build: { + rollupOptions: { + input: { + sidepanel: 'src/pages/sidepanel/index.html' + } + } + } +}); diff --git a/word/word-api.js b/word/word-api.js deleted file mode 100644 index 2040312..0000000 --- a/word/word-api.js +++ /dev/null @@ -1,130 +0,0 @@ - - -chrome.contextMenus.create({ - "title" : "• Wiki Define • %s", - "id": "contextOKGO", - "contexts" : ["selection"], - "onclick" : contextClickOKGO -}); - - - -chrome.runtime.onMessage.addListener(function(request, sender, callback) { - - - if (request.action == "word-key") { - - chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) { - - contextClickOKGO(request, tabs[0]) - - callback(true) - - }) - - - } - - return false - -}) - - -function contextClickOKGO(info, tab) { - - var term = info.selectionText; - - - var xhr = new XMLHttpRequest(); - xhr.open('GET', "http://lookup.dbpedia.org/api/search.asmx/KeywordSearch?QueryString=" + term, true); - xhr.onload = function() { - - console.log(xhr.responseText) - var results = JSON.parse(xhr.responseText).results; - var bestResult = results[0] - for (var i in results) - if (results[i].label.toLowerCase() == term.toLowerCase()) - bestResult = results[i]; - - if (!bestResult) - bestResult = results[0]; - - - - - var uri_term = bestResult.uri && bestResult.uri.substring(bestResult.uri.lastIndexOf('/')) - - desc = bestResult.description + " "; - - chrome.tts.speak(desc, {voiceName: "Google UK English Male",'rate': 3.0}) - - chrome.tabs.executeScript(tab.id, {code: "window.worddefine = \"" + escape(desc) + "\";" }); - - chrome.tabs.executeScript(tab.id, { - file: "word/word-cardview.js" - }); - - chrome.tabs.insertCSS(tab.id, { - file: "word/word-style.css" - }); - - - - - }; - xhr.setRequestHeader('Accept', 'application/json'); - - xhr.send(); - - - - - -} - - - - - -//google kg - - - -/* - - var xhr = new XMLHttpRequest(); - xhr.onload = function() { - - - // alert( xhr.responseText) - - // alert(tab.id) - - - chrome.tabs.insertCSS(tab.id, { - file: "read/readingmode-style.css" - }); - - var desc = JSON.parse(xhr.responseText).itemListElement[0].result.detailedDescription.articleBody.replace(/\n/,''); - - // alert(JSON.stringify(desc)) - - - chrome.tabs.executeScript(tab.id, { - code: "if(window.define2) document.body.removeChild(define2);document.body.insertAdjacentHTML('beforeend','
"+desc+"
'); setTimeout(function(){define2.className=\"min\";},1); setTimeout(function(){define2.className=\"\";},6000) " - }); - - - }; - - xhr.open('GET', "https://kgsearch.googleapis.com/v1/entities:search?key=AIzaSyDgdM5CpdzE3dLHD877L8fB3PyxVpV7pY4&limit=1&query="+term , true); - - - xhr.send(); - */ - - - -// "window.okgo=" +JSON.strigify(xhr.responseText) + "; alert(JSON.stringify(okgo)) ; document.body.innerHTML += '
" + -// JSON.stringify(xhr.responseText) + "
" diff --git a/word/word-cardview.js b/word/word-cardview.js deleted file mode 100644 index f2344b7..0000000 --- a/word/word-cardview.js +++ /dev/null @@ -1,18 +0,0 @@ - if (window.word) document.body.removeChild(word); - if (window.hideWord) clearTimeout(window.hideWord) - - - document.body.insertAdjacentHTML('beforeend', '
' + unescape(window.worddefine) + '
'); - - - - setTimeout(function() { word.className = "min"; }, 1); - - window.hideWord = setTimeout(function() { word.className = ""; }, 7000) - - - word.onclick = function() { - window.open(this.querySelector("a").href) - - - } \ No newline at end of file diff --git a/word/word-content.js b/word/word-content.js deleted file mode 100644 index 6d64d97..0000000 --- a/word/word-content.js +++ /dev/null @@ -1,58 +0,0 @@ -//runs on every single webpage!! - -//WORD - -window.addEventListener("mouseup", function(e) { - - console.log(e) - - var i = e.target; - if (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i.textbox || (i.textContent && i.textContent=='') ) - return; - - - var s = e.view.window.getSelection() + ""; - - if (s.length < 50 && s.length > 2) - chrome.runtime.sendMessage({ action: 'word-key', selectionText: s }, function(res) {}) - - - -}, false); - - - -window.addEventListener("click", function(e) { - - if (!e.altKey) return; - - e.preventDefault(); - - t = e.target.textContent; //if word/phrase is in its own or etc - - if (t.length>50){ //get clicked single word - - s = e.view.window.getSelection(); - var range = s.getRangeAt(0); - var node = s.anchorNode; - while (range.toString().indexOf(' ') != 0) { - range.setStart(node, (range.startOffset - 1)); - } - range.setStart(node, range.startOffset + 1); - do { - range.setEnd(node, range.endOffset + 1); - - } while (range.toString().indexOf(' ') == -1 && range.toString().trim() != ''); - var t = range.toString().trim(); - - } - - - if (t.length < 50 && t.length > 2) - chrome.runtime.sendMessage({ action: 'word-key', selectionText: t }, function(res) {}) - - - s.collapseToStart(); - -}, 0); - diff --git a/word/word-style.css b/word/word-style.css deleted file mode 100644 index fbfd90f..0000000 --- a/word/word-style.css +++ /dev/null @@ -1,29 +0,0 @@ -#word { - text-align: left; - background: aliceblue; - box-shadow: 4px 4px 3px -3px gray; - color: rgb(48, 44, 34); - font-family: "Verdana", "Palatino Linotype", "Book Antiqua", serif !important; - font-size: 9pt; - background-color: rgb(248, 248, 248); - overflow: auto; - max-width: 400px; - position: fixed; - left: 10px; - bottom: 10px; - right: left; - z-index: 9999999999; - padding: 7px; - background: #fff; - border-radius: 2px; - box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); - transition: .5s; - line-height: 14pt; - transform: translateY(120%); - cursor: pointer; -} - -#word:hover, -#word.min { - transform: initial; -}