diff --git a/assets/css/app.css b/assets/css/app.css index db65eef..2878f77 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -317,6 +317,20 @@ a.btn-red:hover, background: #357ae8; } +/* icons */ +article[data-item-status="read"] .read-icon:before { + content: "✔"; +} + +article[data-item-bookmark="1"] .bookmark-icon:before { + content: "★"; +} + +/* not bookmarked icon only in article view */ +article[data-item-bookmark="0"] .item-infos .bookmark-icon:before { + content: "☆"; +} + /* counter brackets */ span#nav-counter:not(:empty):before, span#page-counter:not(:empty):before { content: " ("; @@ -472,7 +486,7 @@ nav .active a { color: #555; } -.items a.read { +.items article[data-item-status="read"] h2 a { color: #666; } diff --git a/assets/js/all.min.js b/assets/js/all.min.js index 4662a4a..eb500b5 100644 --- a/assets/js/all.min.js +++ b/assets/js/all.min.js @@ -1,22 +1,21 @@ -var Miniflux={};Miniflux.App=function(){return{BlinkIcon:function(){var d=document.querySelectorAll(".loading-icon");[].forEach.call(d,function(b){b.classList.toggle("loading-icon-blink")})},Run:function(){Miniflux.Event.ListenKeyboardEvents();Miniflux.Event.ListenMouseEvents()}}}(); -Miniflux.Feed=function(){function d(a){if(a=document.getElementById("loading-feed-"+a))a.appendChild(document.createTextNode("\u2600")),a.classList.add("loading-icon-blink");f||(f=setInterval(Miniflux.App.BlinkIcon,500))}function b(){for(var b=document.getElementsByTagName("a"),c=0,d=b.length;cc.length;){var b=a.shift();c.push(b);Miniflux.Feed.Update(b, -function(b){b=c.indexOf(b.feed_id);0<=b&&c.splice(b,1);0==a.length&&0==c.length&&(clearInterval(d),clearInterval(f),window.location.href="?action=unread")})}},100)}}}(); -Miniflux.Item=function(){function d(e){var a=document.getElementById("item-"+e);a||(a=document.getElementById("current-item"),a.getAttribute("data-item-id")!=e&&(a=!1));return a}function b(e){if(e&&e.getAttribute("data-reverse-label")){var a=e.innerHTML;e.innerHTML=e.getAttribute("data-reverse-label");e.setAttribute("data-reverse-label",a)}}function a(e){e=document.getElementById("bookmark-"+e);b(e)}function c(e){e=document.getElementById("status-"+e);b(e)}function f(e){"mouse"!=Miniflux.Event.lastEventType&& -Miniflux.Nav.SelectNextItem();e.parentNode.removeChild(e);var a=document.getElementById("page-counter");if(a){e=e.getAttribute("data-item-page");var b=parseInt(a.textContent,10)-1,c=document.getElementsByTagName("article");if(0===b||0===c.length)window.location=location.href;a.textContent=b;switch(e){case "unread":document.title="Miniflux ("+b+")";document.getElementById("nav-counter").textContent=b;break;case "feed-items":document.title="("+b+") "+a.parentNode.firstChild.nodeValue;break;default:document.title= -a.parentNode.firstChild.nodeValue+" ("+b+")"}}}function g(e){var a=new XMLHttpRequest;a.onload=function(){if(Miniflux.Nav.IsListing()){var a=d(e);if(a)if(a.getAttribute("data-hide"))f(a);else{a.setAttribute("data-item-status","read");c(e);if(a=document.getElementById("show-"+e)){a.className="read";var b=document.createElement("span");b.id="read-icon-"+e;b.appendChild(document.createTextNode("\u2714 "));a.parentNode.insertBefore(b,a)}(a=document.getElementById("status-"+e))&&a.setAttribute("data-action", -"mark-unread")}}};a.open("POST","?action=mark-item-read&id="+e,!0);a.send()}function m(a){var b=new XMLHttpRequest;b.onload=function(){if(Miniflux.Nav.IsListing()){var b=d(a);if(b)if(b.getAttribute("data-hide"))f(b);else{b.setAttribute("data-item-status","unread");c(a);if(b=document.getElementById("show-"+a))b.className="";(b=document.getElementById("read-icon-"+a))&&b.parentNode.removeChild(b);(b=document.getElementById("status-"+a))&&b.setAttribute("data-action","mark-read")}}};b.open("POST","?action=mark-item-unread&id="+ -a,!0);b.send()}function n(b,c){var d=b.getAttribute("data-item-id"),h=new XMLHttpRequest;h.onload=function(){try{if(JSON.parse(this.responseText).result)if(b.setAttribute("data-item-bookmark",c),c)if(Miniflux.Nav.IsListing()){if(f=document.getElementById("show-"+d)){var h=document.createElement("span");h.id="bookmark-icon-"+d;h.appendChild(document.createTextNode("\u2605 "));f.parentNode.insertBefore(h,f)}a(d)}else{var f=document.getElementById("bookmark-"+d);f&&(f.innerHTML="\u2605")}else if(Miniflux.Nav.IsListing()){var l= -document.getElementById("bookmark-icon-"+d);l&&l.parentNode.removeChild(l);a(d)}else{var q=document.getElementById("bookmark-"+d);q&&(q.innerHTML="\u2606")}}catch(g){}};h.open("POST","?action=bookmark&id="+d+"&value="+c,!0);h.send()}return{Get:d,MarkAsRead:g,MarkAsUnread:m,MarkAsRemoved:function(a){var b=new XMLHttpRequest;b.onload=function(){Miniflux.Nav.IsListing()&&f(d(a))};b.open("POST","?action=mark-item-removed&id="+a,!0);b.send()},SwitchBookmark:function(a){"1"==a.getAttribute("data-item-bookmark")? -n(a,0):n(a,1)},SwitchStatus:function(a){var b=a.getAttribute("data-item-id");a=a.getAttribute("data-item-status");"read"==a?m(b):"unread"==a&&g(b)},Show:function(a){(a=document.getElementById("show-"+a))&&a.click()},OpenOriginal:function(a){var b=document.getElementById("original-"+a);b&&("unread"==d(a).getAttribute("data-item-status")&&g(a),b.removeAttribute("data-action"),b.click())},DownloadContent:function(){var a=document.getElementById("download-item");if(a){var b=a.getAttribute("data-item-id"), -c=a.getAttribute("data-before-message"),d=document.createElement("span");d.appendChild(document.createTextNode("\u2600"));d.className="loading-icon";a.innerHTML="";a.className="downloading";a.appendChild(d);a.appendChild(document.createTextNode(" "+c));var f=setInterval(Miniflux.App.BlinkIcon,250),g=new XMLHttpRequest;g.onload=function(){var b=JSON.parse(g.responseText);clearInterval(f);if(b.result){var c=document.getElementById("item-content");c&&(c.innerHTML=b.content);a&&(b=a.getAttribute("data-after-message"), -a.innerHTML="",a.appendChild(document.createTextNode(" "+b)))}else a&&(b=a.getAttribute("data-failure-message"),a.innerHTML="",a.appendChild(document.createTextNode(" "+b)))};g.open("POST","?action=download-item&id="+b,!0);g.send()}},MarkListingAsRead:function(a){for(var b=document.getElementsByTagName("article"),c=[],d=0,f=b.length;dd.length;){var b=a.shift();d.push(b);Miniflux.Feed.Update(b, +function(c){c=d.indexOf(c.feed_id);0<=c&&d.splice(c,1);0==a.length&&0==d.length&&(clearInterval(e),clearInterval(f),window.location.href="?action=unread")})}},100)}}}(); +Miniflux.Item=function(){function e(c){var a=document.getElementById("item-"+c);a||(a=document.getElementById("current-item"),a.getAttribute("data-item-id")!=c&&(a=!1));return a}function b(c){if(c&&c.getAttribute("data-reverse-label")){var a=c.innerHTML;c.innerHTML=c.getAttribute("data-reverse-label");c.setAttribute("data-reverse-label",a)}}function a(c){c=document.getElementById("status-"+c);b(c)}function d(c){"mouse"!=Miniflux.Event.lastEventType&&Miniflux.Nav.SelectNextItem();c.parentNode.removeChild(c); +var a=document.getElementById("page-counter");if(a){c=c.getAttribute("data-item-page");var b=parseInt(a.textContent,10)-1,d=document.getElementsByTagName("article");if(0===b||0===d.length)window.location=location.href;a.textContent=b;switch(c){case "unread":document.title="Miniflux ("+b+")";document.getElementById("nav-counter").textContent=b;break;case "feed-items":document.title="("+b+") "+a.parentNode.firstChild.nodeValue;break;default:document.title=a.parentNode.firstChild.nodeValue+" ("+b+")"}}} +function f(c){var b=new XMLHttpRequest;b.onload=function(){if(Miniflux.Nav.IsListing()){var b=e(c);b&&(b.getAttribute("data-hide")?d(b):(b.setAttribute("data-item-status","read"),a(c),(link=document.getElementById("status-"+c))&&link.setAttribute("data-action","mark-unread")))}};b.open("POST","?action=mark-item-read&id="+c,!0);b.send()}function h(c){var b=new XMLHttpRequest;b.onload=function(){if(Miniflux.Nav.IsListing()){var b=e(c);b&&(b.getAttribute("data-hide")?d(b):(b.setAttribute("data-item-status", +"unread"),a(c),(link=document.getElementById("status-"+c))&&link.setAttribute("data-action","mark-read")))}};b.open("POST","?action=mark-item-unread&id="+c,!0);b.send()}function k(c,a){var d=c.getAttribute("data-item-id"),e=new XMLHttpRequest;e.onload=function(){try{if(JSON.parse(this.responseText).result&&(c.setAttribute("data-item-bookmark",a),Miniflux.Nav.IsListing())){var e=document.getElementById("bookmark-"+d);b(e)}}catch(f){}};e.open("POST","?action=bookmark&id="+d+"&value="+a,!0);e.send()} +return{Get:e,MarkAsRead:f,MarkAsUnread:h,MarkAsRemoved:function(c){var a=new XMLHttpRequest;a.onload=function(){Miniflux.Nav.IsListing()&&d(e(c))};a.open("POST","?action=mark-item-removed&id="+c,!0);a.send()},SwitchBookmark:function(c){"1"==c.getAttribute("data-item-bookmark")?k(c,0):k(c,1)},SwitchStatus:function(c){var a=c.getAttribute("data-item-id");c=c.getAttribute("data-item-status");"read"==c?h(a):"unread"==c&&f(a)},Show:function(a){(a=document.getElementById("show-"+a))&&a.click()},OpenOriginal:function(a){var b= +document.getElementById("original-"+a);b&&("unread"==e(a).getAttribute("data-item-status")&&f(a),b.removeAttribute("data-action"),b.click())},DownloadContent:function(){var a=document.getElementById("download-item");if(a){var b=a.getAttribute("data-item-id"),d=a.getAttribute("data-before-message"),e=document.createElement("span");e.appendChild(document.createTextNode("\u2600"));e.className="loading-icon";a.innerHTML="";a.className="downloading";a.appendChild(e);a.appendChild(document.createTextNode(" "+ +d));var f=setInterval(Miniflux.App.BlinkIcon,250),g=new XMLHttpRequest;g.onload=function(){var b=JSON.parse(g.responseText);clearInterval(f);if(b.result){var d=document.getElementById("item-content");d&&(d.innerHTML=b.content);a&&(b=a.getAttribute("data-after-message"),a.innerHTML="",a.appendChild(document.createTextNode(" "+b)))}else a&&(b=a.getAttribute("data-failure-message"),a.innerHTML="",a.appendChild(document.createTextNode(" "+b)))};g.open("POST","?action=download-item&id="+b,!0);g.send()}}, +MarkListingAsRead:function(a){for(var b=document.getElementsByTagName("article"),d=[],e=0,f=b.length;eb-(a.offsetTop+a.offsetHeight)||b-a.offsetTop>document.documentElement.clientHeight)&&window.scrollTo(0,a.offsetTop-10)}function b(){return document.getElementById("listing")?!0:!1}return{GetCurrentItem:function(){return document.getElementById("current-item")},GetCurrentItemId:function(){var a=Miniflux.Nav.GetCurrentItem();return a?a.getAttribute("data-item-id"):null},OpenNextPage:function(){var a=document.getElementById("next-page"); -a&&a.click()},OpenPreviousPage:function(){var a=document.getElementById("previous-page");a&&a.click()},SelectNextItem:function(){var a=document.getElementById("next-item");if(a)a.click();else if(b())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var c=0,f=a.length;cb-(a.offsetTop+a.offsetHeight)||b-a.offsetTop>document.documentElement.clientHeight)&&window.scrollTo(0,a.offsetTop-10)}function b(){return document.getElementById("listing")?!0:!1}return{GetCurrentItem:function(){return document.getElementById("current-item")},GetCurrentItemId:function(){var a=Miniflux.Nav.GetCurrentItem();return a?a.getAttribute("data-item-id"):null},OpenNextPage:function(){var a=document.getElementById("next-page"); +a&&a.click()},OpenPreviousPage:function(){var a=document.getElementById("previous-page");a&&a.click()},SelectNextItem:function(){var a=document.getElementById("next-item");if(a)a.click();else if(b())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var d=0,f=a.length;d >

