diff options
41 files changed, 369 insertions, 380 deletions
diff --git a/ajax/changefoldername.php b/ajax/changefoldername.php index e7a7b6f1b..9c829bccb 100644 --- a/ajax/changefoldername.php +++ b/ajax/changefoldername.php @@ -4,10 +4,10 @@ * * @author Bernhard Posselt * Copyright (c) 2012 - Bernhard Posselt <nukeawhale@gmail.com> -* +* * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file -* +* */ // Check if we are a user diff --git a/ajax/collapsefolder.php b/ajax/collapsefolder.php index 66d879d2c..5c170a8e6 100644 --- a/ajax/collapsefolder.php +++ b/ajax/collapsefolder.php @@ -4,10 +4,10 @@ * * @author Bernhard Posselt * Copyright (c) 2012 - Bernhard Posselt <nukeawhale@gmail.com> -* +* * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file -* +* */ // Check if we are a user diff --git a/ajax/importopml.php b/ajax/importopml.php index f826fd81b..adf14e86e 100644 --- a/ajax/importopml.php +++ b/ajax/importopml.php @@ -26,7 +26,7 @@ function bailOut($msg) { if(!isset($_POST['path'])) { bailOut($l->t('No file path was submitted.')); -} +} require_once 'news/opmlparser.php'; @@ -39,7 +39,7 @@ try { } if ($parsed == null) { - bailOut($l->t('An error occurred while parsing the file.')); + bailOut($l->t('An error occurred while parsing the file.')); } $data = $parsed->getData(); @@ -65,7 +65,7 @@ function importFeed($feedurl, $folderid) { OCP\Util::writeLog('news','ajax/importopml.php: Error adding feed: '. $feedurl, OCP\Util::ERROR); return false; } - + return true; } @@ -86,7 +86,7 @@ function importFolder($name, $parentid) { OCP\Util::writeLog('news','ajax/importopml.php: Error adding folder' . $name, OCP\Util::ERROR); return null; } - + return $folderid; } @@ -94,11 +94,11 @@ function importList($data, $parentid) { $countsuccess = 0; foreach($data as $collection) { if ($collection instanceOf OCA\News\Feed) { - $feedurl = $collection->getUrl(); + $feedurl = $collection->getUrl(); if (importFeed($feedurl, $parentid)) { $countsuccess++; } - } + } else if ($collection instanceOf OCA\News\Folder) { $folderid = importFolder($collection->getName(), $parentid); if ($folderid) { @@ -115,5 +115,5 @@ function importList($data, $parentid) { $countsuccess = importList($data, 0); -OCP\JSON::success(array('data' => array('title'=>$parsed->getTitle(), 'count'=>$parsed->getCount(), +OCP\JSON::success(array('data' => array('title'=>$parsed->getTitle(), 'count'=>$parsed->getCount(), 'countsuccess'=>$countsuccess))); diff --git a/ajax/loadfeed.php b/ajax/loadfeed.php index 45d6071e5..1880f2986 100644 --- a/ajax/loadfeed.php +++ b/ajax/loadfeed.php @@ -26,8 +26,8 @@ $feedId = (int)$_POST['id']; $feedType = (int)$_POST['type']; -OCP\Config::setUserValue(OCP\USER::getUser(), 'news', 'lastViewedFeed', $feedId); -OCP\Config::setUserValue(OCP\USER::getUser(), 'news', 'lastViewedFeedType', $feedType); +OCP\Config::setUserValue(OCP\USER::getUser(), 'news', 'lastViewedFeed', $feedId); +OCP\Config::setUserValue(OCP\USER::getUser(), 'news', 'lastViewedFeedType', $feedType); $showAll = OCP\Config::getUserValue(OCP\USER::getUser(), 'news', 'showAll'); diff --git a/ajax/movefeedtofolder.php b/ajax/movefeedtofolder.php index 4a3747bb6..92d618c67 100644 --- a/ajax/movefeedtofolder.php +++ b/ajax/movefeedtofolder.php @@ -4,10 +4,10 @@ * * @author Bernhard Posselt * Copyright (c) 2012 - Bernhard Posselt <nukeawhale@gmail.com> -* +* * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file -* +* */ // Check if we are a user diff --git a/ajax/setallitemsread.php b/ajax/setallitemsread.php index f6d206e20..059c14749 100644 --- a/ajax/setallitemsread.php +++ b/ajax/setallitemsread.php @@ -4,10 +4,10 @@ * * @author Bernhard Posselt * Copyright (c) 2012 - Bernhard Posselt <nukeawhale@gmail.com> -* +* * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file -* +* */ // Check if we are a user @@ -26,19 +26,19 @@ switch ($feedId) { case -2: $items = $itemMapper->findEveryItemByStatus(OCA\News\StatusFlag::UNREAD); break; - + case -1: $items = $itemMapper->findEveryItemByStatus(OCA\News\StatusFlag::UNREAD | OCA\News\StatusFlag::IMPORTANT); break; default: - $items = $itemMapper->findAllStatus($feedId, OCA\News\StatusFlag::UNREAD); + $items = $itemMapper->findAllStatus($feedId, OCA\News\StatusFlag::UNREAD); break; } // FIXME: maybe there is a way to set all items read in the -// FeedMapper instead of iterating through every item and updating as +// FeedMapper instead of iterating through every item and updating as // necessary $success = false; if($mostRecentItemId !== 0) { @@ -50,8 +50,8 @@ foreach($items as $item) { // FIXME: this should compare the modified date if($mostRecentItemId === 0 || $item->getDate() <= $mostRecentItem->getDate()) { $item->setRead(); - $success = $itemMapper->update($item); - $unreadCount--; + $success = $itemMapper->update($item); + $unreadCount--; } } diff --git a/ajax/setitemstatus.php b/ajax/setitemstatus.php index 9586940b3..1886de738 100644 --- a/ajax/setitemstatus.php +++ b/ajax/setitemstatus.php @@ -4,10 +4,10 @@ * * @author Alessandro Cosentino * Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com> -* +* * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file -* +* */ // Check if we are a user diff --git a/ajax/updatefeed.php b/ajax/updatefeed.php index 5c981f38d..19542fa6d 100644 --- a/ajax/updatefeed.php +++ b/ajax/updatefeed.php @@ -41,7 +41,7 @@ if(!$newfeedid) { else { $itemmapper = new OCA\News\ItemMapper($userid); $unreadcounter = $itemmapper->countAllStatus($newfeedid, OCA\News\StatusFlag::UNREAD); - + OCP\JSON::success(array('data' => array('message' => $l->t('Feed updated!'), 'unreadcount' => $unreadcounter))); exit(); } diff --git a/ajax/usersettings.php b/ajax/usersettings.php index f027ee91b..2602230dd 100644 --- a/ajax/usersettings.php +++ b/ajax/usersettings.php @@ -4,10 +4,10 @@ * * @author Bernhard Posselt * Copyright (c) 2012 - Bernhard Posselt <nukeawhale@gmail.com> -* +* * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file -* +* */ // Check if we are a user @@ -22,7 +22,7 @@ if(isset($_POST['showAll'])) { } else { $showAll = true; } - OCP\Config::setUserValue(OCP\USER::getUser(), 'news', 'showAll', $showAll); + OCP\Config::setUserValue(OCP\USER::getUser(), 'news', 'showAll', $showAll); } -OCP\JSON::success(); +OCP\JSON::success(); diff --git a/appinfo/app.php b/appinfo/app.php index 9609ffa59..ed51748da 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -4,10 +4,10 @@ * * @author Alessandro Cosentino * Copyright (c) 2012 - Alessandro Cosentino <cosenal@gmail.com> -* +* * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file -* +* */ OC::$CLASSPATH['OCA\News\StatusFlag'] = 'apps/news/lib/item.php'; @@ -27,10 +27,10 @@ OCP\Backgroundjob::addRegularTask( 'OCA\News\Backgroundjob', 'run' ); $l = new OC_l10n('news'); -OCP\App::addNavigationEntry( array( - 'id' => 'news', - 'order' => 74, - 'href' => OC_Helper::linkTo( 'news', 'index.php' ), - 'icon' => OC_Helper::imagePath( 'news', 'icon.svg' ), +OCP\App::addNavigationEntry( array( + 'id' => 'news', + 'order' => 74, + 'href' => OC_Helper::linkTo( 'news', 'index.php' ), + 'icon' => OC_Helper::imagePath( 'news', 'icon.svg' ), 'name' => $l->t('News') )); diff --git a/controllers/controller.php b/controllers/controller.php index 73ad3ad4d..032cb45ee 100644 --- a/controllers/controller.php +++ b/controllers/controller.php @@ -16,8 +16,8 @@ class Controller { protected $userId; protected $trans; - - + + public function __construct(){ $this->userId = \OCP\USER::getUser(); $this->trans = \OC_L10N::get('news'); @@ -51,7 +51,7 @@ class Controller { * @param $value the value that you want to store */ protected function setUserValue($key, $value){ - \OCP\Config::setUserValue($this->userId, 'news', $key, $value); + \OCP\Config::setUserValue($this->userId, 'news', $key, $value); } @@ -73,22 +73,22 @@ class Controller { * @param $fullPage if true, it will render a full page, otherwise only a part * defaults to true */ - protected function render($template, $arguments=array(), $safeParams=array(), + protected function render($template, $arguments=array(), $safeParams=array(), $fullPage=true){ - + if($fullPage){ $template = new \OCP\Template('news', $template, 'user'); } else { $template = new \OCP\Template('news', $template); } - + foreach($arguments as $key => $value){ if(array_key_exists($key, $safeParams)) { - $template->assign($key, $value, false); + $template->assign($key, $value, false); } else { $template->assign($key, $value); } - + } $template->assign('userId', $this->userId); @@ -98,5 +98,3 @@ class Controller { } - -?>
\ No newline at end of file diff --git a/controllers/news.controller.php b/controllers/news.controller.php index 14bef126e..4f498b944 100644 --- a/controllers/news.controller.php +++ b/controllers/news.controller.php @@ -57,7 +57,7 @@ class NewsController extends Controller { // always show the last viewed feed on reload $lastViewedFeedId = (int)$this->getUserValue('lastViewedFeed'); $lastViewedFeedType = (int)$this->getUserValue('lastViewedFeedType'); - $showAll = $this->getUserValue('showAll'); + $showAll = $this->getUserValue('showAll'); if( $lastViewedFeedId === null || $lastViewedFeedType === null) { $lastViewedFeedId = $feedMapper->mostRecent(); @@ -66,7 +66,7 @@ class NewsController extends Controller { if( ( $lastViewedFeedType === FeedType::FEED && $feedMapper->findById($lastViewedFeedId) === null - ) || + ) || ( $lastViewedFeedType === FeedType::FOLDER && $folderMapper->findById($lastViewedFeedId) === null @@ -106,14 +106,14 @@ class NewsController extends Controller { $itemMapper = new ItemMapper($this->userId); // starred or subscriptions - if ($feedType === FeedType::STARRED || $feedType === FeedType::SUBSCRIPTIONS) { + if ($feedType === FeedType::STARRED || $feedType === FeedType::SUBSCRIPTIONS) { if($feedType === FeedType::STARRED){ $statusFlag = StatusFlag::IMPORTANT; } if($feedType === FeedType::SUBSCRIPTIONS){ - $statusFlag = StatusFlag::UNREAD; + $statusFlag = StatusFlag::UNREAD; } $items = $itemMapper->findEveryItemByStatus($statusFlag); @@ -125,7 +125,7 @@ class NewsController extends Controller { $items = $itemMapper->findByFeedId($feedId); } else { $items = $itemMapper->findAllStatus($feedId, StatusFlag::UNREAD); - } + } // folder } elseif ($feedType === FeedType::FOLDER){ @@ -136,7 +136,7 @@ class NewsController extends Controller { if($showAll) { $items = array_merge($items, $itemMapper->findByFeedId($feed->getId())); } else { - $items = array_merge($items, + $items = array_merge($items, $itemMapper->findAllStatus($feed->getId(), StatusFlag::UNREAD)); } } @@ -163,7 +163,7 @@ class NewsController extends Controller { case FeedType::SUBSCRIPTIONS: $unreadCount = $itemMapper->countEveryItemByStatus(StatusFlag::UNREAD); break; - + case FeedType::FOLDER: $feedMapper = new FeedMapper($this->userId); $feeds = $feedMapper->findByFolderId($feedId); @@ -182,5 +182,3 @@ class NewsController extends Controller { } - -?>
\ No newline at end of file diff --git a/css/firstrun.css b/css/firstrun.css index 2c3474990..1e2feabb2 100644 --- a/css/firstrun.css +++ b/css/firstrun.css @@ -1,31 +1,31 @@ /** - * when there are no feeds in the db + * when there are no feeds in the db */ -#firstrun { +#firstrun { position: relative; top: 50%; left: 50%; margin-left: -25em; margin-top: -10em; - width: 50em; + width: 50em; height: 20em; - text-align: center; - font-weight:bold; - font-size:1.5em; - color:#777; + text-align: center; + font-weight:bold; + font-size:1.5em; + color:#777; } #firstrun small { display: block; font-weight: normal; font-size: 0.8em; margin: .5em 0 1em 0; } #firstrun .button { font-size: 0.7em; } - #firstrun #selections { - font-size:0.8em; - margin: 2em auto 2em 10em; - clear: both; + #firstrun #selections { + font-size:0.8em; + margin: 2em auto 2em 10em; + clear: both; } - + #firstrun #feed_add_url { width:20em; } - + #firstrun #selections #addfeed_dialog_firstrun, #firstrun #selections #importopml_dialog_firstrun { width:40em; border:1px solid; @@ -33,20 +33,20 @@ border-radius:10px; -moz-border-radius:10px; /* Firefox 3.6 and earlier */ } - + #firstrun #selections #addfeed_dialog_firstrun { height:5em; } - + #firstrun #selections #importopml_dialog_firstrun { height:4em; } - -#file_upload_start { - -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter:alpha(opacity=0); - opacity:0; - z-index:1001; + +#file_upload_start { + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter:alpha(opacity=0); + opacity:0; + z-index:1001; width:0; height:0; } diff --git a/css/news.css b/css/news.css index 8212616ea..10bfe5f30 100644 --- a/css/news.css +++ b/css/news.css @@ -1,33 +1,33 @@ -.news_input { - float:left; - font-size:12px; - padding:4px 2px; - border:solid 1px #aacfe4; - width:200px; +.news_input { + float:left; + font-size:12px; + padding:4px 2px; + border:solid 1px #aacfe4; + width:200px; } -.svg { - border: inherit; - background: inherit; +.svg { + border: inherit; + background: inherit; } -div.add_parentfolder { - position: relative; +div.add_parentfolder { + position: relative; } -#file_upload_start { - -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter:alpha(opacity=0); - opacity:0; - z-index:1001; +#file_upload_start { + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter:alpha(opacity=0); + opacity:0; + z-index:1001; width:0; height:0; } - + /* feed/folder list */ -#leftcontent_news { - width: 20em; - margin: 0; +#leftcontent_news { + width: 20em; + margin: 0; height: 100%; position: relative; overflow: hidden; @@ -38,8 +38,8 @@ div.add_parentfolder { } -#feed_wrapper { - background-color: #f8f8f8; +#feed_wrapper { + background-color: #f8f8f8; position: relative; top: 0; height: 100%; @@ -71,9 +71,9 @@ div.add_parentfolder { -o-transition: padding-bottom 500ms ease 0s; -webkit-transition: padding-bottom 500ms ease 0s; -ms-transition: padding-bottom 500ms ease 0s; - transition: padding-bottom 500ms ease 0s; + transition: padding-bottom 500ms ease 0s; } - + #feeds > ul.dnd_over { } @@ -93,7 +93,7 @@ div.add_parentfolder { -ms-transition: padding-bottom 500ms ease 0s; transition: padding-bottom 500ms ease 0s; padding-bottom: 2.5em !important; - } + } .all_read { font-weight: normal !important; @@ -119,15 +119,15 @@ div.add_parentfolder { } #feeds .buttons button.feeds_delete { - background-image: url('%webroot%/core/img/actions/delete.svg'); + background-image: url('%webroot%/core/img/actions/delete.svg'); } #feeds .buttons button.feeds_edit { - background-image: url('%webroot%/core/img/actions/rename.svg'); + background-image: url('%webroot%/core/img/actions/rename.svg'); } #feeds .buttons button.feeds_markread { - background-image: url('%appswebroot%/news/img/mark_read.svg'); + background-image: url('%appswebroot%/news/img/mark_read.svg'); } #feeds button.collapsable_trigger { @@ -135,7 +135,7 @@ div.add_parentfolder { left: .5em; top: .4em; background: none; - background-image: url('%webroot%/core/img/actions/triangle-s.svg'); + background-image: url('%webroot%/core/img/actions/triangle-s.svg'); background-repeat: no-repeat; background-size: 16px 16px; height: 16px; @@ -176,7 +176,7 @@ div.add_parentfolder { position: relative; } - #feeds li.active { + #feeds li.active { background: none !important; background-color: #d0d0d0 !important; border-bottom: 1px solid #ccc; @@ -210,11 +210,11 @@ div.add_parentfolder { } #feeds .starred a.title { - background-image: url('%appswebroot%/news/img/starred.png'); + background-image: url('%appswebroot%/news/img/starred.png'); } #feeds .subscriptions a.title { - background-image: url('%appswebroot%/news/img/rss.svg'); + background-image: url('%appswebroot%/news/img/rss.svg'); } #feeds .feed { @@ -279,22 +279,22 @@ div.add_parentfolder { /* feed settings */ -#feed_settings { - padding: 0; - bottom: 0; - overflow:visible; - height:2.8em; - width: 20em; - margin:0; +#feed_settings { + padding: 0; + bottom: 0; + overflow:visible; + height:2.8em; + width: 20em; + margin:0; z-index: 2; - background:#eee; - border-top: 1px solid #ccc; - border-right: 1px solid #ccc; + background:#eee; + border-top: 1px solid #ccc; + border-right: 1px solid #ccc; box-sizing: border-box; -moz-box-sizing: border-box; - position:fixed; + position:fixed; } - + #feed_settings .controls { height: 100%; width: 100%; @@ -331,23 +331,23 @@ div.add_parentfolder { } #feed_settings #view.show_all button { - background-image: url('%appswebroot%/news/img/eye_all.png'); + background-image: url('%appswebroot%/news/img/eye_all.png'); } #feed_settings #view.show_unread button { - background-image: url('%appswebroot%/news/img/eye_unread.png'); + background-image: url('%appswebroot%/news/img/eye_unread.png'); } #feed_settings #addfeedfolder { margin: 0 .3em .3em .3em; } - #feed_settings #addfeedfolder #addfolder { - background: url('%webroot%/core/img/places/folder.svg') no-repeat 10px center; + #feed_settings #addfeedfolder #addfolder { + background: url('%webroot%/core/img/places/folder.svg') no-repeat 10px center; } - #feed_settings #addfeedfolder #addfeed { - background: url('%appswebroot%/news/img/rss.svg') no-repeat 10px center; + #feed_settings #addfeedfolder #addfeed { + background: url('%appswebroot%/news/img/rss.svg') no-repeat 10px center; } /* @@ -355,30 +355,30 @@ div.add_parentfolder { display: block; }*/ - #feed_settings ul#feedfoldermenu { + #feed_settings ul#feedfoldermenu { display: none; - background:#EEEEEE; - background:-webkit-gradient(linear, 0 0, 0 100%, from(#DCDCDC), to(#EEEEEE)); - background:-moz-linear-gradient( |