summaryrefslogtreecommitdiff
path: root/p
diff options
context:
space:
mode:
Diffstat (limited to 'p')
-rw-r--r--p/i/install.php13
-rw-r--r--p/scripts/main.js252
-rw-r--r--p/themes/Dark/freshrss.css48
-rw-r--r--p/themes/Dark/global.css35
-rw-r--r--p/themes/Flat/freshrss.css46
-rw-r--r--p/themes/Flat/global.css35
-rw-r--r--p/themes/Origine/freshrss.css42
-rw-r--r--p/themes/Origine/global.css35
8 files changed, 389 insertions, 117 deletions
diff --git a/p/i/install.php b/p/i/install.php
index 8002a45da..90ee0b8a9 100644
--- a/p/i/install.php
+++ b/p/i/install.php
@@ -44,8 +44,8 @@ UPDATE `%1$sfeed006` f
INNER JOIN `%1$scategory006` c ON f.category = c.id
SET f.category2 = c.id2;
-INSERT IGNORE INTO `%2$scategory` (name, color)
-SELECT name, color
+INSERT IGNORE INTO `%2$scategory` (name)
+SELECT name
FROM `%1$scategory006`
ORDER BY id2;
@@ -548,8 +548,9 @@ function checkStep0 () {
'all' => $language ? 'ok' : 'ko'
);
}
+
function checkStep1 () {
- $php = version_compare (PHP_VERSION, '5.2.0') >= 0;
+ $php = version_compare (PHP_VERSION, '5.2.1') >= 0;
$minz = file_exists (LIB_PATH . '/Minz');
$curl = extension_loaded ('curl');
$pdo = extension_loaded ('pdo_mysql');
@@ -721,7 +722,7 @@ function printStep1 () {
<?php if ($res['php'] == 'ok') { ?>
<p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('php_is_ok', PHP_VERSION); ?></p>
<?php } else { ?>
- <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('php_is_nok', PHP_VERSION, '5.1.0'); ?></p>
+ <p class="alert alert-error"><span class="alert-head"><?php echo _t ('damn'); ?></span> <?php echo _t ('php_is_nok', PHP_VERSION, '5.2.1'); ?></p>
<?php } ?>
<?php if ($res['minz'] == 'ok') { ?>
@@ -954,7 +955,7 @@ function printStep4 () {
<legend><?php echo _t ('version_update'); ?></legend>
<?php if (updateDatabase(false)) { ?>
- <p class="alert"><?php echo _t ('update_long'); ?></p>
+ <p class="alert alert-warn"><?php echo _t ('update_long'); ?></p>
<div class="form-group form-actions">
<div class="group-controls">
@@ -964,7 +965,7 @@ function printStep4 () {
</div>
<?php } else { ?>
- <p class="alert"><?php echo _t ('update_end'); ?></p>
+ <p class="alert alert-warn"><?php echo _t ('update_end'); ?></p>
<div class="form-group form-actions">
<div class="group-controls">
diff --git a/p/scripts/main.js b/p/scripts/main.js
index f0d2bbf7b..34042c945 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -20,6 +20,16 @@ function redirect(url, new_tab) {
}
}
+function needsScroll($elem) {
+ var $win = $(window),
+ winTop = $win.scrollTop(),
+ winHeight = $win.height(),
+ winBottom = winTop + winHeight,
+ elemTop = $elem.offset().top,
+ elemBottom = elemTop + $elem.outerHeight();
+ return (elemTop < winTop || elemBottom > winBottom) ? elemTop - (winHeight / 2) : 0;
+}
+
function str2int(str) {
if (str == '') {
return 0;
@@ -96,8 +106,10 @@ function incUnreadsFeed(article, feed_id, nb) {
return isCurrentView;
}
+var pending_feeds = [];
function mark_read(active, only_not_read) {
- if (active.length === 0 || (only_not_read === true && !active.hasClass("not_read"))) {
+ if (active.length === 0 ||
+ (only_not_read === true && !active.hasClass("not_read"))) {
return false;
}
@@ -106,6 +118,16 @@ function mark_read(active, only_not_read) {
return false;
}
+ var feed_url = active.find(".website>a").attr("href"),
+ feed_id = feed_url.substr(feed_url.lastIndexOf('f_')),
+ index_pending = pending_feeds.indexOf(feed_id);
+
+ if (index_pending !== -1) {
+ return false;
+ }
+
+ pending_feeds.push(feed_id);
+
$.ajax({
type: 'POST',
url: url,
@@ -122,9 +144,9 @@ function mark_read(active, only_not_read) {
}
$r.find('.icon').replaceWith(data.icon);
- var feed_url = active.find(".website>a").attr("href"),
- feed_id = feed_url.substr(feed_url.lastIndexOf('f_'));
incUnreadsFeed(active, feed_id, inc);
+
+ pending_feeds.splice(index_pending, 1);
});
}
@@ -138,6 +160,16 @@ function mark_favorite(active) {
return false;
}
+ var feed_url = active.find(".website>a").attr("href"),
+ feed_id = feed_url.substr(feed_url.lastIndexOf('f_')),
+ index_pending = pending_feeds.indexOf(feed_id);
+
+ if (index_pending !== -1) {
+ return false;
+ }
+
+ pending_feeds.push(feed_id);
+
$.ajax({
type: 'POST',
url: url,
@@ -168,16 +200,20 @@ function mark_favorite(active) {
elem.setAttribute('data-unread', numberFormat(feed_unreads + inc));
}
}
+
+ pending_feeds.splice(index_pending, 1);
});
}
function toggleContent(new_active, old_active) {
- old_active.removeClass("active").removeClass("current");
+ old_active.removeClass("active");
if (new_active.length === 0) {
return;
}
+ old_active.removeClass("current");
+
if (does_lazyload) {
new_active.find('img[data-original], iframe[data-original]').each(function () {
this.setAttribute('src', this.getAttribute('data-original'));
@@ -247,15 +283,111 @@ function next_entry() {
}
}
+function prev_feed() {
+ var active_feed = $("#aside_flux .feeds li.active");
+ if (active_feed.length > 0) {
+ active_feed.prev().find('a.feed').each(function(){this.click();});
+ } else {
+ last_feed();
+ }
+}
+
+function next_feed() {
+ var active_feed = $("#aside_flux .feeds li.active");
+ if (active_feed.length > 0) {
+ active_feed.next().find('a.feed').each(function(){this.click();});
+ } else {
+ first_feed();
+ }
+}
+
+function first_feed() {
+ var feed = $("#aside_flux .feeds.active li:first");
+ if (feed.length > 0) {
+ feed.find('a')[1].click();
+ }
+}
+
+function last_feed() {
+ var feed = $("#aside_flux .feeds.active li:last");
+ if (feed.length > 0) {
+ feed.find('a')[1].click();
+ }
+}
+
+function prev_category() {
+ var active_cat = $("#aside_flux .category.stick.active");
+
+ if (active_cat.length > 0) {
+ var prev_cat = active_cat.parent('li').prev().find('.category.stick a.btn');
+ if (prev_cat.length > 0) {
+ prev_cat[0].click();
+ }
+ } else {
+ last_category();
+ }
+ return;
+}
+
+function next_category() {
+ var active_cat = $("#aside_flux .category.stick.active");
+
+ if (active_cat.length > 0) {
+ var next_cat = active_cat.parent('li').next().find('.category.stick a.btn');
+ if (next_cat.length > 0) {
+ next_cat[0].click();
+ }
+ } else {
+ first_category();
+ }
+ return;
+}
+
+function first_category() {
+ var cat = $("#aside_flux .category.stick:first");
+ if (cat.length > 0) {
+ cat.find('a.btn')[0].click();
+ }
+}
+
+function last_category() {
+ var cat = $("#aside_flux .category.stick:last");
+ if (cat.length > 0) {
+ cat.find('a.btn')[0].click();
+ }
+}
+
function collapse_entry() {
isCollapsed = !isCollapsed;
$(".flux.current").toggleClass("active");
}
-function auto_share() {
+function auto_share(key) {
var share = $(".flux.current.active").find('.dropdown-target[id^="dropdown-share"]');
- if (share.length) {
+ var shares = share.siblings('.dropdown-menu').find('.item a');
+ if (typeof key === "undefined") {
+ if (!share.length) {
+ return;
+ }
+ // Display the share div
window.location.hash = share.attr('id');
+ // Force scrolling to the share div
+ var scroll = needsScroll(share.closest('.bottom'));
+ if (scroll !== 0) {
+ $('html,body').scrollTop(scroll);
+ }
+ // Force the key value if there is only one action, so we can trigger it automatically
+ if (shares.length === 1) {
+ key = 1;
+ } else {
+ return;
+ }
+ }
+ // Trigger selected share action and hide the share div
+ key = parseInt(key);
+ if (key <= shares.length) {
+ shares[key - 1].click();
+ share.siblings('.dropdown-menu').find('.dropdown-close a')[0].click();
}
}
@@ -390,12 +522,19 @@ function init_shortcuts() {
}, {
'disable_in_input': true
});
+ for(var i = 1; i < 10; i++){
+ shortcut.add(i.toString(), function (e) {
+ auto_share(String.fromCharCode(e.keyCode));
+ }, {
+ 'disable_in_input': true
+ });
+ }
- // Touches de navigation
+ // Touches de navigation pour les articles
shortcut.add(shortcuts.prev_entry, prev_entry, {
'disable_in_input': true
});
- shortcut.add("shift+" + shortcuts.prev_entry, function () {
+ shortcut.add(shortcuts.first_entry, function () {
var old_active = $(".flux.current"),
first = $(".flux:first");
@@ -408,7 +547,7 @@ function init_shortcuts() {
shortcut.add(shortcuts.next_entry, next_entry, {
'disable_in_input': true
});
- shortcut.add("shift+" + shortcuts.next_entry, function () {
+ shortcut.add(shortcuts.last_entry, function () {
var old_active = $(".flux.current"),
last = $(".flux:last");
@@ -418,8 +557,35 @@ function init_shortcuts() {
}, {
'disable_in_input': true
});
+ // Touches de navigation pour les flux
+ shortcut.add("shift+" + shortcuts.prev_entry, prev_feed, {
+ 'disable_in_input': true
+ });
+ shortcut.add("shift+" + shortcuts.next_entry, next_feed, {
+ 'disable_in_input': true
+ });
+ shortcut.add("shift+" + shortcuts.first_entry, first_feed, {
+ 'disable_in_input': true
+ });
+ shortcut.add("shift+" + shortcuts.last_entry, last_feed, {
+ 'disable_in_input': true
+ });
+ // Touches de navigation pour les categories
+ shortcut.add("alt+" + shortcuts.prev_entry, prev_category, {
+ 'disable_in_input': true
+ });
+ shortcut.add("alt+" + shortcuts.next_entry, next_category, {
+ 'disable_in_input': true
+ });
+ shortcut.add("alt+" + shortcuts.first_entry, first_category, {
+ 'disable_in_input': true
+ });
+ shortcut.add("alt+" + shortcuts.last_entry, last_category, {
+ 'disable_in_input': true
+ });
+
shortcut.add(shortcuts.go_website, function () {
- var url_website = $(".flux.active .link a").attr("href");
+ var url_website = $(".flux.current .link a").attr("href");
if (auto_mark_site) {
$(".flux.current").each(function () {
@@ -441,7 +607,7 @@ function init_shortcuts() {
function init_stream(divStream) {
divStream.on('click', '.flux_header', function (e) { //flux_header_toggle
- if ($(e.target).closest('.item.website > a').length > 0) {
+ if ($(e.target).closest('.item.website, .item.link').length > 0) {
return;
}
var old_active = $(".flux.current"),
@@ -468,7 +634,7 @@ function init_stream(divStream) {
return false;
});
- divStream.on('click', '.item.title>a', function (e) {
+ divStream.on('click', '.item.title > a', function (e) {
if (e.ctrlKey) {
return true; //Allow default control-click behaviour such as open in backround-tab
}
@@ -481,7 +647,7 @@ function init_stream(divStream) {
});
if (auto_mark_site) {
- divStream.on('click', '.flux .link a', function () {
+ divStream.on('click', '.flux .link > a', function () {
mark_read($(this).parent().parent().parent(), true);
});
}
@@ -512,37 +678,71 @@ function init_nav_entries() {
}
function init_actualize() {
+ var auto = false;
+
$("#actualize").click(function () {
$.getScript('./?c=javascript&a=actualize').done(function () {
+ if (auto && feed_count < 1) {
+ auto = false;
+ return;
+ }
+
updateFeeds();
});
return false;
});
- if(auto_actualize_feeds) {
- $.getScript('./?c=javascript&a=actualize').done(function () {
- updateFeeds();
- });
+ if (auto_actualize_feeds) {
+ auto = true;
+ $("#actualize").click();
}
}
+
+// <notification>
+var notification = null,
+ notification_interval = null,
+ notification_working = false;
+
+function openNotification(msg, status) {
+ if (notification_working === true) {
+ return false;
+ }
+
+ notification_working = true;
+
+ notification.removeClass();
+ notification.addClass(status);
+ notification.find(".msg").html(msg);
+ notification.fadeIn(300);
+
+ notification_interval = window.setInterval(closeNotification, 4000);
+}
+
function closeNotification() {
- $(".notification").fadeOut(600, function () {
- $(".notification").remove();
+ notification.fadeOut(600, function() {
+ notification.removeClass();
+ notification.addClass('closed');
+
+ window.clearInterval(notification_interval);
+ notification_working = false;
});
}
function init_notifications() {
- var notif = $(".notification");
- if (notif.length > 0) {
- window.setInterval(closeNotification, 4000);
+ notification = $("#notification");
- notif.find("a.close").click(function () {
- closeNotification();
- return false;
- });
+ notification.find("a.close").click(function () {
+ closeNotification();
+ return false;
+ });
+
+ if (notification.find(".msg").html().length > 0) {
+ notification_working = true;
+ notification_interval = window.setInterval(closeNotification, 4000);
}
}
+// </notification>
function refreshUnreads() {
$.getJSON('./?c=javascript&a=nbUnreadsPerFeed').done(function (data) {
diff --git a/p/themes/Dark/freshrss.css b/p/themes/Dark/freshrss.css
index e54a0eadd..f6577c645 100644
--- a/p/themes/Dark/freshrss.css
+++ b/p/themes/Dark/freshrss.css
@@ -354,13 +354,15 @@
font-size: 120%;
}
#stream.global .btn:not([data-unread="0"]) {
- font-weight:bold;
+ background: #34495e;
+ color: #fff;
+ font-weight: bold;
}
#stream.global .btn:first-child:not([data-unread="0"]):after {
top: 0; right: 5px;
border: 0;
background: none;
- color: #666;
+ color: #fff;
font-weight: bold;
box-shadow: none;
}
@@ -558,7 +560,7 @@
}
/*** NOTIFICATION ***/
-.notification {
+#notification {
position: absolute;
top: 10px;
left: 25%; right: 25%;
@@ -570,32 +572,25 @@
box-shadow: 0 0 5px #666;
background: #1a1a1a;
color: #888;
+ border: 1px solid #f4f899;
font-weight: bold;
z-index: 10;
}
- .notification.good {
- border:1px solid #f4f899;
- }
- .notification.bad {
- border:1px solid #f4a899;
+ #notification.closed {
+ display: none;
}
- .notification a.close {
+ #notification a.close {
+ position: absolute;
+ top: -10px; right: -10px;
display: inline-block;
width: 16px;
height: 16px;
- float: right;
- margin: -20px -20px 0 0;
padding: 5px;
background: #1a1a1a;
border-radius: 50px;
line-height: 16px;
- }
- .notification.good a.close{
border:1px solid #f4f899;
}
- .notification.bad a.close{
- border:1px solid #f4a899;
- }
.toggle_aside, .btn.toggle_aside {
display: none;
@@ -777,10 +772,25 @@ select.number option {
text-shadow: none;
}
- .notification,
+ #notification,
.actualizeProgress {
- left: 10px;
- right: 10px;
+ top: 0;
+ left: 0;
+ right: 0;
+ border-radius: 0;
+ border: none;
+ border-bottom: 1px solid #f4f899;
+ }
+ #notification a.close {
+ left: 0; right: 0;
+ top: 0; bottom: 0;
+ width: auto;
+ height: auto;
+ background: transparent;
+ border: none;
+ }
+ #notification a.close .icon {
+ display: none;
}
}
diff --git a/p/themes/Dark/global.css b/p/themes/Dark/global.css
index f96f83fc8..e296f2188 100644
--- a/p/themes/Dark/global.css
+++ b/p/themes/Dark/global.css
@@ -407,6 +407,11 @@ input, select, textarea {
padding: 0 25px;
line-height: 30px;
}
+ .dropdown-menu > .item.share > a {
+ display: list-item;
+ list-style-position:inside;
+ list-style-type:decimal;
+ }
.dropdown-menu > .item:hover {
background: #26303F;
color: #888;
@@ -507,18 +512,20 @@ input, select, textarea {
}
/* Prompt (centré) */
-.prompt > h1, .prompt > p {
- text-align:center;
-}
-.prompt > form {
- margin:1em auto 2.5em auto;
- width:10em;
-}
-.prompt .btn {
- display:block;
- margin:.5em auto;
-}
-.prompt input {
- margin:.4em auto 1.1em auto;
- width:99%;
+.prompt {
+ text-align: center;
}
+ .prompt label {
+ text-align: left;
+ }
+ .prompt form {
+ margin: 1em auto 2.5em auto;
+ width: 10em;
+ }
+ .prompt input {
+ margin: .4em auto 1.1em auto;
+ width: 100%;
+ }
+ .prompt p {
+ margin: 20px 0;
+ }
diff --git a/p/themes/Flat/freshrss.css b/p/themes/Flat/freshrss.css
index 19f5967ea..1d551d8fb 100644
--- a/p/themes/Flat/freshrss.css
+++ b/p/themes/Flat/freshrss.css
@@ -350,13 +350,15 @@ body {
font-size: 120%;
}
#stream.global .btn:not([data-unread="0"]) {
- font-weight:bold;
+ background: #3498db;
+ color: #fff;
+ font-weight: bold;
}
#stream.global .btn:first-child:not([data-unread="0"]):after {
top: 0; right: 5px;
border: 0;
background: none;
- color: #333;
+ color: #fff;
font-weight: bold;
box-shadow: none;
}
@@ -561,7 +563,7 @@ body {
}
/*** NOTIFICATION ***/
-.notification {
+#notification {
position: absolute;
top: 10px;
left: 25%; right: 25%;
@@ -575,28 +577,31 @@ body {
font-weight: bold;
z-index: 10;
}
- .notification.good {
+ #notification.closed {
+ display: none;
+ }
+ #notification.good {
background: #1abc9c;
color: #fff;
}
- .notification.bad {
+ #notification.bad {
background: #e74c3c;
color: #fff;
}
- .notification a.close {
+ #notification a.close {
+ position: absolute;
+ top: -6px; right: -6px;
display: inline-block;
width: 16px;
height: 16px;
- float: right;
- margin: -16px -16px 0 0;
padding: 5px;
border-radius: 3px;
line-height: 16px;
}
- .notification.good a.close {
+ #notification.good a.close {
background: #1abc9c;
}
- .notification.bad a.close {
+ #notification.bad a.close {
background: #e74c3c;
}
@@ -785,10 +790,25 @@ select.number option {
text-shadow: none;
}
- .notification,
+ #notification,
.actualizeProgress {
- left: 10px;
- right: 10px;
+ top: 0;
+ left: 0;
+ right: 0;
+ border-radius: 0;
+ }
+ #notification a.close,
+ #notification.good a.close,
+ #notification.bad a.close {
+ left: 0; right: 0;
+ top: 0; bottom: 0;
+ width: auto;
+ height: auto;
+ background: transparent;
+ border: none;
+ }
+ #notification a.close .icon {
+ display: none;
}
}
diff --git a/p/themes/Flat/global.css b/p/themes/Flat/global.css
index e3baa26ab..4044dd781 100644
--- a/p/themes/Flat/global.css
+++ b/p/themes/Flat/global.css
@@ -403,6 +403,11 @@ input, select, textarea {
padding: 0 25px;
line-height: 30px;
}
+ .dropdown-menu > .item.share > a {
+ display: list-item;
+ list-style-position:inside;
+ list-style-type:decimal;
+ }
.dropdown-menu > .item:hover > a {
background: #2980b9;
color: #fff;
@@ -510,18 +515,20 @@ input, select, textarea {
}
/* Prompt (centré) */
-.prompt > h1, .prompt > p {
- text-align:center;
-}
-.prompt > form {
- margin:1em auto 2.5em auto;
- width:10em;
-}
-.prompt .btn {
- display:block;
- margin:.5em auto;
-}
-.prompt input {
- margin:.4em auto 1.1em auto;
- width:99%;
+.prompt {
+ text-align: center;
}
+ .prompt label {
+ text-align: left;
+ }
+ .prompt form {
+ margin: 1em auto 2.5em auto;
+ width: 10em;
+ }
+ .prompt input {
+ margin: .4em auto 1.1em auto;
+ width: 100%;
+ }
+ .prompt p {
+ margin: 20px 0;
+ }
diff --git a/p/themes/Origine/freshrss.css b/p/themes/Origine/freshrss.css
index 85a23140c..86bd508df 100644
--- a/p/themes/Origine/freshrss.css
+++ b/p/themes/Origine/freshrss.css
@@ -364,15 +364,19 @@
font-size: 120%;
}
#stream.global .btn:not([data-unread="0"]) {
- font-weight:bold;
+ background: #0084CC;
+ color: #fff;
+ font-weight: bold;
+ text-shadow: none;
}
#stream.global .btn:first-child:not([data-unread="0"]):after {
top: 0; right: 5px;
border: 0;
background: none;
- color: #666;
+ color: #fff;
font-weight: bold;
box-shadow: none;
+ text-shadow: none;
}
#stream.global .box-category .feeds {
display: block;
@@ -569,7 +573,7 @@
}
/*** NOTIFICATION ***/
-.notification {
+#notification {
position: absolute;
top: 10px;
left: 25%; right: 25%;
@@ -584,18 +588,21 @@
font-weight: bold;
z-index: 10;
}
- .notification.good {
+ #notification.closed {
+ display: none;
+ }
+ #notification.good {
background: #f4f899;
}
- .notification.bad {
+ #notification.bad {
background: #f4a899;
}
- .notification a.close {
+ #notification a.close {
+ position: absolute;
+ top: -10px; right: -10px;
display: inline-block;
width: 16px;
height: 16px;
- float: right;
- margin: -20px -20px 0 0;
padding: 5px;
background: #fff;
border-radius: 50px;
@@ -783,10 +790,23 @@ select.number option {
text-shadow: none;
}
- .notification,
+ #notification,
.actualizeProgress {
- left: 10px;
- right: 10px;
+ top: 0;
+ left: 0;
+ right: 0;
+ border-radius: 0;
+ }
+ #notification a.close {
+ left: 0; right: 0;
+ top: 0; bottom: 0;
+ width: auto;
+ height: auto;
+ background: transparent;
+ border: none;
+ }
+ #notification a.close .icon {
+ display: none;
}
}
diff --git a/p/themes/Origine/global.css b/p/themes/Origine/global.css
index 58a3a52b1..5792c9e4d 100644
--- a/p/themes/Origine/global.css
+++ b/p/themes/Origine/global.css
@@ -419,6 +419,11 @@ input, select, textarea {
padding: 0 25px;
line-height: 30px;
}
+ .dropdown-menu > .item.share > a {
+ display: list-item;
+ list-style-position:inside;
+ list-style-type:decimal;
+ }
.dropdown-menu > .item:hover {
background: #0062BE;
color: #fff;
@@ -523,18 +528,20 @@ input, select, textarea {
}
/* Prompt (centré) */
-.prompt > h1, .prompt > p {
- text-align:center;
-}
-.prompt > form {
- margin:1em auto 2.5em auto;
- width:10em;
-}
-.prompt .btn {
- display:block;
- margin:.5em auto;
-}
-.prompt input {
- margin:.4em auto 1.1em auto;
- width:99%;
+.prompt {
+ text-align: center;
}
+ .prompt label {
+ text-align: left;
+ }
+ .prompt form {
+ margin: 1em auto 2.5em auto;
+ width: 10em;
+ }
+ .prompt input {
+ margin: .4em auto 1.1em auto;
+ width: 100%;
+ }
+ .prompt p {
+ margin: 20px 0;
+ }