diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-15 03:00:53 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-15 03:00:53 +0200 |
commit | 3ce894af1e72c9488b8cb3340fd61656122f7d50 (patch) | |
tree | a603121e8b1e860201370399f8095121cd9c6bf7 /js/public/app.js | |
parent | 10d76fff64363ea59d916b550854cf3540dadfbc (diff) |
use markdown, refactor js
Diffstat (limited to 'js/public/app.js')
-rw-r--r-- | js/public/app.js | 5086 |
1 files changed, 0 insertions, 5086 deletions
diff --git a/js/public/app.js b/js/public/app.js deleted file mode 100644 index 0396e6d71..000000000 --- a/js/public/app.js +++ /dev/null @@ -1,5086 +0,0 @@ - -/** - * ownCloud News App - v0.0.1 - * - * Copyright (c) 2014 - Bernhard Posselt <dev@bernhard-posselt.com> - * - * This file is licensed under the Affero General Public License version 3 or later. - * See the COPYING file - * - */ - - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News', ['ui']).config([ - '$provide', '$httpProvider', function($provide, $httpProvider) { - var config; - $provide.value('Config', config = { - markReadTimeout: 500, - scrollTimeout: 500, - feedUpdateInterval: 1000 * 60 * 3, - itemBatchSize: 40, - undoTimeout: 1000 * 10, - autoPageFactor: 30 - }); - return $httpProvider.defaults.headers.common['requesttoken'] = oc_requesttoken; - } - ]); - - angular.module('News').run([ - 'Persistence', 'Config', function(Persistence, Config) { - return setInterval(function() { - Persistence.getAllFeeds(null, false); - return Persistence.getAllFolders(null, false); - }, Config.feedUpdateInterval); - } - ]); - - $(document).ready(function() { - return $(this).keyup(function(e) { - if ((e.which === 116) || (e.which === 82 && e.ctrlKey)) { - document.location.reload(true); - return false; - } - }); - }); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('newsAudio', function() { - var directive; - return directive = { - restrict: 'E', - scope: { - src: '@', - type: '@' - }, - transclude: true, - template: '' + '<audio controls="controls" preload="none" ng-hide="cantPlay()">' + '<source ng-src="{{ src|trustUrl }}">' + '</audio>' + '<a ng-href="{{ src|trustUrl }}" class="button" ng-show="cantPlay()" ' + 'ng-transclude></a>', - link: function(scope, elm, attrs) { - var cantPlay, source; - source = elm.children().children('source')[0]; - cantPlay = false; - source.addEventListener('error', function() { - return scope.$apply(function() { - return cantPlay = true; - }); - }); - return scope.cantPlay = function() { - return cantPlay; - }; - } - }; - }); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 -(function() { - angular.module('News').directive('newsAutoFocus', function() { - var directive; - return directive = { - restrict: 'A', - link: function(scope, elm, attrs) { - return $(window).load(function() { - return $(elm).focus(); - }); - } - }; - }); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('newsBindHtmlUnsafe', function() { - return function(scope, element, attr) { - return scope.$watch(attr.newsBindHtmlUnsafe, function(value) { - return element.html(scope.$eval(attr.newsBindHtmlUnsafe)); - }); - }; - }); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('ocClickFocus', [ - '$timeout', function($timeout) { - return function(scope, elm, attr) { - var options; - options = scope.$eval(attr.ocClickFocus); - if (angular.isDefined(options) && angular.isDefined(options.selector)) { - return elm.click(function() { - if (angular.isDefined(options.timeout)) { - return $timeout(function() { - return $(options.selector).focus(); - }, options.timeout); - } else { - return $(options.selector).focus(); - } - }); - } - }; - } - ]); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('ocClickSlideToggle', [ - '$rootScope', function($rootScope) { - return function(scope, elm, attr) { - var cssClass, options, slideArea; - options = scope.$eval(attr.ocClickSlideToggle); - if (angular.isDefined(options) && angular.isDefined(options.selector)) { - slideArea = $(options.selector); - } else { - slideArea = elm; - } - if (angular.isDefined(options) && angular.isDefined(options.cssClass)) { - cssClass = options.cssClass; - } else { - cssClass = false; - } - elm.click(function() { - if (slideArea.is(':visible') && !slideArea.is(':animated')) { - slideArea.slideUp(); - if (cssClass !== false) { - return elm.removeClass('opened'); - } - } else { - slideArea.slideDown(); - if (cssClass !== false) { - return elm.addClass('opened'); - } - } - }); - if (angular.isDefined(options) && angular.isDefined(options.hideOnFocusLost) && options.hideOnFocusLost) { - $(document.body).click(function() { - return $rootScope.$broadcast('ocLostFocus'); - }); - $rootScope.$on('ocLostFocus', function(scope, params) { - if (params !== slideArea) { - if (slideArea.is(':visible') && !slideArea.is(':animated')) { - slideArea.slideUp(); - if (cssClass !== false) { - return elm.removeClass('opened'); - } - } - } - }); - slideArea.click(function(e) { - $rootScope.$broadcast('ocLostFocus', slideArea); - return e.stopPropagation(); - }); - return elm.click(function(e) { - $rootScope.$broadcast('ocLostFocus', slideArea); - return e.stopPropagation(); - }); - } - }; - } - ]); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('ocDraggable', function() { - return function(scope, elm, attr) { - var options; - options = scope.$eval(attr.ocDraggable); - if (angular.isDefined(options)) { - return elm.draggable(options); - } else { - return elm.draggable(); - } - }; - }); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('droppable', [ - '$rootScope', function($rootScope) { - return function(scope, elm, attr) { - var $elem, details; - $elem = $(elm); - details = { - accept: '.feed', - hoverClass: 'drag-and-drop', - greedy: true, - drop: function(event, ui) { - var data; - $('.drag-and-drop').removeClass('drag-and-drop'); - data = { - folderId: parseInt($elem.data('id'), 10), - feedId: parseInt($(ui.draggable).data('id'), 10) - }; - $rootScope.$broadcast('moveFeedToFolder', data); - return scope.$apply(attr.droppable); - } - }; - return $elem.droppable(details); - }; - } - ]); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('ocForwardClick', function() { - return function(scope, elm, attr) { - var options; - options = scope.$eval(attr.ocForwardClick); - if (angular.isDefined(options) && angular.isDefined(options.selector)) { - return $(elm).click(function() { - return $(options.selector).trigger('click'); - }); - } - }; - }); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('itemShortcuts', [ - '$window', function($window) { - return function(scope, elm, attr) { - var expandCurrentItem, getCurrentItem, jumpTo, jumpToNextItem, jumpToPreviousItem, keepUnreadCurrentItem, openCurrentItem, starCurrentItem; - jumpTo = function($scrollArea, $item) { - var position; - position = $item.offset().top - $scrollArea.offset().top + $scrollArea.scrollTop(); - return $scrollArea.scrollTop(position); - }; - jumpToPreviousItem = function(scrollArea) { - var $item, $items, $previous, $scrollArea, item, notJumped, _i, _len; - $scrollArea = $(scrollArea); - $items = $scrollArea.find('.feed_item'); - notJumped = true; - for (_i = 0, _len = $items.length; _i < _len; _i++) { - item = $items[_i]; - $item = $(item); - if ($item.position().top >= 0) { - $previous = $item.prev(); - if ($previous.length > 0) { - jumpTo($scrollArea, $previous); - } - notJumped = false; - break; - } - } - if ($items.length > 0 && notJumped) { - return jumpTo($scrollArea, $items.last()); - } - }; - jumpToNextItem = function(scrollArea) { - var $item, $items, $scrollArea, item, jumped, _i, _len; - $scrollArea = $(scrollArea); - $items = $scrollArea.find('.feed_item'); - jumped = false; - for (_i = 0, _len = $items.length; _i < _len; _i++) { - item = $items[_i]; - $item = $(item); - if ($item.position().top > 1) { - jumped = true; - jumpTo($scrollArea, $item); - break; - } - } - if (jumped === false) { - return $scrollArea.scrollTop($scrollArea.prop('scrollHeight')); - } - }; - getCurrentItem = function(scrollArea) { - var $item, $items, $scrollArea, item, _i, _len; - $scrollArea = $(scrollArea); - $items = $scrollArea.find('.feed_item'); - for (_i = 0, _len = $items.length; _i < _len; _i++) { - item = $items[_i]; - $item = $(item); - if (($item.height() + $item.position().top) > 30) { - return $item; - } - } - }; - keepUnreadCurrentItem = function(scrollArea) { - var $item; - $item = getCurrentItem(scrollArea); - return $item.find('.keep_unread').trigger('click'); - }; - starCurrentItem = function(scrollArea) { - var $item; - $item = getCurrentItem(scrollArea); - return $item.find('.item_utils .star').trigger('click'); - }; - expandCurrentItem = function(scrollArea) { - var $item; - $item = getCurrentItem(scrollArea); - return $item.find('.item_heading a').trigger('click'); - }; - openCurrentItem = function(scrollArea) { - var $item; - $item = getCurrentItem(scrollArea).find('.item_title a'); - $item.trigger('click'); - return window.open($item.attr('href'), '_blank'); - }; - return $($window.document).keydown(function(e) { - var focused, scrollArea; - focused = $(':focus'); - if (!(focused.is('input') || focused.is('select') || focused.is('textarea') || focused.is('checkbox'))) { - if (!(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey)) { - scrollArea = elm; - if (e.keyCode === 74 || e.keyCode === 39 || e.keyCode === 78) { - e.preventDefault(); - return jumpToNextItem(scrollArea); - } else if (e.keyCode === 75 || e.keyCode === 37 || e.keyCode === 80) { - e.preventDefault(); - return jumpToPreviousItem(scrollArea); - } else if (e.keyCode === 85) { - e.preventDefault(); - return keepUnreadCurrentItem(scrollArea); - } else if (e.keyCode === 69) { - e.preventDefault(); - return expandCurrentItem(scrollArea); - } else if (e.keyCode === 73 || e.keyCode === 83 || e.keyCode === 76) { - e.preventDefault(); - return starCurrentItem(scrollArea); - } else if (e.keyCode === 72) { - e.preventDefault(); - starCurrentItem(scrollArea); - return jumpToNextItem(scrollArea); - } else if (e.keyCode === 79) { - e.preventDefault(); - return openCurrentItem(scrollArea); - } - } - } - }); - }; - } - ]); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('newsClickScroll', [ - '$timeout', function($timeout) { - return function(scope, elm, attr) { - var options; - options = scope.$eval(attr.newsClickScroll); - return elm.click(function() { - var direction, scrollArea; - scrollArea = $(options.scrollArea); - direction = options.direction; - return $timeout(function() { - var scrollPosition; - if (direction === 'top') { - scrollPosition = 0; - } else { - scrollPosition = scrollArea.prop('scrollHeight'); - } - return scrollArea.scrollTop(scrollPosition); - }, 10); - }); - }; - } - ]); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - var markingRead, scrolling; - - scrolling = true; - - markingRead = true; - - angular.module('News').directive('newsItemScroll', [ - '$rootScope', 'Config', function($rootScope, Config) { - return function(scope, elm, attr) { - return elm.bind('scroll', function() { - var counter, item, _i, _ref, _results; - if (scrolling) { - scrolling = false; - setTimeout(function() { - return scrolling = true; - }, Config.ScrollTimeout); - if (markingRead && elm.attr('news-item-scroll') === 'true') { - markingRead = false; - setTimeout(function() { - var $elems, feedItem, id, offset, _i, _len, _results; - markingRead = true; - $elems = elm.find('.feed_item:not(.read)'); - _results = []; - for (_i = 0, _len = $elems.length; _i < _len; _i++) { - feedItem = $elems[_i]; - offset = $(feedItem).position().top; - if (offset <= -50) { - id = parseInt($(feedItem).data('id'), 10); - _results.push($rootScope.$broadcast('readItem', id)); - } else { - break; - } - } - return _results; - }, Config.MarkReadTimeout); - } - counter = 0; - _ref = elm.find('.feed_item'); - _results = []; - for (_i = _ref.length - 1; _i >= 0; _i += -1) { - item = _ref[_i]; - if (counter >= Config.autoPageFactor) { - break; - } - if ($(item).position().top < 0) { - $rootScope.$broadcast('autoPage'); - break; - } - _results.push(counter += 1); - } - return _results; - } - }); - }; - } - ]); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('newsPullToRefresh', [ - '$rootScope', function($rootScope) { - var allowed, directive; - allowed = true; - $rootScope.$on('loadingNewItems', function() { - return allowed = false; - }); - $rootScope.$on('loadedNewItems', function() { - return allowed = true; - }); - return directive = { - restrict: 'A', - link: function(scope, elm, attrs) { - var scrollTop; - scrollTop = 0; - return elm.scroll(function() { - if (this.scrollTop === 0 && allowed) { - return scope.$apply(attrs.newsPullToRefresh); - } - }); - } - }; - } - ]); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - - -/* -This directive can be bound on an input element with type file -When a file is input, the content will be passed to the given function as -$fileContent parameter - */ - -(function() { - angular.module('News').directive('ocReadFile', [ - '$rootScope', function($rootScope) { - return function(scope, elm, attr) { - return elm.change(function() { - var file, reader; - file = elm[0].files[0]; - reader = new FileReader(); - reader.onload = function(e) { - elm[0].value = null; - scope.$fileContent = e.target.result; - return scope.$apply(attr.ocReadFile); - }; - return reader.readAsText(file); - }); - }; - } - ]); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('ocTooltip', function() { - return function(scope, elm, attr) { - return elm.tooltip(); - }; - }); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('newsTranslate', function() { - var directive; - return directive = { - restrict: 'E', - link: function(scope, element, attributes) { - scope.translations = scope.translations || {}; - scope.translations[attributes.key] = element.text(); - return element.remove(); - } - }; - }); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').directive('undoNotification', [ - '$rootScope', '$timeout', 'Config', function($rootScope, $timeout, Config) { - return function(scope, elm, attr) { - var caption, timeout, undo; - undo = function() {}; - caption = ''; - timeout = null; - $(elm).click(function() { - var timout; - timout = null; - return $(this).fadeOut(); - }); - $(elm).find('a').click(function() { - var timout; - undo(); - timout = null; - $rootScope.$apply(); - return elm.fadeOut(); - }); - scope.getCaption = function() { - return caption; - }; - return scope.$on('undoMessage', function(scope, data) { - if (timeout) { - $timeout.cancel(timeout.promise); - } - timeout = $timeout(function() { - return $(elm).fadeOut(); - }, Config.undoTimeout); - undo = data.undoCallback; - caption = data.caption; - return $(elm).fadeIn().css("display", "inline"); - }); - }; - } - ]); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Bernhard Posselt -@copyright 2012 Bernhard Posselt dev@bernhard-posselt.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').filter('trustUrl', [ - '$sce', function($sce) { - return function(url) { - return $sce.trustAsResourceUrl(url); - }; - } - ]); - -}).call(this); - -// Generated by CoffeeScript 1.7.1 - -/* - -ownCloud - News - -@author Alessandro Cosentino -@copyright 2013 Alessandro Cosentino cosenal@gmail.com - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -License as published by the Free Software Foundation; either -version 3 of the License, or any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU AFFERO GENERAL PUBLIC LICENSE for more details. - -You should have received a copy of the GNU Affero General Public -License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -(function() { - angular.module('News').controller('AppController', [ - '$scope', 'Persistence', 'FeedBusinessLayer', function($scope, Persistence, FeedBusinessLayer) { - var AppController; - AppController = (fu |