> - ★ ' : '' ?> - ✔ ' : '' ?> + + >

diff --git a/templates/show_item.php b/templates/show_item.php index d4fc33f..085e12f 100644 --- a/templates/show_item.php +++ b/templates/show_item.php @@ -44,7 +44,7 @@ class="bookmark-icon" data-action="bookmark" data-item-id="" - >★ + > + >
  • diff --git a/themes/bootstrap-light/css/app.css b/themes/bootstrap-light/css/app.css index db4f8d2..70bc1e4 100644 --- a/themes/bootstrap-light/css/app.css +++ b/themes/bootstrap-light/css/app.css @@ -5283,6 +5283,15 @@ body > header > nav > ul li.hide-mobile { .item blockquote p { font-size: 15px; } +article[data-item-status="read"] .read-icon:before { + content: "✔"; +} +article[data-item-bookmark="1"] .bookmark-icon:before { + content: "★"; +} +article[data-item-bookmark="0"] .item-infos .bookmark-icon:before { + content: "☆"; +} article img { max-width: 100%; } diff --git a/themes/bootstrap-light/less/miniflux-base.less b/themes/bootstrap-light/less/miniflux-base.less index a07c396..2117cf4 100644 --- a/themes/bootstrap-light/less/miniflux-base.less +++ b/themes/bootstrap-light/less/miniflux-base.less @@ -193,6 +193,28 @@ body > header { .item h6 {font-size:12px} .item blockquote p {font-size: 15px;} +article { + &[data-item-status="read"] { + .read-icon:before { + content: "@{icon-read}"; + } + } + + &[data-item-bookmark="1"] { + .bookmark-icon:before { + content: "@{icon-bookmarked}"; + } + } + + &[data-item-bookmark="0"] { + .item-infos { + .bookmark-icon:before { + content: "@{icon-not-bookmarked}"; + } + } + } +} + article img { max-width: 100%; } diff --git a/themes/bootstrap-light/less/variables.less b/themes/bootstrap-light/less/variables.less index b996ae5..7f4e4ec 100644 --- a/themes/bootstrap-light/less/variables.less +++ b/themes/bootstrap-light/less/variables.less @@ -62,6 +62,9 @@ @icon-font-name: "glyphicons-halflings-regular"; @icon-bracket-open: "("; @icon-bracket-close: ")"; +@icon-read: "✔"; +@icon-bookmarked: "★"; +@icon-not-bookmarked: "☆"; // Components // ------------------------- diff --git a/themes/bootswatch-cyborg/css/app.css b/themes/bootswatch-cyborg/css/app.css index f0a9c80..9a40a0b 100644 --- a/themes/bootswatch-cyborg/css/app.css +++ b/themes/bootswatch-cyborg/css/app.css @@ -5283,6 +5283,15 @@ body > header > nav > ul li.hide-mobile { .item blockquote p { font-size: 15px; } +article[data-item-status="read"] .read-icon:before { + content: "✔"; +} +article[data-item-bookmark="1"] .bookmark-icon:before { + content: "★"; +} +article[data-item-bookmark="0"] .item-infos .bookmark-icon:before { + content: "☆"; +} article img { max-width: 100%; } diff --git a/themes/bootswatch-cyborg/less/miniflux-base.less b/themes/bootswatch-cyborg/less/miniflux-base.less index a07c396..2117cf4 100644 --- a/themes/bootswatch-cyborg/less/miniflux-base.less +++ b/themes/bootswatch-cyborg/less/miniflux-base.less @@ -193,6 +193,28 @@ body > header { .item h6 {font-size:12px} .item blockquote p {font-size: 15px;} +article { + &[data-item-status="read"] { + .read-icon:before { + content: "@{icon-read}"; + } + } + + &[data-item-bookmark="1"] { + .bookmark-icon:before { + content: "@{icon-bookmarked}"; + } + } + + &[data-item-bookmark="0"] { + .item-infos { + .bookmark-icon:before { + content: "@{icon-not-bookmarked}"; + } + } + } +} + article img { max-width: 100%; } diff --git a/themes/bootswatch-cyborg/less/variables.less b/themes/bootswatch-cyborg/less/variables.less index e3327ed..9bec3e6 100644 --- a/themes/bootswatch-cyborg/less/variables.less +++ b/themes/bootswatch-cyborg/less/variables.less @@ -62,6 +62,9 @@ @icon-font-name: "glyphicons-halflings-regular"; @icon-bracket-open: "("; @icon-bracket-close: ")"; +@icon-read: "✔"; +@icon-bookmarked: "★"; +@icon-not-bookmarked: "☆"; // Components // ------------------------- diff --git a/themes/hello/css/app.css b/themes/hello/css/app.css index b449505..3982a23 100755 --- a/themes/hello/css/app.css +++ b/themes/hello/css/app.css @@ -297,6 +297,11 @@ section.page { margin-bottom: 15px; margin-top: 15px; } +article[data-item-bookmark="1"] .bookmark-icon:before { + content: "★"; } +article[data-item-bookmark="0"] .bookmark-icon:before { + content: "☆"; } + .items article { -moz-box-shadow: 0 3px 0 #006644; -webkit-box-shadow: 0 3px 0 #006644; @@ -306,6 +311,8 @@ section.page { padding: 10px 20px; } .items article[data-item-status="read"][data-item-page="feed-items"] { background-color: rgba(153, 153, 153, 0.7); } + .items article[data-item-status="read"] .read-icon:before { + content: "✔"; } .items article[data-item-bookmark="1"] .item-menu a[id*="bookmark-"]:before { content: "\f088"; } .items article[data-item-bookmark="0"] .item-menu a[id*="bookmark-"]:before { diff --git a/themes/hello/scss/_common.scss b/themes/hello/scss/_common.scss index b488650..f12e5f9 100755 --- a/themes/hello/scss/_common.scss +++ b/themes/hello/scss/_common.scss @@ -35,3 +35,6 @@ $logo-basecolor: #339966; // Icons $icon-bracket-open: "("; $icon-bracket-close: ")"; +$icon-read: "✔"; +$icon-bookmarked: "★"; +$icon-not-bookmarked: "☆"; \ No newline at end of file diff --git a/themes/hello/scss/_items.scss b/themes/hello/scss/_items.scss index e76d4f0..68952fe 100755 --- a/themes/hello/scss/_items.scss +++ b/themes/hello/scss/_items.scss @@ -1,3 +1,17 @@ +article { + &[data-item-bookmark="1"] { + .bookmark-icon:before { + content: $icon-bookmarked; + } + } + + &[data-item-bookmark="0"] { + .bookmark-icon:before { + content: $icon-not-bookmarked; + } + } +} + .items { article { @@ -10,6 +24,10 @@ &[data-item-page="feed-items"] { background-color: rgba(lighten(black,60%), .7); } + + .read-icon:before { + content: $icon-read; + } } &[data-item-bookmark="1"] {