diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-08 22:19:19 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-08 22:19:19 +0200 |
commit | 68f5a01dc692e9bf6c0a60e584d1600adcae3a62 (patch) | |
tree | 372b2366855b96a7b724c426c7c5ae0241e933f1 /js/public | |
parent | a9b34deefd67e08a79ddefb0e1f980f6a6c1249d (diff) |
port javascript from appframework
Diffstat (limited to 'js/public')
-rw-r--r-- | js/public/app.js | 1625 |
1 files changed, 1614 insertions, 11 deletions
diff --git a/js/public/app.js b/js/public/app.js index 396626e47..1c45a5394 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -34,17 +34,20 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. (function() { - angular.module('News', ['OC', 'ui']).config(function($provide) { - var config; - return $provide.value('Config', config = { - markReadTimeout: 500, - scrollTimeout: 500, - feedUpdateInterval: 1000 * 60 * 3, - itemBatchSize: 40, - undoTimeout: 1000 * 10, - autoPageFactor: 30 - }); - }); + 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) { @@ -192,6 +195,171 @@ 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.6.3 +/* + +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.6.3 +/* + +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.6.3 +/* + +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) { @@ -243,6 +411,44 @@ 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.6.3 +/* + +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) { @@ -568,6 +774,89 @@ 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.6.3 +/* + +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.6.3 +/* + +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; @@ -2112,6 +2401,235 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. (function() { + angular.module('News').factory('_Loading', function() { + var Loading; + Loading = (function() { + function Loading() { + this._count = 0; + } + + Loading.prototype.increase = function() { + return this._count += 1; + }; + + Loading.prototype.decrease = function() { + return this._count -= 1; + }; + + Loading.prototype.getCount = function() { + return this._count; + }; + + Loading.prototype.isLoading = function() { + return this._count > 0; + }; + + return Loading; + + })(); + return Loading; + }); + +}).call(this); + +// Generated by CoffeeScript 1.6.3 +/* + +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').factory('_Model', function() { + var Model; + Model = (function() { + function Model() { + this._data = []; + this._dataMap = {}; + this._filterCache = {}; + } + + Model.prototype.handle = function(data) { + /* + Redirects to add method + */ + + var item, _i, _len, _results; + _results = []; + for (_i = 0, _len = data.length; _i < _len; _i++) { + item = data[_i]; + _results.push(this.add(item)); + } + return _results; + }; + + Model.prototype.add = function(data, clearCache) { + if (clearCache == null) { + clearCache = true; + } + /* + Adds a new entry or updates an entry if the id exists already + */ + + if (clearCache) { + this._invalidateCache(); + } + if (angular.isDefined(this._dataMap[data.id])) { + return this.update(data, clearCache); + } else { + this._data.push(data); + return this._dataMap[data.id] = data; + } + }; + + Model.prototype.update = function(data, clearCache) { + var entry, key, value, _results; + if (clearCache == null) { + clearCache = true; + } + /* + Update an entry by searching for its id + */ + + if (clearCache) { + this._invalidateCache(); + } + entry = this.getById(data.id); + _results = []; + for (key in data) { + value = data[key]; + if (key === 'id') { + continue; + } else { + _results.push(entry[key] = value); + } + } + return _results; + }; + + Model.prototype.getById = function(id) { + /* + Return an entry by its id + */ + + return this._dataMap[id]; + }; + + Model.prototype.getAll = function() { + /* + Returns all stored entries + */ + + return this._data; + }; + + Model.prototype.removeById = function(id, clearCache) { + var counter, data, entry, _i, _len, _ref; + if (clearCache == null) { + clearCache = true; + } + /* + Remove an entry by id + */ + + _ref = this._data; + for (counter = _i = 0, _len = _ref.length; _i < _len; counter = ++_i) { + entry = _ref[counter]; + if (entry.id === id) { + this._data.splice(counter, 1); + data = this._dataMap[id]; + delete this._dataMap[id]; + if (clearCache) { + this._invalidateCache(); + } + return data; + } + } + }; + + Model.prototype.clear = function() { + /* + Removes all cached elements + */ + + this._data.length = 0; + this._dataMap = {}; + return this._invalidateCache(); + }; + + Model.prototype._invalidateCache = function() { + return this._filterCache = {}; + }; + + Model.prototype.get = function(query) { + /* + Calls, caches and returns filtered results + */ + + var hash; + hash = query.hashCode(); + if (!angular.isDefined(this._filterCache[hash])) { + this._filterCache[hash] = query.exec(this._data); + } + return this._filterCache[hash]; + }; + + Model.prototype.size = function() { + /* + Return the number of all stored entries + */ + + return this._data.length; + }; + + return Model; + + })(); + return Model; + }); + +}).call(this); + +// Generated by CoffeeScript 1.6.3 +/* + +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 __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; @@ -2663,6 +3181,79 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. (function() { + angular.module('News').factory('Notification', function() { + return OC.Notification; + }); + +}).call(this); + +// Generated by CoffeeScript 1.6.3 +/* + +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').factory('_NotImplementedError', function() { + var NotImplementedError; + NotImplementedError = (function() { + function NotImplementedError(_msg) { + this._msg = _msg; + } + + NotImplementedError.prototype.getMessage = function() { + return this._msg; + }; + + return NotImplementedError; + + })(); + return NotImplementedError; + }); + +}).call(this); + +// Generated by CoffeeScript 1.6.3 +/* + +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').factory('OPMLParser', function() { var Feed, Folder, OPMLParser; Feed = (function() { @@ -3427,6 +4018,988 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. (function() { + angular.module('News').factory('_Publisher', function() { + var Publisher; + Publisher = (function() { + function Publisher() { + this._subscriptions = {}; + } + + Publisher.prototype.subscribeObjectTo = function(object, name) { + var _base; + (_base = this._subscriptions)[name] || (_base[name] = []); + return this._subscriptions[name].push(object); + }; + + Publisher.prototype.publishDataTo = function(data, name) { + var subscriber, _i, _len, _ref, _results; + _ref = this._subscriptions[name] || []; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + subscriber = _ref[_i]; + _results.push(subscriber.handle(data)); + } + return _results; + }; + + return Publisher; + + })(); + return Publisher; + }); + +}).call(this); + +// Generated by CoffeeScript 1.6.3 +/* + +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 __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + angular.module('News').factory('_BiggerThanQuery', [ + '_Query', function(_Query) { + var BiggerThanQuery; + BiggerThanQuery = (function(_super) { + __extends(BiggerThanQuery, _super); + + function BiggerThanQuery(_field, _value) { + var name; + this._field = _field; + this._value = _value; + name = 'biggerthan'; + BiggerThanQuery.__super__.constructor.call(this, name, [this._field, this._value]); + } + + BiggerThanQuery.prototype.exec = function(data) { + var entry, filtered, _i, _len; + filtered = []; + for (_i = 0, _len = data.length; _i < _len; _i++) { + entry = data[_i]; + if (entry[this._field] > this._value) { + filtered.push(entry); + } + } + return filtered; + }; + + return BiggerThanQuery; + + })(_Query); + return BiggerThanQuery; + } + ]); + +}).call(this); + +// Generated by CoffeeScript 1.6.3 +/* + +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 __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + angular.module('News').factory('_BiggerThanEqualQuery', [ + '_Query', function(_Query) { + var BiggerThanEqualQuery; + BiggerThanEqualQuery = (function(_super) { + __extends(BiggerThanEqualQuery, _super); + + function BiggerThanEqualQuery(_field, _value) { + var name; + this._field = _field; + this._value = _value; + name = 'biggerthanequal'; + BiggerThanEqualQuery.__super__.constructor.call(this, name, [this._field, this._value]); + } + + BiggerThanEqualQuery.prototype.exec = function(data) { + var entry, filtered, _i, _len; + filtered = []; + for (_i = 0, _len = data.length; _i < _len; _i++) { + entry = data[_i]; + if (entry[this._field] >= this._value) { + filtered.push(entry); + } + } + return filtered; + }; + + return BiggerThanEqualQuery; + + })(_Query); + return BiggerThanEqualQuery; + } + ]); + +}).call(this); + +// Generated by CoffeeScript 1.6.3 +/* + +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 __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + angular.module('News').factory('_ContainsQuery', [ + '_Query', function(_Query) { + var ContainsQuery; + ContainsQuery = (function(_super) { + __extends(ContainsQuery, _super); + + function ContainsQuery(_field, _value, _caseInsensitive) { + var name; + this._field = _field; + this._value = _value; + this._caseInsensitive = _caseInsensitive != null ? _caseInsensitive : false; + name = 'contains'; + ContainsQuery.__super__.constructor.call(this, name, [this._field, this._value, this._caseInsensitive]); + } + + ContainsQuery.prototype.exec = function(data) { + var entry, field, filtered, _i, _len; + filtered = []; + if (this._caseInsensitive) { + this._value = this._value.toLowerCase(); + } + for (_i = 0, _len = data.length; _i < _len; _i++) { + entry = data[_i]; + if (this._caseInsensitive) { + field = entry[this._field].toLowerCase(); + } else { + field = entry[this._field]; + } + if (field.indexOf(this._value) !== -1) { + filtered.push(entry); + } + } + return filtered; + }; + + return ContainsQuery; + + })(_Query); + return ContainsQuery; + } + ]); + +}).call(this); + +// Generated by CoffeeScript 1.6.3 +/* + +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 __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + angular.module('News').factory('_DoesNotContainQuery', [ + '_Query', function(_Query) { + var DoesNotContainQuery; + DoesNotContainQuery = (function(_super) { + __extends(DoesNotContainQuery, _super); + + function DoesNotContainQuery(_field, _value, _caseInsensitive) { + var name; + this._field = _field; + this._value = _value; + this._caseInsensitive = _caseInsensitive != null ? _caseInsensitive : false; + name = 'doesnotcontain'; + DoesNotContainQuery.__super__.constructor.call(this, name, [this._field, this._value, this._caseInsensitive]); + } + + DoesNotContainQuery.prototype.exec = function(data) { + var entry, field, filtered, _i, _len; + filtered = []; + if (this._caseInsensitive) { + this._value = this._value.toLowerCase(); + } + for (_i = 0, _len = data.length; _i < _len; _i++) { + entry = data[_i]; + if (this._caseInsensitive) { + field = entry[this._field].toLowerCase(); + } else { + field = entry[this._field]; + } + if (field.indexOf(this._value) === -1) { + filtered.push(entry); + } + } + return filtered; + }; + + return DoesNotContainQuery; + + })(_Query); + return DoesNotContainQuery; + } + ]); + +}).call(this); + +// Generated by CoffeeScript 1.6.3 +/* + +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 |