]> git.wh0rd.org Git - tt-rss.git/commitdiff
js: code cleanup
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 8 Nov 2010 06:56:08 +0000 (09:56 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 8 Nov 2010 06:56:08 +0000 (09:56 +0300)
viewfeed.js

index 2ba2f637d3d7c6fa48a89b3989f49872f296ab5c..1a40c964927aa492b4f6a49afab424c62689ca30 100644 (file)
@@ -1003,13 +1003,7 @@ function selectionAssignLabel(id) {
 
 function selectionToggleUnread(set_state, callback_func, no_error) {
        try {
-               var rows;
-
-               if (isCdmMode()) {
-                       rows = cdmGetSelectedArticles();
-               } else {        
-                       rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
-               }
+               var rows = getSelectedArticleIds2();
 
                if (rows.length == 0 && !no_error) {
                        alert(__("No articles are selected."));
@@ -1088,14 +1082,8 @@ function selectionToggleUnread(set_state, callback_func, no_error) {
 function selectionToggleMarked() {
        try {
        
-               var rows;
+               var rows = getSelectedArticleIds2();
                
-               if (isCdmMode()) {
-                       rows = cdmGetSelectedArticles();
-               } else {        
-                       rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
-               }       
-
                if (rows.length == 0) {
                        alert(__("No articles are selected."));
                        return;
@@ -1132,13 +1120,7 @@ function selectionToggleMarked() {
 function selectionTogglePublished() {
        try {
        
-               var rows;
-               
-               if (isCdmMode()) {
-                       rows = cdmGetSelectedArticles();
-               } else {        
-                       rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
-               }       
+               var rows = getSelectedArticleIds2();
 
                if (rows.length == 0) {
                        alert(__("No articles are selected."));
@@ -1278,21 +1260,14 @@ function catchupPage() {
 function deleteSelection() {
 
        try {
-
-               var rows;
-       
-               if ($("headlinesList")) {
-                       rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
-               } else {        
-                       rows = cdmGetSelectedArticles();
-               }
        
+               var rows = getSelectedArticleIds2();
+
                if (rows.length == 0) {
                        alert(__("No articles are selected."));
                        return;
                }
        
-       
                var fn = getFeedName(getActiveFeedId(), activeFeedIsCat());
                var str;
                var op;
@@ -1329,20 +1304,13 @@ function archiveSelection() {
 
        try {
 
-               var rows;
-       
-               if ($("headlinesList")) {
-                       rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
-               } else {        
-                       rows = cdmGetSelectedArticles();
-               }
-       
+               var rows = getSelectedArticleIds2();
+
                if (rows.length == 0) {
                        alert(__("No articles are selected."));
                        return;
                }
        
-       
                var fn = getFeedName(getActiveFeedId(), activeFeedIsCat());
                var str;
                var op;
@@ -1385,20 +1353,13 @@ function catchupSelection() {
 
        try {
 
-               var rows;
-       
-               if ($("headlinesList")) {
-                       rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK");
-               } else {        
-                       rows = cdmGetSelectedArticles();
-               }
-       
+               var rows = getSelectedArticleIds2();
+
                if (rows.length == 0) {
                        alert(__("No articles are selected."));
                        return;
                }
        
-       
                var fn = getFeedName(getActiveFeedId(), activeFeedIsCat());
                
                var str = __("Mark %d selected articles in %s as read?");