Commit 541b4869 authored by Ricardo J. Mendez's avatar Ricardo J. Mendez

Merge branch 'release/1.0.10'

parents e4b5d49f 9cf3c3c4
Pipeline #8577355 passed with stage
in 1 minute and 59 seconds
......@@ -6,7 +6,7 @@ It’ll create a natural arrangement where the tabs you have spent the longest o
[You can read more about it here](https://numergent.com/relevance/).
This is Relevance 1.0.9.
This is Relevance 1.0.10.
# Building
......@@ -68,4 +68,4 @@ I can't update the package version from `manifest.json` to include alphanumerics
Includes pixeden's [iOS 7 vector icons](http://themes-pixeden.com/font-demos/7-stroke/).
Relevance is (c) 2016 Numergent Limited, and released under the [MIT License](https://tldrlegal.com/license/mit-license).
\ No newline at end of file
Relevance is (c) 2016-2017 Numergent Limited, and released under the [MIT License](https://tldrlegal.com/license/mit-license).
\ No newline at end of file
(defproject relevance-chrome "1.0.9"
(defproject relevance-chrome "1.0.10"
:license {:name "MIT License"
:url "https://tldrlegal.com/license/mit-license"}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.293"]
[org.clojure/core.async "0.2.395"]
[org.clojure/clojurescript "1.9.542"]
[org.clojure/core.async "0.3.442"]
[com.cognitect/transit-cljs "0.8.239"]
[cljsjs/react-bootstrap "0.30.2-0"]
[cljsjs/react-bootstrap "0.30.7-0"]
[khroma "0.3.0"]
[prismatic/dommy "1.1.0"]
[re-frame "0.8.0" :exclusions [cljsjs/react]]]
[re-frame "0.9.3" :exclusions [cljsjs/react]]]
:source-paths ["src/ui" "src/common" "src/background" "src/content"]
:test-paths ["test"]
:plugins [[lein-cljsbuild "1.1.4"]
:plugins [[lein-cljsbuild "1.1.6"]
[org.clojars.ricardojmendez/lein-chromebuild "0.3.2"]
[lein-doo "0.1.7"]]
......
......@@ -11,7 +11,8 @@
<meta name="viewport" content="width=device-width"/>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Light Bootstrap Table core CSS -->
<link href="light-bootstrap-dashboard.css" rel="stylesheet"/>
......@@ -66,7 +67,7 @@
<footer class="footer">
<div class="container-fluid">
<p class="copyright pull-right">
&copy; 2015-2016 <a href="https://numergent.com" target="_blank">Numergent Limited</a>
&copy; 2015-2017 <a href="https://numergent.com" target="_blank">Numergent Limited</a>
</p>
</div>
</footer>
......
{
"name": "Relevance - Smart Tab Organizer",
"short_name": "Relevance",
"version": "1.0.9",
"version": "1.0.10",
"browser_action": {
"default_title": "Organize tabs",
"default_icon": {
......
......@@ -2,4 +2,5 @@
(def default-settings
{:ignore-set #{"localhost" "newtab" "t.co" "buff.ly"}
:sound-to-left? false})
\ No newline at end of file
:sound-to-left? false
:startpage? true})
\ No newline at end of file
(ns relevance.startpage
(:require [relevance.io :as io]
[relevance.settings :as settings]
[relevance.utils :refer [url-key time-display]]
[dommy.core :refer-macros [sel sel1] :as dommy]
[khroma.runtime :as runtime]
......@@ -20,7 +21,7 @@
id (url-key href)
data (get database id)
time (:time data)
root-item (-> parent .-parentNode .-parentNode .-parentNode) ; Yeah, hacky as fuck
root-item (-> parent .-parentNode .-parentNode .-parentNode) ; Yeah, hacky as fuck
]
(aset node "rootItem" root-item)
(aset root-item "total-time" time)
......@@ -32,7 +33,7 @@
(dommy/append! (create-node :span " " "rgb(80, 99, 152)"))
(dommy/append! (doto
(dommy/create-element :img)
(dommy/set-attr! :src "http://numergent.com/images/relevance/icon38.png")))
(dommy/set-attr! :src "https://numergent.com/images/relevance/icon38.png")))
(dommy/append! (create-node :span "[viewed: " "rgb(80, 99, 152)"))
(dommy/append! (create-node :span (time-display time) "rgb(140, 101, 153)"))
(dommy/append! (create-node :span "]" "rgb(80, 99, 152)"))
......@@ -41,23 +42,25 @@
(defn do-transformations! []
(go
(let [data (<! (io/load :data))
nodes (sel :.result_url_heading)
base (sel1 :.web_regular_results)]
(doseq [node nodes]
(transform-result-node! (:url-times data) node))
(doall
(->>
nodes
(map #(aget % "rootItem"))
(map-indexed #(do
;; We assign it (- %1) so that the first nodes get a higher value
(aset %2 "sort-order" (or (aget %2 "total-time") (- %1)))
%2))
(sort-by #(* -1 (aget % "sort-order")))
(map #(.appendChild base %))))
(when (:startpage? (or (<! (io/load :settings))
settings/default-settings))
(let [data (<! (io/load :data))
nodes (sel :.result_url_heading)
base (sel1 :.web_regular_results)]
(doseq [node nodes]
(transform-result-node! (:url-times data) node))
(doall
(->>
nodes
(map #(aget % "rootItem"))
(map-indexed #(do
;; We assign it (- %1) so that the first nodes get a higher value
(aset %2 "sort-order" (or (aget %2 "total-time") (- %1)))
%2))
(sort-by #(* -1 (aget % "sort-order")))
(map #(.appendChild base %))))
)))
))))
(defn ^:export main []
; (console/log "Init on content script!")
......@@ -65,7 +68,7 @@
(let [bg (runtime/connect)]
(go
(>! bg :content-initialized)
#_ (console/log "<-- Background replied" (<! bg))
#_(console/log "<-- Background replied" (<! bg))
)))
(main)
......@@ -42,10 +42,6 @@
;;;; Functions
;;;;----------------------------
(defn dispatch-on-press-enter [e d]
(if (= 13 (.-which e))
(dispatch d)))
(defn filter-tabs
"Filters out the tabs we will not show or manipulate, for instance, chrome extensions"
......@@ -101,7 +97,9 @@
(fn [app-state [_ settings]]
(let [ignore-set (utils/to-string-set (:ignore-set settings))]
(dispatch [:settings-set {:ignore-set ignore-set
:sound-to-left? (:sound-to-left? settings)} true])
:sound-to-left? (:sound-to-left? settings)
:startpage? (:startpage? settings)} true
])
app-state)))
......@@ -330,8 +328,8 @@
[:div {:class "page-header col-sm-10 col-sm-offset-1"}
[:h1 "Welcome!"]]
[:div {:class "col-sm-10 col-sm-offset-1"}
[:h2 "Thanks for installing Relevance 1.0.9"]
[:p [:a {:href "http://numergent.com/relevance/" :target "_blank"} "You can read about the latest changes here."]]
[:h2 "Thanks for installing Relevance 1.0.10"]
[:p [:a {:href "https://numergent.com/relevance/" :target "_blank"} "You can read about the latest changes here."]]
[:p "Relevance will help you sort your tabs when you have too many of them open. Here's how to use it:"]
[:ul
[:li "Use Chrome as you normally would. Relevance will privately track your reading habits."]
......@@ -365,7 +363,7 @@
[:a {:href "https://twitter.com/intent/tweet?text=Hey%20@argesric%20about%20&hashtags=relevance" :target "_blank"}
"please reach out on Twitter"]
" or "
[:a {:href "http://numergent.com/#contact"} "through our site"]
[:a {:href "https://numergent.com/#contact"} "through our site"]
"."]]
[:div {:class "col-sm-10 col-sm-offset-1"}
[:h2 "Experimental StartPage integration"]
......@@ -373,7 +371,10 @@
[:p "This version of Relevance has an experimental integration with "
[:a {:href "https://startpage.com" :target "_blank"} "StartPage"]
". After you run a search, it'll look at the results on your current page and re-prioritize the links shown to bring to the front those you have spent the longest reading."]
[:p "Every search engine behaves differently, so if there's enough interest, I could extend this integration to others as well."]]])
[:p "StartPage integration is on by default for historical reasons, but I may remove it in the future. "
"You can toggle it from the " [:a {:on-click #(dispatch [:app-state-item [:ui-state :section] :settings])}
"settings section"] "."]
]])
......@@ -414,8 +415,10 @@
(defn div-settings []
(let [ignore-set (subscribe [:settings :ignore-set])
sound-to-left? (subscribe [:settings :sound-to-left?])
startpage? (subscribe [:settings :startpage?])
our-ignore (reagent/atom (string/join "\n" (sort @ignore-set)))
our-sound (reagent/atom @sound-to-left?)]
our-sound (reagent/atom @sound-to-left?)
our-startpage (reagent/atom @startpage?)]
(fn []
[:div {:class "col-sm-12"}
[:div {:class "row"}
......@@ -441,11 +444,23 @@
"If selected, tabs with sound will be prioritized, and moved to the left when sorting."]]
[:div {:class "col-sm-6"}]]
[:div {:class "row"}
[:div {:class "col-sm-12"}
[:h3 "Enable StartPage result ordering?"]]
[:div {:class "col-sm-6"}
[:p
[:input {:type :checkbox
:checked @our-startpage
:on-change #(reset! our-startpage (-> % .-target .-checked))
:style {:margin-right "4px"}}]
"If selected, results on StartPage will be sorted prioritizing those you have visited the most."]]
[:div {:class "col-sm-6"}]]
[:div {:class "row"}
[:div {:class "col-sm-12"}
[:a {:class "btn btn-danger btn-sm"
:on-click #(dispatch [:settings-parse {:ignore-set @our-ignore
:sound-to-left? @our-sound}])} "Save settings"]]]])))
:sound-to-left? @our-sound
:startpage? @our-startpage}])} "Save settings"]]]])))
......
This diff is collapsed.
......@@ -34,8 +34,8 @@
-314744948 "https://www.google.com"
-314744948 "https://www.google.com/#hash"
-596725840 "https://www.google.com/somePath?q=v"
-327774960 "http://numergent.com/tags/khroma/"
-526558523 "http://numergent.com/opensource/"
-327774960 "https://numergent.com/tags/khroma/"
-526558523 "https://numergent.com/opensource/"
93819220 "about:blank"
-847465478 "file:///Users/ricardo/Sources/user.html"
;; URL keys are port-sensitive
......@@ -86,9 +86,9 @@
"https://www.Google.com/some?q=v" "www.google.com"
"https://WWW.GOOGLE.COM/some?q=v" "www.google.com"
"http://WWW.GOOGLE.COM/some?q=v" "www.google.com"
"https://GOOGLE.COM:443/some?q=v" "google.com" ; host would have included the port
"https://GOOGLE.COM:3000/some?q=v" "google.com" ; host would have included the port
"http://numergent.com/tag/khroma" "numergent.com"
"https://GOOGLE.COM:443/some?q=v" "google.com" ; host would have included the port
"https://GOOGLE.COM:3000/some?q=v" "google.com" ; host would have included the port
"https://numergent.com/tag/khroma" "numergent.com"
"about:blank" ""
"chrome://extensions/?id=okhigbflgnbihoiokilagelkalkcigfp" "extensions"
"chrome-extension://okhigbflgnbihoiokilagelkalkcigfp/index.html" "okhigbflgnbihoiokilagelkalkcigfp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment