aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js37
1 files changed, 26 insertions, 11 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 5dbb95c91..5be7bc36b 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -555,39 +555,42 @@ function init_shortcuts() {
window.setTimeout(init_shortcuts, 200);
return;
}
- // Touches de manipulation
+ // Manipulation shortcuts
shortcut.add(shortcuts.mark_read, function () {
- // on marque comme lu ou non lu
+ // Toggle the read state
var active = $(".flux.current");
mark_read(active, false);
}, {
'disable_in_input': true
});
shortcut.add("shift+" + shortcuts.mark_read, function () {
- // on marque tout comme lu
+ // Mark everything as read
$(".nav_menu .read_all").click();
}, {
'disable_in_input': true
});
shortcut.add(shortcuts.mark_favorite, function () {
- // on marque comme favori ou non favori
+ // Toggle the favorite state
var active = $(".flux.current");
mark_favorite(active);
}, {
'disable_in_input': true
});
shortcut.add(shortcuts.collapse_entry, function () {
+ // Toggle the collapse state
collapse_entry();
}, {
'disable_in_input': true
});
shortcut.add(shortcuts.auto_share, function () {
+ // Display the share options
auto_share();
}, {
'disable_in_input': true
});
shortcut.add(shortcuts.user_filter, function () {
+ // Display the user filters
user_filter();
}, {
'disable_in_input': true
@@ -606,7 +609,7 @@ function init_shortcuts() {
});
}
- // Touches de navigation pour les articles
+ // Entry navigation shortcuts
shortcut.add(shortcuts.prev_entry, prev_entry, {
'disable_in_input': true
});
@@ -633,7 +636,7 @@ function init_shortcuts() {
}, {
'disable_in_input': true
});
- // Touches de navigation pour les flux
+ // Feed navigation shortcuts
shortcut.add("shift+" + shortcuts.prev_entry, prev_feed, {
'disable_in_input': true
});
@@ -646,7 +649,7 @@ function init_shortcuts() {
shortcut.add("shift+" + shortcuts.last_entry, last_feed, {
'disable_in_input': true
});
- // Touches de navigation pour les categories
+ // Category navigation shortcuts
shortcut.add("alt+" + shortcuts.prev_entry, prev_category, {
'disable_in_input': true
});
@@ -661,7 +664,7 @@ function init_shortcuts() {
});
shortcut.add(shortcuts.go_website, function () {
- var url_website = $('.flux.current > .flux_header > .title > a').attr("href");
+ var url_website = $('.flux.current a.go_website').attr("href");
if (context.auto_mark_site) {
$(".flux.current").each(function () {
@@ -705,6 +708,10 @@ function init_stream(divStream) {
if ($(e.target).closest('.content, .item.website, .item.link').length > 0) {
return;
}
+ if (!context.sides_close_article && $(e.target).is('div.flux_content')) {
+ // setting for not-closing after clicking outside article area
+ return;
+ }
var old_active = $(".flux.current"),
new_active = $(this).parent();
isCollapsed = true;
@@ -803,12 +810,12 @@ function updateFeed(feeds, feeds_count) {
if (!feed) {
return;
}
-
$.ajax({
type: 'POST',
url: feed.url,
data : {
_csrf: context.csrf,
+ noCommit: feeds.length > 0 ? 1 : 0,
},
}).always(function (data) {
feed_processed++;
@@ -830,7 +837,6 @@ function init_actualize() {
if (ajax_loading) {
return false;
}
-
ajax_loading = true;
$.getJSON('./?c=javascript&a=actualize').done(function (data) {
@@ -841,7 +847,16 @@ function init_actualize() {
}
if (data.feeds.length === 0) {
openNotification(data.feedback_no_refresh, "good");
- ajax_loading = false;
+ $.ajax({ //Empty request to force refresh server database cache
+ type: 'POST',
+ url: './?c=feed&a=actualize&id=-1',
+ data : {
+ _csrf: context.csrf,
+ noCommit: 0,
+ },
+ }).always(function (data) {
+ ajax_loading = false;
+ });
return;
}
//Progress bar