diff --git a/dist/fonts/OpenSans-Light.woff b/dist/fonts/OpenSans-Light.woff new file mode 100644 index 0000000..d50b69a --- /dev/null +++ b/dist/fonts/OpenSans-Light.woff @@ -0,0 +1,811 @@ + + + + + + + + + + + + open-sans/OpenSans-Light.woff at gh-pages · FontFaceKit/open-sans + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Skip to content +
+ + + + + + + + + + + + +
+
+
+ +
+
+
+ + +
    + +
  • +
    + +
    + + + + Watch + + + + +
    + +
    +
    +
    +
  • + +
  • + +
    + +
    + + +
    +
    + + +
    + +
  • + +
  • + + + Fork + + + + +
  • + +
+ +

+ + /open-sans + + + + + +

+
+
+ +
+
+
+ + + +
+ +
+

HTTPS clone URL

+
+ + + + +
+
+ + +
+

SSH clone URL

+
+ + + + +
+
+ + +
+

Subversion checkout URL

+
+ + + + +
+
+ + + +
You can clone with +
,
, or
. + + + +
+ + + + + + + Download ZIP + +
+
+ +
+ + + + + + + +
+ +
+ + + branch: + gh-pages + + + +
+ +
+ + + + +
+ + +
+ + +
+
+ + Martin Domke + + +
+ + + +
+ +
+
+
+ +
+ Raw + History +
+ + + +
+ +
+ +
+ 62.844 kB +
+
+ +
+
+ View Raw +
+
+ +
+ +Jump to Line + + +
+ +
+ +
+
+ + +
+ +
+ +
+ + +
+
+
+ +
+
+
+
+
+
+ + + + + + +
+
+ + + + + + +
+ + + Something went wrong with that request. Please try again. +
+ + + + + + + + + diff --git a/dist/fonts/taiga.eot b/dist/fonts/taiga.eot index f8cdfc9..b130ed1 100644 Binary files a/dist/fonts/taiga.eot and b/dist/fonts/taiga.eot differ diff --git a/dist/fonts/taiga.svg b/dist/fonts/taiga.svg index 435c7a9..b3b37a2 100644 --- a/dist/fonts/taiga.svg +++ b/dist/fonts/taiga.svg @@ -7,57 +7,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dist/fonts/taiga.ttf b/dist/fonts/taiga.ttf index 67c906c..a766a2e 100644 Binary files a/dist/fonts/taiga.ttf and b/dist/fonts/taiga.ttf differ diff --git a/dist/fonts/taiga.woff b/dist/fonts/taiga.woff index 5c346f3..6606a61 100644 Binary files a/dist/fonts/taiga.woff and b/dist/fonts/taiga.woff differ diff --git a/dist/images/backlog-empty.png b/dist/images/backlog-empty.png new file mode 100644 index 0000000..921a419 Binary files /dev/null and b/dist/images/backlog-empty.png differ diff --git a/dist/images/issues-empty.png b/dist/images/issues-empty.png new file mode 100644 index 0000000..558d207 Binary files /dev/null and b/dist/images/issues-empty.png differ diff --git a/dist/images/search-empty.png b/dist/images/search-empty.png new file mode 100644 index 0000000..2694dc5 Binary files /dev/null and b/dist/images/search-empty.png differ diff --git a/dist/images/sprint-empty.png b/dist/images/sprint-empty.png new file mode 100644 index 0000000..0a38fb1 Binary files /dev/null and b/dist/images/sprint-empty.png differ diff --git a/dist/images/user-noimage.png b/dist/images/user-noimage.png new file mode 100644 index 0000000..812b44e Binary files /dev/null and b/dist/images/user-noimage.png differ diff --git a/dist/index.html b/dist/index.html index baee5d4..22670ab 100644 --- a/dist/index.html +++ b/dist/index.html @@ -8,7 +8,7 @@ Taiga - + - - +
+ + + \ No newline at end of file diff --git a/dist/js/app-loader.js b/dist/js/app-loader.js index 2cbf3e4..8c40eef 100644 --- a/dist/js/app-loader.js +++ b/dist/js/app-loader.js @@ -1,13 +1,15 @@ (function() { var promise, version; - version = 1441879572618; + version = 1446455071045; window.taigaConfig = { "api": "http://localhost:8000/api/v1/", "eventsUrl": null, "debug": true, "defaultLanguage": "en", + "themes": ["taiga", "material-design", "high-contrast"], + "defaultTheme": "taiga", "publicRegisterEnabled": true, "feedbackEnabled": true, "privacyPolicyUrl": null, diff --git a/dist/js/app.js b/dist/js/app.js index 363fc10..a0c3b9c 100644 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -1,27 +1,27 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: app.coffee */ (function() { - var configure, i18nInit, init, module, modules, taiga; + var configure, i18nInit, init, module, modules, pluginsWithModule, taiga; this.taiga = taiga = {}; @@ -47,7 +47,7 @@ taiga.sessionId = taiga.generateUniqueSessionIdentifier(); configure = function($routeProvider, $locationProvider, $httpProvider, $provide, $tgEventsProvider, $compileProvider, $translateProvider, $animateProvider) { - var authHttpIntercept, defaultHeaders, loaderIntercept, originalWhen, preferedLangCode, userInfo, versionCheckHttpIntercept; + var authHttpIntercept, decorators, defaultHeaders, loaderIntercept, originalWhen, preferedLangCode, userInfo, versionCheckHttpIntercept; $animateProvider.classNameFilter(/^(?:(?!ng-animate-disabled).)*$/); originalWhen = $routeProvider.when; $routeProvider.when = function(path, route) { @@ -71,9 +71,11 @@ access: { requiresLogin: true }, + loader: true, title: "HOME.PAGE_TITLE", + loader: true, description: "HOME.PAGE_DESCRIPTION", - loader: true + joyride: "dashboard" }); $routeProvider.when("/projects/", { templateUrl: "projects/listing/projects-listing.html", @@ -96,17 +98,20 @@ $routeProvider.when("/project/:pslug/search", { templateUrl: "search/search.html", reloadOnSearch: false, - section: "search" + section: "search", + loader: true }); $routeProvider.when("/project/:pslug/backlog", { templateUrl: "backlog/backlog.html", loader: true, - section: "backlog" + section: "backlog", + joyride: "backlog" }); $routeProvider.when("/project/:pslug/kanban", { templateUrl: "kanban/kanban.html", loader: true, - section: "kanban" + section: "kanban", + joyride: "kanban" }); $routeProvider.when("/project/:pslug/taskboard/:sslug", { templateUrl: "taskboard/taskboard.html", @@ -252,32 +257,41 @@ $routeProvider.when("/login", { templateUrl: "auth/login.html", title: "LOGIN.PAGE_TITLE", - description: "LOGIN.PAGE_DESCRIPTION" + description: "LOGIN.PAGE_DESCRIPTION", + disableHeader: true }); $routeProvider.when("/register", { templateUrl: "auth/register.html", title: "REGISTER.PAGE_TITLE", - description: "REGISTER.PAGE_DESCRIPTION" + description: "REGISTER.PAGE_DESCRIPTION", + disableHeader: true }); $routeProvider.when("/forgot-password", { templateUrl: "auth/forgot-password.html", title: "FORGOT_PASSWORD.PAGE_TITLE", - description: "FORGOT_PASSWORD.PAGE_DESCRIPTION" - }); - $routeProvider.when("/change-password", { - templateUrl: "auth/change-password-from-recovery.html", - title: "CHANGE_PASSWORD.PAGE_TITLE", - description: "CHANGE_PASSWORD.PAGE_TITLE" + description: "FORGOT_PASSWORD.PAGE_DESCRIPTION", + disableHeader: true }); $routeProvider.when("/change-password/:token", { templateUrl: "auth/change-password-from-recovery.html", title: "CHANGE_PASSWORD.PAGE_TITLE", - description: "CHANGE_PASSWORD.PAGE_TITLE" + description: "CHANGE_PASSWORD.PAGE_TITLE", + disableHeader: true }); $routeProvider.when("/invitation/:token", { templateUrl: "auth/invitation.html", title: "INVITATION.PAGE_TITLE", - description: "INVITATION.PAGE_DESCRIPTION" + description: "INVITATION.PAGE_DESCRIPTION", + disableHeader: true + }); + $routeProvider.when("/external-apps", { + templateUrl: "external-apps/external-app.html", + title: "EXTERNAL_APP.PAGE_TITLE", + description: "EXTERNAL_APP.PAGE_DESCRIPTION", + controller: "ExternalApp", + controllerAs: "vm", + disableHeader: true, + mobileViewport: true }); $routeProvider.when("/error", { templateUrl: "error/error.html" @@ -312,14 +326,14 @@ authHttpIntercept = function($q, $location, $navUrls, $lightboxService) { var httpResponseError; httpResponseError = function(response) { - var nextPath; - if (response.status === 0) { + var nextUrl; + if (response.status === 0 || response.status === -1) { $lightboxService.closeAll(); $location.path($navUrls.resolve("error")); $location.replace(); - } else if (response.status === 401) { - nextPath = $location.path(); - $location.url($navUrls.resolve("login")).search("next=" + nextPath); + } else if (response.status === 401 && $location.url().indexOf('/login') === -1) { + nextUrl = encodeURIComponent($location.url()); + $location.url($navUrls.resolve("login")).search("next=" + nextUrl); } return $q.reject(response); }; @@ -394,9 +408,19 @@ prefix: "/locales/locale-", suffix: ".json" }).addInterpolation('$translateMessageFormatInterpolation').preferredLanguage(preferedLangCode); - if (!window.taigaConfig.debugInfo) { - return $translateProvider.fallbackLanguage(preferedLangCode); - } + $translateProvider.fallbackLanguage(preferedLangCode); + decorators = _.where(this.taigaContribPlugins, { + "type": "decorator" + }); + _.each(decorators, function(decorator) { + return $provide.decorator(decorator.provider, decorator.decorator); + }); + decorators = _.where(this.taigaContribPlugins, { + "type": "decorator" + }); + return _.each(decorators, function(decorator) { + return $provide.decorator(decorator.provider, decorator.decorator); + }); }; i18nInit = function(lang, $translate) { @@ -432,7 +456,7 @@ return checksley.updateMessages('default', messages); }; - init = function($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, appMetaService, projectService, loaderService) { + init = function($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, appMetaService, projectService, loaderService, navigationBarService) { var un, user; $log.debug("Initialize application"); $rootscope.contribPlugins = this.taigaContribPlugins; @@ -470,19 +494,37 @@ } projectService.setSection(next.section); if (next.params.pslug) { - projectService.setProject(next.params.pslug); + projectService.setProjectBySlug(next.params.pslug); } else { projectService.cleanProject(); } if (next.title || next.description) { title = $translate.instant(next.title || ""); description = $translate.instant(next.description || ""); - return appMetaService.setAll(title, description); + appMetaService.setAll(title, description); + } + if (next.mobileViewport) { + appMetaService.addMobileViewport(); + } else { + appMetaService.removeMobileViewport(); + } + if (next.disableHeader) { + return navigationBarService.disableHeader(); + } else { + return navigationBarService.enableHeader(); } }); }; - modules = ["taigaBase", "taigaCommon", "taigaResources", "taigaResources2", "taigaAuth", "taigaEvents", "taigaHome", "taigaNavigationBar", "taigaProjects", "taigaRelatedTasks", "taigaBacklog", "taigaTaskboard", "taigaKanban", "taigaIssues", "taigaUserStories", "taigaTasks", "taigaTeam", "taigaWiki", "taigaSearch", "taigaAdmin", "taigaProject", "taigaUserSettings", "taigaFeedback", "taigaPlugins", "taigaIntegrations", "taigaComponents", "taigaProfile", "taigaHome", "taigaUserTimeline", "templates", "ngRoute", "ngAnimate", "pascalprecht.translate", "infinite-scroll", "tgRepeat"].concat(_.map(this.taigaContribPlugins, function(plugin) { + pluginsWithModule = _.filter(this.taigaContribPlugins, function(plugin) { + return plugin.module; + }); + + pluginsWithModule = _.filter(this.taigaContribPlugins, function(plugin) { + return plugin.module; + }); + + modules = ["taigaBase", "taigaCommon", "taigaResources", "taigaResources2", "taigaAuth", "taigaEvents", "taigaHome", "taigaNavigationBar", "taigaProjects", "taigaRelatedTasks", "taigaBacklog", "taigaTaskboard", "taigaKanban", "taigaIssues", "taigaUserStories", "taigaTasks", "taigaTeam", "taigaWiki", "taigaSearch", "taigaAdmin", "taigaProject", "taigaUserSettings", "taigaFeedback", "taigaPlugins", "taigaIntegrations", "taigaComponents", "taigaProfile", "taigaHome", "taigaUserTimeline", "taigaExternalApps", "templates", "ngRoute", "ngAnimate", "ngAria", "pascalprecht.translate", "infinite-scroll", "tgRepeat"].concat(_.map(pluginsWithModule, function(plugin) { return plugin.module; })); @@ -490,29 +532,29 @@ module.config(["$routeProvider", "$locationProvider", "$httpProvider", "$provide", "$tgEventsProvider", "$compileProvider", "$translateProvider", "$animateProvider", configure]); - module.run(["$log", "$rootScope", "$tgAuth", "$tgEvents", "$tgAnalytics", "$translate", "$tgLocation", "$tgNavUrls", "tgAppMetaService", "tgProjectService", "tgLoader", init]); + module.run(["$log", "$rootScope", "$tgAuth", "$tgEvents", "$tgAnalytics", "$translate", "$tgLocation", "$tgNavUrls", "tgAppMetaService", "tgProjectService", "tgLoader", "tgNavigationBarService", "$route", init]); }).call(this); /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: classes.coffee */ @@ -575,23 +617,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: utils.coffee */ @@ -831,6 +873,15 @@ }; })(this); + _.mixin({ + removeKeys: function(obj, keys) { + return _.chain([keys]).flatten().reduce(function(obj, key) { + delete obj[key]; + return obj; + }, obj).value(); + } + }); + taiga = this.taiga; taiga.nl2br = nl2br; @@ -881,23 +932,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/controllerMixins.coffee */ @@ -918,7 +969,7 @@ function PageMixin() {} PageMixin.prototype.fillUsersAndRoles = function(users, roles) { - var activeUsers, availableRoles; + var activeUsers, computableRoles; activeUsers = _.filter(users, (function(_this) { return function(user) { return user.is_active; @@ -933,9 +984,9 @@ return e.id; }); this.scope.roles = _.sortBy(roles, "order"); - availableRoles = _(this.scope.project.memberships).map("role").uniq().value(); + computableRoles = _(this.scope.project.members).map("role").uniq().value(); return this.scope.computableRoles = _(roles).filter("computable").filter(function(x) { - return _.contains(availableRoles, x.id); + return _.contains(computableRoles, x.id); }).value(); }; @@ -1039,23 +1090,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/admin.coffee */ @@ -1068,23 +1119,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/auth.coffee */ @@ -1102,9 +1153,9 @@ AuthService = (function(superClass) { extend(AuthService, superClass); - AuthService.$inject = ["$rootScope", "$tgStorage", "$tgModel", "$tgResources", "$tgHttp", "$tgUrls", "$tgConfig", "$translate", "tgCurrentUserService"]; + AuthService.$inject = ["$rootScope", "$tgStorage", "$tgModel", "$tgResources", "$tgHttp", "$tgUrls", "$tgConfig", "$translate", "tgCurrentUserService", "tgThemeService"]; - function AuthService(rootscope, storage, model, rs, http, urls, config, translate, currentUserService) { + function AuthService(rootscope, storage, model, rs, http, urls, config, translate, currentUserService, themeService) { var userModel; this.rootscope = rootscope; this.storage = storage; @@ -1115,7 +1166,9 @@ this.config = config; this.translate = translate; this.currentUserService = currentUserService; + this.themeService = themeService; AuthService.__super__.constructor.call(this); + this._currentTheme = this.config.get("defaultTheme") || "taiga"; userModel = this.getUser(); this.setUserdata(userModel); } @@ -1129,9 +1182,23 @@ } }; + AuthService.prototype._getUserTheme = function() { + var ref; + return ((ref = this.rootscope.user) != null ? ref.theme : void 0) || this.config.get("defaultTheme") || "taiga"; + }; + + AuthService.prototype._setTheme = function() { + var newTheme; + newTheme = this._getUserTheme(); + if (this._currentTheme !== newTheme) { + this._currentTheme = newTheme; + return this.themeService.use(this._currentTheme); + } + }; + AuthService.prototype._setLocales = function() { - var lang; - lang = this.rootscope.user.lang || this.config.get("defaultLanguage") || "en"; + var lang, ref; + lang = ((ref = this.rootscope.user) != null ? ref.lang : void 0) || this.config.get("defaultLanguage") || "en"; this.translate.preferredLanguage(lang); return this.translate.use(lang); }; @@ -1146,6 +1213,7 @@ user = this.model.make_model("users", userData); this.rootscope.user = user; this._setLocales(); + this._setTheme(); return user; } return null; @@ -1156,7 +1224,8 @@ this.storage.set("userInfo", user.getAttrs()); this.rootscope.user = user; this.setUserdata(user); - return this._setLocales(); + this._setLocales(); + return this._setTheme(); }; AuthService.prototype.clear = function() { @@ -1204,7 +1273,9 @@ AuthService.prototype.logout = function() { this.removeToken(); this.clear(); - return this.currentUserService.removeUser(); + this.currentUserService.removeUser(); + this._setTheme(); + return this._setLocales(); }; AuthService.prototype.register = function(data, type, existing) { @@ -1304,12 +1375,12 @@ onSuccess = function(response) { var nextUrl; if ($routeParams['next'] && $routeParams['next'] !== $navUrls.resolve("login")) { - nextUrl = $routeParams['next']; + nextUrl = decodeURIComponent($routeParams['next']); } else { nextUrl = $navUrls.resolve("home"); } $events.setupConnection(); - return $location.path(nextUrl); + return $location.url(nextUrl); }; onError = function(response) { return $confirm.notify("light-error", $translate.instant("LOGIN_FORM.ERROR_AUTH_INCORRECT")); @@ -1439,26 +1510,24 @@ ChangePasswordFromRecoveryDirective = function($auth, $confirm, $location, $params, $navUrls, $translate) { var link; link = function($scope, $el, $attrs) { - var form, onErrorSubmit, onSuccessSubmit, submit; + var form, onErrorSubmit, onSuccessSubmit, submit, text; $scope.data = {}; if ($params.token != null) { $scope.tokenInParams = true; $scope.data.token = $params.token; } else { - $scope.tokenInParams = false; + $location.path($navUrls.resolve("login")); + text = $translate.instant("CHANGE_PASSWORD_RECOVERY_FORM.ERROR"); + $confirm.notify("light-error", text); } form = $el.find("form").checksley(); onSuccessSubmit = function(response) { - var text; $location.path($navUrls.resolve("login")); text = $translate.instant("CHANGE_PASSWORD_RECOVERY_FORM.SUCCESS"); return $confirm.success(text); }; onErrorSubmit = function(response) { - var text; - text = $translate.instant("COMMON.GENERIC_ERROR", { - error: response.data._error_message - }); + text = $translate.instant("CHANGE_PASSWORD_RECOVERY_FORM.ERROR"); return $confirm.notify("light-error", text); }; submit = debounce(2000, (function(_this) { @@ -1497,7 +1566,7 @@ var text; $location.path($navUrls.resolve("login")); text = $translate.instant("INVITATION_LOGIN_FORM.NOT_FOUND"); - return $confirm.success(text); + return $confirm.notify("light-error", text); }); $scope.dataLogin = { token: token @@ -1683,23 +1752,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/backlog.coffee */ @@ -1712,23 +1781,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base.coffee */ @@ -1821,34 +1890,55 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common.coffee */ (function() { - var AnimationFrame, CheckPermissionDirective, ClassPermissionDirective, LimitLineLengthDirective, ProjectUrl, Qqueue, SelectedText, Template, ToggleCommentDirective, module, taiga, + var AnimationFrame, Capslock, CheckPermissionDirective, ClassPermissionDirective, DataPickerConfig, LimitLineLengthDirective, ProjectUrl, Qqueue, SelectedText, Template, ToggleCommentDirective, module, taiga, slice = [].slice; taiga = this.taiga; module = angular.module("taigaCommon", []); + DataPickerConfig = function($translate) { + return { + get: function() { + return { + i18n: { + previousMonth: $translate.instant("COMMON.PICKERDATE.PREV_MONTH"), + nextMonth: $translate.instant("COMMON.PICKERDATE.NEXT_MONTH"), + months: [$translate.instant("COMMON.PICKERDATE.MONTHS.JAN"), $translate.instant("COMMON.PICKERDATE.MONTHS.FEB"), $translate.instant("COMMON.PICKERDATE.MONTHS.MAR"), $translate.instant("COMMON.PICKERDATE.MONTHS.APR"), $translate.instant("COMMON.PICKERDATE.MONTHS.MAY"), $translate.instant("COMMON.PICKERDATE.MONTHS.JUN"), $translate.instant("COMMON.PICKERDATE.MONTHS.JUL"), $translate.instant("COMMON.PICKERDATE.MONTHS.AUG"), $translate.instant("COMMON.PICKERDATE.MONTHS.SEP"), $translate.instant("COMMON.PICKERDATE.MONTHS.OCT"), $translate.instant("COMMON.PICKERDATE.MONTHS.NOV"), $translate.instant("COMMON.PICKERDATE.MONTHS.DEC")], + weekdays: [$translate.instant("COMMON.PICKERDATE.WEEK_DAYS.SUN"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.MON"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.TUE"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.WED"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.THU"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.FRI"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.SAT")], + weekdaysShort: [$translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.SUN"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.MON"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.TUE"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.WED"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.THU"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.FRI"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.SAT")] + }, + isRTL: $translate.instant("COMMON.PICKERDATE.IS_RTL") === "true", + firstDay: parseInt($translate.instant("COMMON.PICKERDATE.FIRST_DAY_OF_WEEK"), 10), + format: $translate.instant("COMMON.PICKERDATE.FORMAT") + }; + } + }; + }; + + module.factory("tgDatePickerConfigService", ["$translate", DataPickerConfig]); + SelectedText = function($window, $document) { var get; get = function() { @@ -2087,27 +2177,70 @@ module.factory("$tgTemplate", ["$templateCache", Template]); + Capslock = function($translate) { + var link; + link = function($scope, $el, $attrs) { + var hideIcon, open, showIcon, warningIcon; + open = false; + warningIcon = $('
').addClass('icon').addClass('icon-capslock').attr('title', $translate.instant('COMMON.CAPSLOCK_WARNING')); + hideIcon = function() { + return warningIcon.fadeOut(function() { + open = false; + return $(this).remove(); + }); + }; + showIcon = function(e) { + var element; + if (open) { + return; + } + element = e.currentTarget; + $(element).parent().append(warningIcon); + $('.icon-capslock').fadeIn(); + return open = true; + }; + $el.on('blur', function(e) { + return hideIcon(); + }); + $el.on('keyup.capslock, focus', function(e) { + if ($el.val() === $el.val().toLowerCase()) { + return hideIcon(e); + } else { + return showIcon(e); + } + }); + return $scope.$on("$destroy", function() { + return $el.off('.capslock'); + }); + }; + return { + link: link + }; + }; + + module.directive("tgCapslock", ["$translate", Capslock]); + }).call(this); /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/events.coffee */ @@ -2306,23 +2439,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/feedback.coffee */ @@ -2394,23 +2527,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/integrations.coffee */ @@ -2423,23 +2556,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/issues.coffee */ @@ -2452,23 +2585,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/kanban.coffee */ @@ -2481,23 +2614,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/projects.coffee */ @@ -2510,23 +2643,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/related-tasks.coffee */ @@ -2610,15 +2743,16 @@ title = $translate.instant("TASK.TITLE_DELETE_ACTION"); task = $model.$modelValue; message = task.subject; - return $confirm.askOnDelete(title, message).then(function(finish) { + return $confirm.askOnDelete(title, message).then(function(askResponse) { var promise; promise = $repo.remove(task); promise.then(function() { - finish(); + askResponse.finish(); $confirm.notify("success"); return $scope.$emit("related-tasks:delete"); }); return promise.then(null, function() { + askResponse.finish(false); return $confirm.notify("error"); }); }); @@ -2768,7 +2902,7 @@ loadTasks = function() { return $rs.tasks.list($scope.projectId, null, $scope.usId).then((function(_this) { return function(tasks) { - $scope.tasks = tasks; + $scope.tasks = _.sortBy(tasks, 'ref'); return tasks; }; })(this)); @@ -2861,23 +2995,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources.coffee */ @@ -2910,8 +3044,11 @@ "users-change-password": "/users/change_password", "users-change-email": "/users/change_email", "users-cancel-account": "/users/cancel", - "contacts": "/users/%s/contacts", - "stats": "/users/%s/stats", + "user-stats": "/users/%s/stats", + "user-liked": "/users/%s/liked", + "user-voted": "/users/%s/voted", + "user-watched": "/users/%s/watched", + "user-contacts": "/users/%s/contacts", "permissions": "/permissions", "notify-policies": "/notify-policies", "user-storage": "/user-storage", @@ -2924,6 +3061,10 @@ "project-templates": "/project-templates", "project-modules": "/projects/%s/modules", "bulk-update-projects-order": "/projects/bulk_update_order", + "project-like": "/projects/%s/like", + "project-unlike": "/projects/%s/unlike", + "project-watch": "/projects/%s/watch", + "project-unwatch": "/projects/%s/unwatch", "userstory-statuses": "/userstory-statuses", "points": "/points", "task-statuses": "/task-statuses", @@ -2937,11 +3078,25 @@ "bulk-update-us-backlog-order": "/userstories/bulk_update_backlog_order", "bulk-update-us-sprint-order": "/userstories/bulk_update_sprint_order", "bulk-update-us-kanban-order": "/userstories/bulk_update_kanban_order", + "userstories-filters": "/userstories/filters_data", + "userstory-upvote": "/userstories/%s/upvote", + "userstory-downvote": "/userstories/%s/downvote", + "userstory-watch": "/userstories/%s/watch", + "userstory-unwatch": "/userstories/%s/unwatch", "tasks": "/tasks", "bulk-create-tasks": "/tasks/bulk_create", "bulk-update-task-taskboard-order": "/tasks/bulk_update_taskboard_order", + "task-upvote": "/tasks/%s/upvote", + "task-downvote": "/tasks/%s/downvote", + "task-watch": "/tasks/%s/watch", + "task-unwatch": "/tasks/%s/unwatch", "issues": "/issues", "bulk-create-issues": "/issues/bulk_create", + "issues-filters": "/issues/filters_data", + "issue-upvote": "/issues/%s/upvote", + "issue-downvote": "/issues/%s/downvote", + "issue-watch": "/issues/%s/watch", + "issue-unwatch": "/issues/%s/unwatch", "wiki": "/wiki", "wiki-restore": "/wiki/%s/restore", "wiki-links": "/wiki-links", @@ -2973,7 +3128,9 @@ "exporter": "/exporter", "importer": "/importer/load_dump", "feedback": "/feedback", - "locales": "/locales" + "locales": "/locales", + "applications": "/applications", + "application-tokens": "/application-tokens" }; initUrls = function($log, $urls) { @@ -3005,23 +3162,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/search.coffee */ @@ -3078,16 +3235,23 @@ }; })(this)); promise.then(null, this.onInitialDataError.bind(this)); - this.scope.searchTerm = ""; + this.scope.searchTerm = null; loadSearchData = debounceLeading(100, (function(_this) { return function(t) { return _this.loadSearchData(t); }; })(this)); + bindOnce(this.scope, "projectId", (function(_this) { + return function(projectId) { + if (!_this.scope.searchResults && _this.scope.searchTerm) { + return _this.loadSearchData(); + } + }; + })(this)); this.scope.$watch("searchTerm", (function(_this) { return function(term) { - if (term) { - return loadSearchData(term); + if (term !== void 0 && _this.scope.projectId) { + return _this.loadSearchData(term); } }; })(this)); @@ -3117,9 +3281,6 @@ _this.scope.priorityById = groupBy(project.priorities, function(x) { return x.id; }); - _this.scope.membersById = groupBy(project.memberships, function(x) { - return x.user; - }); _this.scope.usStatusById = groupBy(project.us_statuses, function(x) { return x.id; }); @@ -3129,21 +3290,41 @@ }; SearchController.prototype.loadSearchData = function(term) { - var promise; - promise = this.rs.search["do"](this.scope.projectId, term).then((function(_this) { + if (term == null) { + term = ""; + } + this.scope.loading = true; + return this._loadSearchData(term).then((function(_this) { return function(data) { - _this.scope.searchResults = data; - return data; + if (data) { + _this.scope.searchResults = data; + return _this.scope.loading = false; + } }; })(this)); - return promise; + }; + + SearchController.prototype._loadSearchData = function(term) { + if (term == null) { + term = ""; + } + if (this.deferredAbort) { + this.deferredAbort.resolve(); + } + this.deferredAbort = this.q.defer(); + this.rs.search["do"](this.scope.projectId, term).then((function(_this) { + return function(data) { + return _this.deferredAbort.resolve(data); + }; + })(this)); + return this.deferredAbort.promise; }; SearchController.prototype.loadInitialData = function() { return this.loadProject().then((function(_this) { return function(project) { _this.scope.projectId = project.id; - return _this.fillUsersAndRoles(project.users, project.roles); + return _this.fillUsersAndRoles(project.members, project.roles); }; })(this)); }; @@ -3201,14 +3382,22 @@ SearchDirective = function($log, $compile, $templatecache, $routeparams, $location) { var link, linkTable; linkTable = function($scope, $el, $attrs, $ctrl) { - var getActiveSection, lastSeatchResults, markSectionTabActive, renderFilterTabs, renderTableContent, tabsDom, templates; + var activeSectionName, applyAutoTab, getActiveSection, lastSearchResults, markSectionTabActive, renderFilterTabs, renderTableContent, tabsDom, templates; + applyAutoTab = true; + activeSectionName = "userstories"; tabsDom = $el.find("section.search-filter"); - lastSeatchResults = null; + lastSearchResults = null; getActiveSection = function(data) { - var i, len, maxVal, name, ref, selectedSectionData, selectedSectionName, value; + var i, len, maxVal, name, ref, selectedSection, value; maxVal = 0; - selectedSectionName = null; - selectedSectionData = null; + selectedSection = {}; + selectedSection.name = "userstories"; + selectedSection.value = []; + if (!applyAutoTab) { + selectedSection.name = activeSectionName; + selectedSection.value = data[activeSectionName]; + return selectedSection; + } if (data) { ref = ["userstories", "issues", "tasks", "wikipages"]; for (i = 0, len = ref.length; i < len; i++) { @@ -3216,22 +3405,16 @@ value = data[name]; if (value.length > maxVal) { maxVal = value.length; - selectedSectionName = name; - selectedSectionData = value; + selectedSection.name = name; + selectedSection.value = value; break; } } } if (maxVal === 0) { - return { - name: "userstories", - value: [] - }; + return selectedSection; } - return { - name: selectedSectionName, - value: selectedSectionData - }; + return selectedSection; }; renderFilterTabs = function(data) { var name, results, value; @@ -3247,7 +3430,9 @@ }; markSectionTabActive = function(section) { tabsDom.find("a.active").removeClass("active"); - return tabsDom.find("li." + section.name + " a").addClass("active"); + tabsDom.find("li." + section.name + " a").addClass("active"); + applyAutoTab = false; + return activeSectionName = section.name; }; templates = { issues: $templatecache.get("search-issues"), @@ -3271,14 +3456,17 @@ }; $scope.$watch("searchResults", function(data) { var activeSection; - lastSeatchResults = data; + lastSearchResults = data; + if (!lastSearchResults) { + return; + } activeSection = getActiveSection(data); renderFilterTabs(data); renderTableContent(activeSection); return markSectionTabActive(activeSection); }); $scope.$watch("searchTerm", function(searchTerm) { - if (searchTerm) { + if (searchTerm !== void 0) { return $location.search("text", searchTerm); } }); @@ -3287,7 +3475,7 @@ event.preventDefault(); target = angular.element(event.currentTarget); sectionName = target.parent().data("name"); - sectionData = lastSeatchResults[sectionName]; + sectionData = !lastSearchResults ? [] : lastSearchResults[sectionName]; section = { name: sectionName, value: sectionData @@ -3320,23 +3508,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/taskboard.coffee */ @@ -3349,23 +3537,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/tasks.coffee */ @@ -3378,23 +3566,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/team.coffee */ @@ -3407,23 +3595,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/user-settings.coffee */ @@ -3436,23 +3624,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/userstories.coffee */ @@ -3465,23 +3653,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/wiki.coffee */ @@ -3494,23 +3682,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/analytics.coffee */ @@ -3611,23 +3799,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/attachments.coffee */ @@ -3803,18 +3991,18 @@ fileName: attachment.name }); return this.confirm.askOnDelete(title, message).then((function(_this) { - return function(finish) { + return function(askResponse) { var onError, onSuccess; onSuccess = function() { var index; - finish(); + askResponse.finish(); index = _this.attachments.indexOf(attachment); _this.attachments.splice(index, 1); _this.updateCounters(); return _this.rootscope.$broadcast("attachment:delete"); }; onError = function() { - finish(false); + askResponse.finish(false); message = _this.translate.instant("ATTACHMENT.ERROR_DELETE_ATTACHMENT", { errorMessage: message }); @@ -3933,7 +4121,7 @@ module.directive("tgAttachments", ["$tgConfig", "$tgConfirm", "$tgTemplate", "$translate", AttachmentsDirective]); - AttachmentDirective = function($template, $compile, $translate) { + AttachmentDirective = function($template, $compile, $translate, $rootScope) { var link, template, templateEdit; template = $template.get("attachment/attachment.html", true); templateEdit = $template.get("attachment/attachment-edit.html", true); @@ -3975,6 +4163,7 @@ saveAttachment = function() { attachment.description = $el.find("input[name='description']").val(); attachment.is_deprecated = $el.find("input[name='is-deprecated']").prop("checked"); + attachment.isCreatedRightNow = false; return $scope.$apply(function() { return $ctrl.updateAttachment(attachment).then(function() { return render(attachment, false); @@ -3989,7 +4178,9 @@ if (event.keyCode === 13) { return saveAttachment(); } else if (event.keyCode === 27) { - return render(attachment, false); + return $scope.$apply(function() { + return render(attachment, false); + }); } }); $el.on("click", "a.editable-settings.icon-delete", function(event) { @@ -4007,6 +4198,14 @@ return $ctrl.removeAttachment(attachment); }); }); + $el.on("click", "div.attachment-name a", function(event) { + if (null !== attachment.name.match(/\.(jpe?g|png|gif|gifv|webm)/i)) { + event.preventDefault(); + return $scope.$apply(function() { + return $rootScope.$broadcast("attachment:preview", attachment); + }); + } + }); $scope.$on("$destroy", function() { return $el.off(); }); @@ -4023,10 +4222,30 @@ }; }; - module.directive("tgAttachment", ["$tgTemplate", "$compile", "$translate", AttachmentDirective]); + module.directive("tgAttachment", ["$tgTemplate", "$compile", "$translate", "$rootScope", AttachmentDirective]); }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: bind-scope.coffee + */ + (function() { var BindScope, module; @@ -4053,6 +4272,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: compile-html.directive.coffee + */ + (function() { var CompileHtmlDirective; @@ -4077,23 +4316,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/components.coffee */ @@ -4131,13 +4370,15 @@ module.directive("tgDateRange", ["$translate", DateRangeDirective]); - DateSelectorDirective = function($rootscope, $translate) { + DateSelectorDirective = function($rootscope, datePickerConfigService) { var link; link = function($scope, $el, $attrs, $model) { var initialize, selectedDate, unbind; selectedDate = null; initialize = function() { - return $el.picker = new Pikaday({ + var datePickerConfig; + datePickerConfig = datePickerConfigService.get(); + _.merge(datePickerConfig, { field: $el[0], onSelect: (function(_this) { return function(date) { @@ -4150,18 +4391,9 @@ return $el.picker.setDate(selectedDate); } }; - })(this), - i18n: { - previousMonth: $translate.instant("COMMON.PICKERDATE.PREV_MONTH"), - nextMonth: $translate.instant("COMMON.PICKERDATE.NEXT_MONTH"), - months: [$translate.instant("COMMON.PICKERDATE.MONTHS.JAN"), $translate.instant("COMMON.PICKERDATE.MONTHS.FEB"), $translate.instant("COMMON.PICKERDATE.MONTHS.MAR"), $translate.instant("COMMON.PICKERDATE.MONTHS.APR"), $translate.instant("COMMON.PICKERDATE.MONTHS.MAY"), $translate.instant("COMMON.PICKERDATE.MONTHS.JUN"), $translate.instant("COMMON.PICKERDATE.MONTHS.JUL"), $translate.instant("COMMON.PICKERDATE.MONTHS.AUG"), $translate.instant("COMMON.PICKERDATE.MONTHS.SEP"), $translate.instant("COMMON.PICKERDATE.MONTHS.OCT"), $translate.instant("COMMON.PICKERDATE.MONTHS.NOV"), $translate.instant("COMMON.PICKERDATE.MONTHS.DEC")], - weekdays: [$translate.instant("COMMON.PICKERDATE.WEEK_DAYS.SUN"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.MON"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.TUE"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.WED"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.THU"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.FRI"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS.SAT")], - weekdaysShort: [$translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.SUN"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.MON"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.TUE"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.WED"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.THU"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.FRI"), $translate.instant("COMMON.PICKERDATE.WEEK_DAYS_SHORT.SAT")] - }, - isRTL: $translate.instant("COMMON.PICKERDATE.IS_RTL") === "true", - firstDay: parseInt($translate.instant("COMMON.PICKERDATE.FIRST_DAY_OF_WEEK"), 10), - format: $translate.instant("COMMON.PICKERDATE.FORMAT") + })(this) }); + return $el.picker = new Pikaday(datePickerConfig); }; unbind = $rootscope.$on("$translateChangeEnd", (function(_this) { return function(ctx) { @@ -4187,7 +4419,7 @@ }; }; - module.directive("tgDateSelector", ["$rootScope", "$translate", DateSelectorDirective]); + module.directive("tgDateSelector", ["$rootScope", "tgDatePickerConfigService", DateSelectorDirective]); SprintProgressBarDirective = function() { var link, renderProgress; @@ -4225,19 +4457,22 @@ module.directive("tgSprintProgressbar", SprintProgressBarDirective); - CreatedByDisplayDirective = function($template, $compile, $translate) { + CreatedByDisplayDirective = function($template, $compile, $translate, $navUrls) { var link, template; template = $template.get("common/components/created-by.html", true); link = function($scope, $el, $attrs) { var render; render = function(model) { - var html, owner, ref; - owner = ((ref = $scope.usersById) != null ? ref[model.owner] : void 0) || { + var html, owner; + owner = model.owner_extra_info || { full_name_display: $translate.instant("COMMON.EXTERNAL_USER"), - photo: "/images/unnamed.png" + photo: "/images/user-noimage.png" }; html = template({ owner: owner, + url: (owner != null ? owner.is_active : void 0) ? $navUrls.resolve("user-profile", { + username: owner.username + }) : "", date: moment(model.created_date).format($translate.instant("COMMON.DATETIME")) }); html = $compile(html)($scope); @@ -4259,7 +4494,7 @@ }; }; - module.directive("tgCreatedByDisplay", ["$tgTemplate", "$compile", "$translate", CreatedByDisplayDirective]); + module.directive("tgCreatedByDisplay", ["$tgTemplate", "$compile", "$translate", "$tgNavUrls", CreatedByDisplayDirective]); WatchersDirective = function($rootscope, $confirm, $repo, $qqueue, $template, $compile, $translate) { var link, template; @@ -4319,13 +4554,9 @@ isEditable: isEditable() }; html = $compile(template(ctx))($scope); - $el.html(html); - if (isEditable() && watchers.length === 0) { - $el.find(".title").text("Add watchers"); - return $el.find(".watchers-header").addClass("no-watchers"); - } + return $el.html(html); }; - $el.on("click", ".icon-delete", function(event) { + $el.on("click", ".js-delete-watcher", function(event) { var message, target, title, watcherId; event.preventDefault(); if (!isEditable()) { @@ -4336,16 +4567,16 @@ title = $translate.instant("COMMON.WATCHERS.TITLE_LIGHTBOX_DELETE_WARTCHER"); message = $scope.usersById[watcherId].full_name_display; return $confirm.askOnDelete(title, message).then((function(_this) { - return function(finish) { + return function(askResponse) { var watcherIds; - finish(); + askResponse.finish(); watcherIds = _.clone($model.$modelValue.watchers, false); watcherIds = _.pull(watcherIds, watcherId); return deleteWatcher(watcherIds); }; })(this)); }); - $el.on("click", ".add-watcher", function(event) { + $el.on("click", ".js-add-watcher", function(event) { event.preventDefault(); if (!isEditable()) { return; @@ -4440,8 +4671,8 @@ } title = $translate.instant("COMMON.ASSIGNED_TO.CONFIRM_UNASSIGNED"); return $confirm.ask(title).then((function(_this) { - return function(finish) { - finish(); + return function(response) { + response.finish(); $model.$modelValue.assigned_to = null; return save(null); }; @@ -4528,22 +4759,22 @@ if (!$attrs.onDeleteTitle) { return $log.error("DeleteButtonDirective requires on-delete-title set in scope."); } - $el.on("click", ".button", function(event) { + $el.on("click", ".button-delete", function(event) { var subtitle, title; title = $attrs.onDeleteTitle; subtitle = $model.$modelValue.subject; return $confirm.askOnDelete(title, subtitle).then((function(_this) { - return function(finish) { + return function(askResponse) { var promise; promise = $repo.remove($model.$modelValue); promise.then(function() { var url; - finish(); + askResponse.finish(); url = $scope.$eval($attrs.onDeleteGoToUrl); return $location.path(url); }); return promise.then(null, function() { - finish(false); + askResponse.finish(false); return $confirm.notify("error"); }); }; @@ -4702,6 +4933,15 @@ $el.find('.view-description').hide(); return $el.find('textarea').focus(); }); + $el.on("click", "a", function(event) { + var href, target; + target = angular.element(event.target); + href = target.attr('href'); + if (href.indexOf("#") === 0) { + event.preventDefault(); + return $('body').scrollTop($(href).offset().top); + } + }); $el.on("click", ".save", function(e) { var description; e.preventDefault(); @@ -4782,17 +5022,17 @@ var link, template; template = $template.get("common/components/list-item-assigned-to-avatar.html", true); link = function($scope, $el, $attrs) { - return bindOnce($scope, "membersById", function(membersById) { + return bindOnce($scope, "usersById", function(usersById) { var ctx, item, member; item = $scope.$eval($attrs.tgListitemAssignedto); ctx = { name: "Unassigned", imgurl: "/images/unnamed.png" }; - member = membersById[item.assigned_to]; + member = usersById[item.assigned_to]; if (member) { ctx.imgurl = member.photo; - ctx.name = member.full_name; + ctx.name = member.full_name_display; } return $el.html(template(ctx)); }); @@ -4956,23 +5196,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/confirm.coffee */ @@ -5042,13 +5282,15 @@ event.preventDefault(); target = angular.element(event.currentTarget); currentLoading = _this.loading().target(target).start(); - return defered.resolve(function(ok) { - if (ok == null) { - ok = true; - } - currentLoading.finish(); - if (ok) { - return _this.hide(el); + return defered.resolve({ + finish: function(ok) { + if (ok == null) { + ok = true; + } + currentLoading.finish(); + if (ok) { + return _this.hide(el); + } } }); }; @@ -5100,9 +5342,14 @@ currentLoading = _this.loading().target(target).start(); return defered.resolve({ selected: choicesField.val(), - finish: function() { + finish: function(ok) { + if (ok == null) { + ok = true; + } currentLoading.finish(); - return _this.hide(el); + if (ok) { + return _this.hide(el); + } } }); }; @@ -5243,7 +5490,7 @@ return delete _this.tsem; }; })(this)); - return el.on("click", ".icon-delete", (function(_this) { + return el.on("click", ".icon-delete, .close", (function(_this) { return function(event) { return body.find(selector).removeClass('active').addClass('inactive'); }; @@ -5262,28 +5509,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/custom-field-values.coffee */ (function() { - var CustomAttributeValueDirective, CustomAttributesValuesController, CustomAttributesValuesDirective, bindMethods, bindOnce, debounce, generateHash, module, taiga, + var CustomAttributeValueDirective, CustomAttributesValuesController, CustomAttributesValuesDirective, DATE_TYPE, MULTILINE_TYPE, TEXT_TYPE, TYPE_CHOICES, bindMethods, bindOnce, debounce, generateHash, module, taiga, extend = 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; }, hasProp = {}.hasOwnProperty; @@ -5299,6 +5546,25 @@ module = angular.module("taigaCommon"); + TEXT_TYPE = "text"; + + MULTILINE_TYPE = "multiline"; + + DATE_TYPE = "date"; + + TYPE_CHOICES = [ + { + key: TEXT_TYPE, + name: "ADMIN.CUSTOM_FIELDS.FIELD_TYPE_TEXT" + }, { + key: MULTILINE_TYPE, + name: "ADMIN.CUSTOM_FIELDS.FIELD_TYPE_MULTI" + }, { + key: DATE_TYPE, + name: "ADMIN.CUSTOM_FIELDS.FIELD_TYPE_DATE" + } + ]; + CustomAttributesValuesController = (function(superClass) { extend(CustomAttributesValuesController, superClass); @@ -5420,36 +5686,63 @@ }; }; - module.directive("tgCustomAttributesValues", ["$tgTemplate", "$tgStorage", CustomAttributesValuesDirective]); + module.directive("tgCustomAttributesValues", ["$tgTemplate", "$tgStorage", "$translate", CustomAttributesValuesDirective]); - CustomAttributeValueDirective = function($template, $selectedText, $compile) { + CustomAttributeValueDirective = function($template, $selectedText, $compile, $translate, datePickerConfigService) { var link, template, templateEdit; template = $template.get("custom-attributes/custom-attribute-value.html", true); templateEdit = $template.get("custom-attributes/custom-attribute-value-edit.html", true); link = function($scope, $el, $attrs, $ctrl) { - var attributeValue, isEditable, render, saveAttributeValue, submit; + var attributeValue, isEditable, prettyDate, render, setFocusAndSelectOnInputField, submit; + prettyDate = $translate.instant("COMMON.PICKERDATE.FORMAT"); render = function(attributeValue, edit) { - var ctx, editable, html, value; + var ctx, datePickerConfig, editable, html, value; if (edit == null) { edit = false; } - value = attributeValue.value; + if (attributeValue.type === DATE_TYPE && attributeValue.value) { + value = moment(attributeValue.value, "YYYY-MM-DD").format(prettyDate); + } else { + value = attributeValue.value; + } editable = isEditable(); ctx = { id: attributeValue.id, name: attributeValue.name, description: attributeValue.description, value: value, - isEditable: editable + isEditable: editable, + type: attributeValue.type }; if (editable && (edit || !value)) { html = templateEdit(ctx); html = $compile(html)($scope); + $el.html(html); + if (attributeValue.type === DATE_TYPE) { + datePickerConfig = datePickerConfigService.get(); + _.merge(datePickerConfig, { + field: $el.find("input[name=value]")[0], + onSelect: (function(_this) { + return function(date) { + var selectedDate; + return selectedDate = date; + }; + })(this), + onOpen: (function(_this) { + return function() { + if (typeof selectedDate !== "undefined" && selectedDate !== null) { + return $el.picker.setDate(selectedDate); + } + }; + })(this) + }); + return $el.picker = new Pikaday(datePickerConfig); + } } else { html = template(ctx); html = $compile(html)($scope); + return $el.html(html); } - return $el.html(html); }; isEditable = function() { var permissions, requiredEditionPerm; @@ -5457,22 +5750,30 @@ requiredEditionPerm = $attrs.requiredEditionPerm; return permissions.indexOf(requiredEditionPerm) > -1; }; - saveAttributeValue = function() { - attributeValue.value = $el.find("input").val(); - return $scope.$apply(function() { - return $ctrl.updateAttributeValue(attributeValue).then(function() { - return render(attributeValue, false); + submit = debounce(2000, (function(_this) { + return function(event) { + event.preventDefault(); + attributeValue.value = $el.find("input[name=value], textarea[name='value']").val(); + if (attributeValue.type === DATE_TYPE) { + if (moment(attributeValue.value, prettyDate).isValid()) { + attributeValue.value = moment(attributeValue.value, prettyDate).format("YYYY-MM-DD"); + } else { + attributeValue.value = ""; + } + } + return $scope.$apply(function() { + return $ctrl.updateAttributeValue(attributeValue).then(function() { + return render(attributeValue, false); + }); }); - }); + }; + })(this)); + setFocusAndSelectOnInputField = function() { + return $el.find("input[name='value'], textarea[name='value']").focus().select(); }; - $el.on("keyup", "input[name=description]", function(event) { - if (event.keyCode === 13) { - return submit(event); - } else if (event.keyCode === 27) { - return render(attributeValue, false); - } - }); - $el.on("click", ".custom-field-value.read-mode", function() { + attributeValue = $scope.$eval($attrs.tgCustomAttributeValue); + render(attributeValue); + $el.on("click", ".js-value-view-mode", function() { if (!isEditable()) { return; } @@ -5480,28 +5781,25 @@ return; } render(attributeValue, true); - $el.find("input[name='description']").focus().select(); - return $scope.$apply(); + return setFocusAndSelectOnInputField(); }); $el.on("click", "a.icon-edit", function(event) { event.preventDefault(); render(attributeValue, true); - $el.find("input[name='description']").focus().select(); - return $scope.$apply(); + return setFocusAndSelectOnInputField(); + }); + $el.on("keyup", "input[name=value], textarea[name='value']", function(event) { + if (event.keyCode === 13 && event.currentTarget.type !== "textarea") { + return submit(event); + } else if (event.keyCode === 27) { + return render(attributeValue, false); + } }); - submit = debounce(2000, (function(_this) { - return function(event) { - event.preventDefault(); - return saveAttributeValue(); - }; - })(this)); $el.on("submit", "form", submit); $el.on("click", "a.icon-floppy", submit); - $scope.$on("$destroy", function() { + return $scope.$on("$destroy", function() { return $el.off(); }); - attributeValue = $scope.$eval($attrs.tgCustomAttributeValue); - return render(attributeValue); }; return { link: link, @@ -5510,29 +5808,29 @@ }; }; - module.directive("tgCustomAttributeValue", ["$tgTemplate", "$selectedText", "$compile", CustomAttributeValueDirective]); + module.directive("tgCustomAttributeValue", ["$tgTemplate", "$selectedText", "$compile", "$translate", "tgDatePickerConfigService", CustomAttributeValueDirective]); }).call(this); /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/estimation.coffee */ @@ -5739,7 +6037,7 @@ }; EstimationProcess.prototype.renderPointsSelector = function(roleId, target) { - var horizontalList, html, maxPointLength, points; + var horizontalList, html, maxPointLength, points, pop; points = _.map(this.points, (function(_this) { return function(point) { point = _.clone(point, true); @@ -5768,7 +6066,11 @@ this.$el.find(".pop-points-open").popover().open(function() { return $(this).removeClass("active").closest("li").removeClass("active"); }); - return this.$el.find(".pop-points-open").show(); + this.$el.find(".pop-points-open").show(); + pop = this.$el.find(".pop-points-open"); + if (pop.offset().top + pop.height() > document.body.clientHeight) { + return pop.addClass('pop-bottom'); + } }; return EstimationProcess; @@ -5794,23 +6096,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/filters.coffee */ @@ -5875,28 +6177,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/history.coffee */ (function() { - var HistoryController, HistoryDirective, bindOnce, debounce, module, taiga, trim, + var HistoryController, HistoryDirective, IGNORED_FIELDS, bindOnce, debounce, module, taiga, trim, extend = 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; }, hasProp = {}.hasOwnProperty; @@ -5910,6 +6212,11 @@ module = angular.module("taigaCommon"); + IGNORED_FIELDS = { + "userstories.userstory": ["watchers", "kanban_order", "backlog_order", "sprint_order", "finish_date"], + "tasks.task": ["watchers", "us_order", "taskboard_order"] + }; + HistoryController = (function(superClass) { extend(HistoryController, superClass); @@ -5971,7 +6278,7 @@ })(taiga.Controller); - HistoryDirective = function($log, $loading, $qqueue, $template, $confirm, $translate, $compile) { + HistoryDirective = function($log, $loading, $qqueue, $template, $confirm, $translate, $compile, $navUrls, $rootScope) { var link, templateActivity, templateBase, templateBaseEntries, templateChangeAttachment, templateChangeDiff, templateChangeGeneric, templateChangeList, templateChangePoints, templateDeletedComment, templateFn; templateChangeDiff = $template.get("common/history/history-change-diff.html", true); templateChangePoints = $template.get("common/history/history-change-points.html", true); @@ -5983,7 +6290,7 @@ templateBaseEntries = $template.get("common/history/history-base-entries.html", true); templateBase = $template.get("common/history/history-base.html", true); link = function($scope, $el, $attrs, $ctrl) { - var countChanges, formatChange, getHumanizedFieldName, getPrettyDateFormat, getUserAvatar, getUserFullName, objectId, renderActivity, renderAttachmentEntry, renderChange, renderChangeEntries, renderChangeEntry, renderChangesHelperText, renderComment, renderComments, renderCustomAttributesEntry, renderHistory, save, showAllActivity, showAllComments, type; + var countChanges, formatChange, getHumanizedFieldName, getPrettyDateFormat, objectId, renderActivity, renderAttachmentEntry, renderChange, renderChangeEntries, renderChangeEntry, renderChangesHelperText, renderComment, renderComments, renderCustomAttributesEntry, renderHistory, save, showAllActivity, showAllComments, type; type = $attrs.type; objectId = null; showAllComments = false; @@ -6035,17 +6342,6 @@ }; return humanizedFieldNames[field] || field; }; - getUserFullName = function(userId) { - var ref; - return (ref = $scope.usersById[userId]) != null ? ref.full_name_display : void 0; - }; - getUserAvatar = function(userId) { - if ($scope.usersById[userId] != null) { - return $scope.usersById[userId].photo; - } else { - return "/images/unnamed.png"; - } - }; countChanges = function(comment) { return _.keys(comment.values_diff).length; }; @@ -6197,6 +6493,11 @@ } }; renderChangeEntries = function(change) { + var changeModel; + changeModel = change.key.split(":")[0]; + if (IGNORED_FIELDS[changeModel] != null) { + change.values_diff = _.removeKeys(change.values_diff, IGNORED_FIELDS[changeModel]); + } return _.map(change.values_diff, function(value, field) { return renderChangeEntry(field, value); }); @@ -6222,8 +6523,11 @@ return html[0].outerHTML; } html = templateActivity({ - avatar: getUserAvatar(comment.user.pk), + avatar: comment.user.photo, userFullName: comment.user.name, + userProfileUrl: comment.user.is_active ? $navUrls.resolve("user-profile", { + username: comment.user.username + }) : "", creationDate: moment(comment.created_at).format(getPrettyDateFormat()), comment: comment.comment_html, changesText: renderChangesHelperText(comment), @@ -6240,8 +6544,11 @@ renderChange = function(change) { var ref; return templateActivity({ - avatar: getUserAvatar(change.user.pk), + avatar: change.user.photo, userFullName: change.user.name, + userProfileUrl: change.user.is_active ? $navUrls.resolve("user-profile", { + username: change.user.username + }) : "", creationDate: moment(change.created_at).format(getPrettyDateFormat()), comment: change.comment_html, changes: renderChangeEntries(change), @@ -6299,6 +6606,7 @@ $el.find(".comment-list").addClass("activeanimation"); currentLoading = $loading().target(target).start(); onSuccess = function() { + $rootScope.$broadcast("comment:new"); return $ctrl.loadHistory(type, objectId)["finally"](function() { return currentLoading.finish(); }); @@ -6322,6 +6630,15 @@ target = angular.element(event.currentTarget); return save(target); })); + $el.on("click", "a", function(event) { + var href, target; + target = angular.element(event.target); + href = target.attr('href'); + if (href && href.indexOf("#") === 0) { + event.preventDefault(); + return $('body').scrollTop($(href).offset().top); + } + }); $el.on("click", ".show-more", function(event) { var target; event.preventDefault(); @@ -6360,8 +6677,12 @@ return $(this).addClass('active'); }); $el.on("click", ".history-tabs li a", function(event) { - $el.find(".history-tabs li a").toggleClass("active"); - return $el.find(".history section").toggleClass("hidden"); + var target; + target = angular.element(event.currentTarget); + $el.find(".history-tabs li a").removeClass("active"); + target.addClass("active"); + $el.find(".history section").addClass("hidden"); + return $el.find(".history section." + (target.data('section-class'))).removeClass("hidden"); }); $el.on("click", ".comment-delete", debounce(2000, function(event) { var activityId, target; @@ -6398,29 +6719,29 @@ }; }; - module.directive("tgHistory", ["$log", "$tgLoading", "$tgQqueue", "$tgTemplate", "$tgConfirm", "$translate", "$compile", HistoryDirective]); + module.directive("tgHistory", ["$log", "$tgLoading", "$tgQqueue", "$tgTemplate", "$tgConfirm", "$translate", "$compile", "$tgNavUrls", "$rootScope", HistoryDirective]); }).call(this); /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/importer.coffee */ @@ -6489,28 +6810,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/lightboxes.coffee */ (function() { - var AssignedToLightboxDirective, BlockLightboxDirective, BlockingMessageInputDirective, CreateBulkUserstoriesDirective, CreateEditUserstoryDirective, LightboxDirective, LightboxKeyboardNavigationService, LightboxService, WatchersLightboxDirective, bindOnce, debounce, module, timeout, + var AssignedToLightboxDirective, AttachmentPreviewLightboxDirective, BlockLightboxDirective, BlockingMessageInputDirective, CreateBulkUserstoriesDirective, CreateEditUserstoryDirective, LightboxDirective, LightboxKeyboardNavigationService, LightboxService, WatchersLightboxDirective, bindOnce, debounce, module, timeout, extend = 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; }, hasProp = {}.hasOwnProperty; @@ -6535,15 +6856,15 @@ defered = this.q.defer(); lightboxContent = $el.children().not(".close"); lightboxContent.hide(); - $el.css('display', 'flex'); - this.animationFrame.add((function(_this) { - return function() { - $el.addClass("open"); - return _this.animationFrame.add(function() { - return $el.find('input,textarea').first().focus(); - }); - }; - })(this)); + this.animationFrame.add(function() { + return $el.css('display', 'flex'); + }); + this.animationFrame.add(function() { + return $el.addClass("open"); + }); + this.animationFrame.add(function() { + return $el.find('input,textarea').first().focus(); + }); this.animationFrame.add((function(_this) { return function() { lightboxContent.show(); @@ -6998,7 +7319,7 @@ }; html = usersTemplate(ctx); html = $compile(html)($scope); - return $el.find("div.watchers").html(html); + return $el.find(".assigned-to-list").html(html); }; closeLightbox = function() { lightboxKeyboardNavigationService.stop(); @@ -7021,7 +7342,7 @@ return $el.find('input').focus(); } }); - $el.on("click", ".watcher-single", function(event) { + $el.on("click", ".user-list-single", function(event) { var target; event.preventDefault(); target = angular.element(event.currentTarget); @@ -7059,7 +7380,7 @@ module.directive("tgLbAssignedto", ["lightboxService", "lightboxKeyboardNavigationService", "$tgTemplate", "$compile", AssignedToLightboxDirective]); - WatchersLightboxDirective = function($repo, lightboxService, lightboxKeyboardNavigationService, $template) { + WatchersLightboxDirective = function($repo, lightboxService, lightboxKeyboardNavigationService, $template, $compile) { var link; link = function($scope, $el, $attrs) { var closeLightbox, getFilteredUsers, render, selectedItem, usersTemplate; @@ -7093,7 +7414,8 @@ showMore: users.length > 5 }; html = usersTemplate(ctx); - return $el.find("div.watchers").html(html); + html = $compile(html)($scope); + return $el.find(".ticket-watchers").html(html); }; closeLightbox = function() { lightboxKeyboardNavigationService.stop(); @@ -7118,7 +7440,7 @@ render(users); return $el.find("input").focus(); }); - $el.on("click", ".watcher-single", debounce(2000, function(event) { + $el.on("click", ".user-list-single", debounce(2000, function(event) { var target; closeLightbox(); event.preventDefault(); @@ -7145,31 +7467,62 @@ }; }; - module.directive("tgLbWatchers", ["$tgRepo", "lightboxService", "lightboxKeyboardNavigationService", "$tgTemplate", WatchersLightboxDirective]); + module.directive("tgLbWatchers", ["$tgRepo", "lightboxService", "lightboxKeyboardNavigationService", "$tgTemplate", "$compile", WatchersLightboxDirective]); + + AttachmentPreviewLightboxDirective = function($repo, lightboxService, lightboxKeyboardNavigationService, $template, $compile) { + var link; + link = function($scope, $el, attrs) { + var render, template; + template = $template.get("common/lightbox/lightbox-attachment-preview.html", true); + $scope.$on("attachment:preview", function(event, attachment) { + lightboxService.open($el); + return render(attachment); + }); + $scope.$on("$destroy", function() { + return $el.off(); + }); + return render = function(attachment) { + var ctx, html; + ctx = { + url: attachment.url, + title: attachment.description, + name: attachment.name + }; + html = template(ctx); + html = $compile(html)($scope); + return $el.html(html); + }; + }; + return { + link: link + }; + }; + + module.directive("tgLbAttachmentPreview", ["$tgRepo", "lightboxService", "lightboxKeyboardNavigationService", "$tgTemplate", "$compile", AttachmentPreviewLightboxDirective]); }).call(this); /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino - * Copyright (C) 2014 Juan Francisco Alcántara - * Copyright (C) 2014 Alejandro Alonso -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * Copyright (C) 2014-2015 Juan Francisco Alcántara + * Copyright (C) 2014-2015 Alejandro Alonso + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/loader.coffee */ @@ -7237,17 +7590,11 @@ return lastResponseDate = 0; }; autoClose = function() { - var intervalAuto, maxAuto, timeoutAuto; - maxAuto = 5000; - timeoutAuto = setTimeout((function() { - pageLoaded(); - return clearInterval(intervalAuto); - }), maxAuto); + var intervalAuto; return intervalAuto = setInterval((function() { if (lastResponseDate && requestCount === 0) { pageLoaded(); - clearInterval(intervalAuto); - return clearTimeout(timeoutAuto); + return clearInterval(intervalAuto); } }), 50); }; @@ -7293,23 +7640,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/lightboxes.coffee */ @@ -7319,7 +7666,7 @@ module = angular.module("taigaCommon"); - TgLoadingService = function() { + TgLoadingService = function($compile) { var spinner; spinner = "loading..."; return function() { @@ -7327,13 +7674,23 @@ service = { settings: { target: null, + scope: null, classes: [], - timeout: 0 + timeout: 0, + template: null }, target: function(target) { service.settings.target = target; return service; }, + scope: function(scope) { + service.settings.scope = scope; + return service; + }, + template: function(template) { + service.settings.template = template; + return service; + }, removeClasses: function() { var classess; classess = 1 <= arguments.length ? slice.call(arguments, 0) : []; @@ -7352,7 +7709,9 @@ }); timeoutId = setTimeout((function() { if (!target.hasClass('loading')) { - service.settings.oldContent = target.html(); + if (!service.settings.template) { + service.settings.template = target.html(); + } target.addClass('loading'); return target.html(spinner); } @@ -7370,8 +7729,11 @@ removeClasses.map(function(className) { return service.settings.target.addClass(className); }); - target.html(service.settings.oldContent); + target.html(service.settings.template); target.removeClass('loading'); + if (service.settings.scope) { + $compile(target.contents())(service.settings.scope); + } } return service; } @@ -7380,18 +7742,21 @@ }; }; + TgLoadingService.$inject = ["$compile"]; + module.factory("$tgLoading", TgLoadingService); LoadingDirective = function($loading) { var link; link = function($scope, $el, attr) { - var currentLoading; + var currentLoading, template; currentLoading = null; + template = $el.html(); return $scope.$watch(attr.tgLoading, (function(_this) { return function(showLoading) { if (showLoading) { - return currentLoading = $loading().target($el).start(); - } else { + return currentLoading = $loading().target($el).timeout(50).template(template).scope($scope).start(); + } else if (currentLoading) { return currentLoading.finish(); } }; @@ -7408,23 +7773,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/popovers.coffee */ @@ -7672,23 +8037,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/raven-logger.coffee */ @@ -7724,23 +8089,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/tags.coffee */ @@ -8205,23 +8570,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/wisiwyg.coffee */ @@ -8339,6 +8704,9 @@ break; } } + if (!result) { + return; + } regex = />>>/gi; endIndex = 0; while (true) { @@ -8379,12 +8747,18 @@ onEnter: { keepDefault: false, replaceWith: function() { - return "\n"; + if (!$('.textcomplete-dropdown').is(':visible')) { + return "\n"; + } }, afterInsert: function(data) { var cursorLine, emptyListItem, lastLine, lines, markdownCaretPositon, match, newLineContent, nline, replace; lines = data.textarea.value.split("\n"); - cursorLine = data.textarea.value.slice(0, +(data.caretPosition - 1) + 1 || 9e9).split("\n").length; + if (data.caretPosition > 0) { + cursorLine = data.textarea.value.slice(0, +(data.caretPosition - 1) + 1 || 9e9).split("\n").length; + } else { + cursorLine = 1; + } newLineContent = data.textarea.value.slice(data.caretPosition).split("\n")[0]; lastLine = lines[cursorLine - 1]; match = lastLine.match(/^(\s*- ).*/); @@ -8531,7 +8905,115 @@ return $model.$setViewValue(target.val()); } }; - return element.markItUpRemove().markItUp(markdownSettings); + return element.markItUpRemove().markItUp(markdownSettings).textcomplete([ + { + cache: true, + match: /(^|\s)#([a-z0-9]+)$/i, + search: function(term, callback) { + var filter, searchProps, searchTypes; + term = taiga.slugify(term); + searchTypes = ['issues', 'tasks', 'userstories']; + searchProps = ['ref', 'subject']; + filter = (function(_this) { + return function(item) { + var j, len, prop; + for (j = 0, len = searchProps.length; j < len; j++) { + prop = searchProps[j]; + if (taiga.slugify(item[prop]).indexOf(term) >= 0) { + return true; + } + } + return false; + }; + })(this); + $rs.search["do"]($scope.projectId, term).then((function(_this) { + return function(res) { + var j, len, results, type; + if (res.count < 1 || res.count === res.wikipages.length) { + return callback([]); + } else { + results = []; + for (j = 0, len = searchTypes.length; j < len; j++) { + type = searchTypes[j]; + if (res[type] && res[type].length > 0) { + results.push(callback(res[type].filter(filter), true)); + } else { + results.push(void 0); + } + } + return results; + } + }; + })(this)); + return callback([]); + }, + replace: function(res) { + return "$1\#" + res.ref + " "; + }, + template: function(res, term) { + return "\#" + res.ref + " - " + res.subject; + } + }, { + cache: true, + match: /(^|\s)@([a-z0-9\-\._]{2,})$/i, + search: function(term, callback) { + var searchProps, username; + username = taiga.slugify(term); + searchProps = ['username', 'full_name', 'full_name_display']; + if ($scope.project.members.length < 1) { + return callback([]); + } else { + return callback($scope.project.members.filter((function(_this) { + return function(user) { + var j, len, prop; + for (j = 0, len = searchProps.length; j < len; j++) { + prop = searchProps[j]; + if (taiga.slugify(user[prop]).indexOf(username) >= 0) { + return true; + } + } + return false; + }; + })(this))); + } + }, + replace: function(user) { + return "$1@" + user.username + " "; + }, + template: function(user) { + return user.username + " - " + user.full_name_display; + } + }, { + cache: true, + match: /(^|\s)\[\[([a-z0-9\-]+)$/i, + search: function(term, callback) { + term = taiga.slugify(term); + return $rs.search["do"]($scope.projectId, term).then((function(_this) { + return function(res) { + if (res.count < 1) { + callback([]); + } + if (res.count < 1 || !res.wikipages || res.wikipages.length <= 0) { + callback([]); + } else { + callback(res.wikipages.filter(function(page) { + return taiga.slugify(page['slug']).indexOf(term) >= 0; + }), true); + } + return callback([]); + }; + })(this)); + }, + replace: function(res) { + return "$1[[" + res.slug + "]]"; + }, + template: function(res, term) { + return res.slug; + } + } + ], { + debounce: 200 + }); }; renderMarkItUp(); unbind = $rootscope.$on("$translateChangeEnd", renderMarkItUp); @@ -8555,23 +9037,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/backlog/main.coffee */ @@ -8594,12 +9076,13 @@ module = angular.module("taigaBacklog"); - BacklogFiltersDirective = function($log, $location, $templates) { + BacklogFiltersDirective = function($q, $log, $location, $templates) { var link, template, templateSelected; template = $templates.get("backlog/filters.html", true); templateSelected = $templates.get("backlog/filter-selected.html", true); link = function($scope, $el, $attrs) { - var $ctrl, initializeSelectedFilters, renderFilters, renderSelectedFilters, selectQFilter, selectedFilters, showCategories, showFilters, toggleFilterSelection; + var $ctrl, currentFiltersType, getFiltersType, initializeSelectedFilters, reloadUserstories, renderFilters, renderSelectedFilters, selectQFilter, selectedFilters, showCategories, showFilters, toggleFilterSelection; + currentFiltersType = ''; $ctrl = $el.closest(".wrapper").controller(); selectedFilters = []; showFilters = function(title, type) { @@ -8607,19 +9090,21 @@ $el.find(".filter-list").removeClass("hidden"); $el.find("h2.breadcrumb").removeClass("hidden"); $el.find("h2 a.subfilter span.title").html(title); - return $el.find("h2 a.subfilter span.title").prop("data-type", type); + $el.find("h2 a.subfilter span.title").prop("data-type", type); + return currentFiltersType = getFiltersType(); }; showCategories = function() { $el.find(".filters-cats").show(); $el.find(".filter-list").addClass("hidden"); return $el.find("h2.breadcrumb").addClass("hidden"); }; - initializeSelectedFilters = function(filters) { - var i, len, name, val, values; + initializeSelectedFilters = function() { + var i, len, name, ref, val, values; showCategories(); selectedFilters = []; - for (name in filters) { - values = filters[name]; + ref = $scope.filters; + for (name in ref) { + values = ref[name]; for (i = 0, len = values.length; i < len; i++) { val = values[i]; if (val.selected) { @@ -8657,11 +9142,23 @@ }); return $el.find(".filter-list").html(html); }; + getFiltersType = function() { + return $el.find("h2 a.subfilter span.title").prop('data-type'); + }; + reloadUserstories = function() { + currentFiltersType = getFiltersType(); + return $q.all([$ctrl.loadUserstories(), $ctrl.generateFilters()]).then(function() { + var currentFilters; + currentFilters = $scope.filters[currentFiltersType]; + return renderFilters(_.reject(currentFilters, "selected")); + }); + }; toggleFilterSelection = function(type, id) { - var currentFiltersType, filter, filters; + var filter, filters; + currentFiltersType = getFiltersType(); filters = $scope.filters[type]; filter = _.find(filters, { - id: taiga.toString(id) + id: id }); filter.selected = !filter.selected; if (filter.selected) { @@ -8670,17 +9167,16 @@ return $ctrl.selectFilter(type, id); }); } else { - selectedFilters = _.reject(selectedFilters, filter); - $scope.$apply(function() { - return $ctrl.unselectFilter(type, id); + selectedFilters = _.reject(selectedFilters, function(selected) { + return filter.type === selected.type && filter.id === selected.id; }); + $ctrl.unselectFilter(type, id); } renderSelectedFilters(selectedFilters); - currentFiltersType = $el.find("h2 a.subfilter span.title").prop('data-type'); if (type === currentFiltersType) { renderFilters(_.reject(filters, "selected")); } - return $ctrl.loadUserstories(); + return reloadUserstories(); }; selectQFilter = debounceLeading(100, function(value) { if (value === void 0) { @@ -8691,14 +9187,20 @@ } else { $ctrl.replaceFilter("q", value); } - return $ctrl.loadUserstories(); + return reloadUserstories(); }); $scope.$watch("filtersQ", selectQFilter); - $scope.$on("filters:loaded", function(ctx, filters) { - return initializeSelectedFilters(filters); + $scope.$on("backlog:loaded", function(ctx) { + return initializeSelectedFilters(); }); - $scope.$on("filters:update", function(ctx, filters) { - return renderFilters(filters); + $scope.$on("filters:update", function(ctx) { + return $ctrl.generateFilters().then(function() { + var filters; + filters = $scope.filters[currentFiltersType]; + if (currentFiltersType) { + return renderFilters(_.reject(filters, "selected")); + } + }); }); $el.on("click", ".filters-cats > ul > li > a", function(event) { var tags, target; @@ -8706,7 +9208,7 @@ target = angular.element(event.currentTarget); tags = $scope.filters[target.data("type")]; renderFilters(_.reject(tags, "selected")); - return showFilters(target.attr("title"), target.data("type")); + return showFilters(target.attr("title"), target.data('type')); }); $el.on("click", ".filters-inner > .filters-step-cat > .breadcrumb > .back", function(event) { event.preventDefault(); @@ -8739,29 +9241,29 @@ }; }; - module.directive("tgBacklogFilters", ["$log", "$tgLocation", "$tgTemplate", BacklogFiltersDirective]); + module.directive("tgBacklogFilters", ["$q", "$log", "$tgLocation", "$tgTemplate", BacklogFiltersDirective]); }).call(this); /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/backlog/lightboxes.coffee */ @@ -8779,14 +9281,16 @@ CreateEditSprint = function($repo, $confirm, $rs, $rootscope, lightboxService, $loading, $translate) { var link; link = function($scope, $el, attrs) { - var createSprint, hasErrors, remove, submit; + var createSprint, getLastSprint, hasErrors, remove, resetSprint, submit; hasErrors = false; createSprint = true; - $scope.sprint = { - project: null, - name: null, - estimated_start: null, - estimated_finish: null + resetSprint = function() { + return $scope.sprint = { + project: null, + name: null, + estimated_start: null, + estimated_finish: null + }; }; submit = debounce(2000, (function(_this) { return function(event) { @@ -8840,24 +9344,35 @@ title = $translate.instant("LIGHTBOX.DELETE_SPRINT.TITLE"); message = $scope.sprint.name; return $confirm.askOnDelete(title, message).then((function(_this) { - return function(finish) { + return function(askResponse) { var onError, onSuccess; onSuccess = function() { - finish(); + askResponse.finish(); $scope.milestonesCounter -= 1; lightboxService.close($el); - return $rootscope.$broadcast("sprintform:remove:success"); + return $rootscope.$broadcast("sprintform:remove:success", $scope.sprint); }; onError = function() { - finish(false); + askResponse.finish(false); return $confirm.notify("error"); }; return $repo.remove($scope.sprint).then(onSuccess, onError); }; })(this)); }; + getLastSprint = function() { + var openSprints, sortedSprints; + openSprints = _.filter($scope.sprints, function(sprint) { + return !sprint.closed; + }); + sortedSprints = _.sortBy(openSprints, function(sprint) { + return moment(sprint.estimated_finish, 'YYYY-MM-DD').format('X'); + }); + return sortedSprints[sortedSprints.length - 1]; + }; $scope.$on("sprintform:create", function(event, projectId) { var estimatedFinish, estimatedStart, form, lastSprint, lastSprintNameDom, prettyDate, text; + resetSprint(); form = $el.find("form").checksley(); form.reset(); createSprint = true; @@ -8865,19 +9380,19 @@ $scope.sprint.project = projectId; $scope.sprint.name = null; $scope.sprint.slug = null; - lastSprint = $scope.sprints[0]; + lastSprint = getLastSprint(); estimatedStart = moment(); - if ($scope.sprint.estimated_start) { - estimatedStart = moment($scope.sprint.estimated_start); - } else if (lastSprint != null) { + if (lastSprint) { estimatedStart = moment(lastSprint.estimated_finish); + } else if ($scope.sprint.estimated_start) { + estimatedStart = moment($scope.sprint.estimated_start); } $scope.sprint.estimated_start = estimatedStart.format(prettyDate); estimatedFinish = moment().add(2, "weeks"); - if ($scope.sprint.estimated_finish) { - estimatedFinish = moment($scope.sprint.estimated_finish); - } else if (lastSprint != null) { + if (lastSprint) { estimatedFinish = moment(lastSprint.estimated_finish).add(2, "weeks"); + } else if ($scope.sprint.estimated_finish) { + estimatedFinish = moment($scope.sprint.estimated_finish); } $scope.sprint.estimated_finish = estimatedFinish.format(prettyDate); lastSprintNameDom = $el.find(".last-sprint-name"); @@ -8898,6 +9413,7 @@ }); $scope.$on("sprintform:edit", function(ctx, sprint) { var editSprint, prettyDate, save; + resetSprint(); createSprint = false; prettyDate = $translate.instant("COMMON.PICKERDATE.FORMAT"); $scope.$apply(function() { @@ -8926,9 +9442,10 @@ event.preventDefault(); return remove(); }); - return $scope.$on("$destroy", function() { + $scope.$on("$destroy", function() { return $el.off(); }); + return resetSprint(); }; return { link: link @@ -8941,28 +9458,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/backlog/main.coffee */ (function() { - var BacklogController, BacklogDirective, BurndownBacklogGraphDirective, TgBacklogProgressBarDirective, UsPointsDirective, UsRolePointsSelectorDirective, bindMethods, bindOnce, groupBy, mixOf, module, scopeDefer, taiga, timeout, toggleText, + var BacklogController, BacklogDirective, BurndownBacklogGraphDirective, TgBacklogProgressBarDirective, ToggleBurndownVisibility, UsPointsDirective, UsRolePointsSelectorDirective, bindMethods, bindOnce, generateHash, groupBy, mixOf, module, scopeDefer, taiga, timeout, toggleText, extend = 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; }, hasProp = {}.hasOwnProperty; @@ -8982,6 +9499,8 @@ bindMethods = this.taiga.bindMethods; + generateHash = this.taiga.generateHash; + module = angular.module("taigaBacklog"); BacklogController = (function(superClass) { @@ -8989,9 +9508,9 @@ BacklogController.$inject = ["$scope", "$rootScope", "$tgRepo", "$tgConfirm", "$tgResources", "$routeParams", "$q", "$tgLocation", "tgAppMetaService", "$tgNavUrls", "$tgEvents", "$tgAnalytics", "$translate", "$tgLoading"]; - function BacklogController(scope, rootscope, repo, confirm, rs, params1, q, location, appMetaService, navUrls, events, analytics, translate, loading) { + function BacklogController(scope1, rootscope, repo, confirm, rs, params1, q, location, appMetaService, navUrls, events, analytics, translate, loading) { var promise; - this.scope = scope; + this.scope = scope1; this.rootscope = rootscope; this.repo = repo; this.confirm = confirm; @@ -9009,6 +9528,7 @@ this.scope.sectionName = this.translate.instant("BACKLOG.SECTION_NAME"); this.showTags = false; this.activeFilters = false; + this.scope.showGraphPlaceholder = null; this.initializeEventHandlers(); promise = this.loadInitialData(); promise.then((function(_this) { @@ -9050,6 +9570,7 @@ return function() { _this.loadUserstories(); _this.loadProjectStats(); + _this.rootscope.$broadcast("filters:update"); return _this.analytics.trackEvent("userstory", "create", "create userstory on backlog", 1); }; })(this)); @@ -9059,15 +9580,20 @@ }; })(this)); this.scope.$on("sprintform:remove:success", (function(_this) { - return function() { + return function(event, sprint) { _this.loadSprints(); _this.loadProjectStats(); - return _this.loadUserstories(); + _this.loadUserstories(); + if (sprint.closed) { + _this.loadClosedSprints(); + } + return _this.rootscope.$broadcast("filters:update"); }; })(this)); this.scope.$on("usform:edit:success", (function(_this) { return function() { - return _this.loadUserstories(); + _this.loadUserstories(); + return _this.rootscope.$broadcast("filters:update"); }; })(this)); this.scope.$on("sprint:us:move", this.moveUs); @@ -9110,25 +9636,20 @@ BacklogController.prototype.loadProjectStats = function() { return this.rs.projects.stats(this.scope.projectId).then((function(_this) { return function(stats) { + var totalPoints; _this.scope.stats = stats; - if (stats.total_points) { - _this.scope.stats.completedPercentage = Math.round(100 * stats.closed_points / stats.total_points); + totalPoints = stats.total_points ? stats.total_points : stats.defined_points; + if (totalPoints) { + _this.scope.stats.completedPercentage = Math.round(100 * stats.closed_points / totalPoints); } else { _this.scope.stats.completedPercentage = 0; } + _this.scope.showGraphPlaceholder = !((stats.total_points != null) && (stats.total_milestones != null)); return stats; }; })(this)); }; - BacklogController.prototype.refreshTagsColors = function() { - return this.rs.projects.tagsColors(this.scope.projectId).then((function(_this) { - return function(tags_colors) { - return _this.scope.project.tags_colors = tags_colors; - }; - })(this)); - }; - BacklogController.prototype.unloadClosedSprints = function() { return this.scope.$apply((function(_this) { return function() { @@ -9144,13 +9665,18 @@ closed: true }; return this.rs.sprints.list(this.scope.projectId, params).then((function(_this) { - return function(sprints) { - var j, len, sprint; + return function(result) { + var j, len, sprint, sprints; + sprints = result.milestones; + _this.scope.totalClosedMilestones = result.closed; for (j = 0, len = sprints.length; j < len; j++) { sprint = sprints[j]; sprint.user_stories = _.sortBy(sprint.user_stories, "sprint_order"); } _this.scope.closedSprints = sprints; + _this.scope.closedSprintsById = groupBy(sprints, function(x) { + return x.id; + }); _this.rootscope.$broadcast("closed-sprints:reloaded", sprints); return sprints; }; @@ -9163,8 +9689,13 @@ closed: false }; return this.rs.sprints.list(this.scope.projectId, params).then((function(_this) { - return function(sprints) { - var j, len, sprint; + return function(result) { + var j, len, sprint, sprints; + sprints = result.milestones; + _this.scope.totalMilestones = sprints; + _this.scope.totalClosedMilestones = result.closed; + _this.scope.totalOpenMilestones = result.open; + _this.scope.totalMilestones = _this.scope.totalOpenMilestones + _this.scope.totalClosedMilestones; for (j = 0, len = sprints.length; j < len; j++) { sprint = sprints[j]; sprint.user_stories = _.sortBy(sprint.user_stories, "sprint_order"); @@ -9189,7 +9720,7 @@ BacklogController.prototype.resetFilters = function() { var selectedStatuses, selectedTags; selectedTags = _.filter(this.scope.filters.tags, "selected"); - selectedStatuses = _.filter(this.scope.filters.statuses, "selected"); + selectedStatuses = _.filter(this.scope.filters.status, "selected"); this.scope.filtersQ = ""; _.each([selectedTags, selectedStatuses], (function(_this) { return function(filterGrp) { @@ -9204,23 +9735,19 @@ }); }; })(this)); - return this.loadUserstories(); + this.loadUserstories(); + return this.rootscope.$broadcast("filters:update"); }; BacklogController.prototype.loadUserstories = function() { var promise; this.scope.httpParams = this.getUrlFilters(); this.rs.userstories.storeQueryParams(this.scope.projectId, this.scope.httpParams); - promise = this.q.all([this.refreshTagsColors(), this.rs.userstories.listUnassigned(this.scope.projectId, this.scope.httpParams)]); + promise = this.rs.userstories.listUnassigned(this.scope.projectId, this.scope.httpParams); return promise.then((function(_this) { - return function(data) { - var userstories; - userstories = data[1]; + return function(userstories) { _this.scope.userstories = _.sortBy(userstories, "backlog_order"); _this.setSearchDataFilters(); - _this.filterVisibleUserstories(); - _this.generateFilters(); - _this.rootscope.$broadcast("filters:loaded", _this.scope.filters); scopeDefer(_this.scope, function() { return _this.scope.$broadcast("userstories:loaded"); }); @@ -9241,7 +9768,7 @@ } _this.scope.projectId = project.id; _this.scope.project = project; - _this.scope.totalClosedMilestones = project.total_closed_milestones; + _this.scope.closedMilestones = !!project.total_closed_milestones; _this.scope.$emit('project:loaded', project); _this.scope.points = _.sortBy(project.points, "order"); _this.scope.pointsById = groupBy(project.points, function(x) { @@ -9261,7 +9788,7 @@ promise = this.loadProject(); promise.then((function(_this) { return function(project) { - _this.fillUsersAndRoles(project.users, project.roles); + _this.fillUsersAndRoles(project.members, project.roles); return _this.initializeSubscription(); }; })(this)); @@ -9269,24 +9796,13 @@ return function() { return _this.loadBacklog(); }; - })(this)); - }; - - BacklogController.prototype.filterVisibleUserstories = function() { - this.scope.visibleUserstories = []; - this.scope.visibleUserstories = _.reject(this.scope.userstories, (function(_this) { - return function(us) { - return _.some(us.tags, function(tag) { - return _this.isFilterSelected("tag", tag); - }); + })(this)).then((function(_this) { + return function() { + return _this.generateFilters(); }; - })(this)); - return this.scope.visibleUserstories = _.filter(this.scope.visibleUserstories, (function(_this) { - return function(us) { - if (_this.searchdata["statuses"] && Object.keys(_this.searchdata["statuses"]).length) { - return _this.isFilterSelected("statuses", taiga.toString(us.status)); - } - return true; + })(this)).then((function(_this) { + return function() { + return _this.scope.$emit("backlog:loaded"); }; })(this)); }; @@ -9320,16 +9836,32 @@ }; BacklogController.prototype.moveUs = function(ctx, usList, newUsIndex, newSprintId) { - var data, items, j, l, len, len1, len2, m, newSprint, oldSprintId, project, promise, promises, us, userstories; + var data, items, j, l, len, len1, len2, m, movedFromClosedSprint, movedToClosedSprint, newSprint, oldSprintId, project, promise, promises, sprint, us, userstories; oldSprintId = usList[0].milestone; project = usList[0].project; + movedFromClosedSprint = false; + movedToClosedSprint = false; + sprint = this.scope.sprintsById[oldSprintId]; + if (!sprint && this.scope.closedSprintsById) { + sprint = this.scope.closedSprintsById[oldSprintId]; + if (sprint) { + movedFromClosedSprint = true; + } + } + newSprint = this.scope.sprintsById[newSprintId]; + if (!newSprint && newSprintId) { + newSprint = this.scope.closedSprintsById[newSprintId]; + if (newSprint) { + movedToClosedSprint = true; + } + } if (newSprintId === oldSprintId) { items = null; userstories = null; if (newSprintId === null) { userstories = this.scope.userstories; } else { - userstories = this.scope.sprintsById[newSprintId].user_stories; + userstories = newSprint.user_stories; } this.scope.$apply(function() { var args, j, key, len, r, us; @@ -9379,12 +9911,9 @@ } this.scope.$apply((function(_this) { return function() { - var args, key, l, len1, r, results, sprint; + var args, key, l, len1, r, results; args = [newUsIndex, 0].concat(usList); Array.prototype.splice.apply(_this.scope.userstories, args); - Array.prototype.splice.apply(_this.scope.visibleUserstories, args); - _this.filterVisibleUserstories(); - sprint = _this.scope.sprintsById[oldSprintId]; results = []; for (key = l = 0, len1 = usList.length; l < len1; key = ++l) { us = usList[key]; @@ -9400,7 +9929,10 @@ items = _this.resortUserStories(_this.scope.userstories, "backlog_order"); data = _this.prepareBulkUpdateData(items, "backlog_order"); return _this.rs.userstories.bulkUpdateBacklogOrder(us.project, data).then(function() { - return _this.rootscope.$broadcast("sprint:us:moved", us, oldSprintId, newSprintId); + _this.rootscope.$broadcast("sprint:us:moved", us, oldSprintId, newSprintId); + if (movedFromClosedSprint) { + return _this.rootscope.$broadcast("backlog:load-closed-sprints"); + } }); }; })(this)); @@ -9409,7 +9941,6 @@ }); return promise; } - newSprint = this.scope.sprintsById[newSprintId]; if (oldSprintId === null) { for (l = 0, len1 = usList.length; l < len1; l++) { us = usList[l]; @@ -9423,8 +9954,6 @@ results = []; for (key = m = 0, len2 = usList.length; m < len2; key = ++m) { us = usList[key]; - r = _this.scope.visibleUserstories.indexOf(us); - _this.scope.visibleUserstories.splice(r, 1); r = _this.scope.userstories.indexOf(us); results.push(_this.scope.userstories.splice(r, 1)); } @@ -9438,15 +9967,14 @@ } this.scope.$apply((function(_this) { return function() { - var args, len3, n, oldSprint, r, results; + var args, len3, n, r, results; args = [newUsIndex, 0].concat(usList); Array.prototype.splice.apply(newSprint.user_stories, args); results = []; for (n = 0, len3 = usList.length; n < len3; n++) { us = usList[n]; - oldSprint = _this.scope.sprintsById[oldSprintId]; - r = oldSprint.user_stories.indexOf(us); - results.push(oldSprint.user_stories.splice(r, 1)); + r = sprint.user_stories.indexOf(us); + results.push(sprint.user_stories.splice(r, 1)); } return results; }; @@ -9461,10 +9989,10 @@ return function() { items = _this.resortUserStories(newSprint.user_stories, "sprint_order"); data = _this.prepareBulkUpdateData(items, "sprint_order"); - _this.rs.userstories.bulkUpdateSprintOrder(project, data).then(function() { + _this.rs.userstories.bulkUpdateSprintOrder(project, data).then(function(result) { return _this.rootscope.$broadcast("sprint:us:moved", us, oldSprintId, newSprintId); }); - return _this.rs.userstories.bulkUpdateBacklogOrder(project, data).then(function() { + _this.rs.userstories.bulkUpdateBacklogOrder(project, data).then(function() { var len3, n, results; results = []; for (n = 0, len3 = usList.length; n < len3; n++) { @@ -9473,6 +10001,9 @@ } return results; }); + if (movedToClosedSprint || movedFromClosedSprint) { + return _this.scope.$broadcast("backlog:load-closed-sprints"); + } }; })(this)); promise.then(null, function() { @@ -9516,79 +10047,97 @@ }; BacklogController.prototype.getUrlFilters = function() { - return _.pick(this.location.search(), "statuses", "tags", "q"); + return _.pick(this.location.search(), "status", "tags", "q"); }; BacklogController.prototype.generateFilters = function() { - var plainStatuses, plainTags, selectedStatuses, selectedTags, urlfilters; + var loadFilters, urlfilters; urlfilters = this.getUrlFilters(); this.scope.filters = {}; - plainTags = _.flatten(_.filter(_.map(this.scope.visibleUserstories, "tags"))); - plainTags.sort(); - if (plainTags.length === 0 && urlfilters["tags"]) { - plainTags.push(urlfilters["tags"]); - } - this.scope.filters.tags = _.map(_.countBy(plainTags), (function(_this) { - return function(v, k) { - var obj; - obj = { - id: k, - type: "tags", - name: k, - color: _this.scope.project.tags_colors[k], - count: v + loadFilters = {}; + loadFilters.project = this.scope.projectId; + loadFilters.tags = urlfilters.tags; + loadFilters.status = urlfilters.status; + loadFilters.q = urlfilters.q; + loadFilters.milestone = 'null'; + return this.rs.userstories.filtersData(loadFilters).then((function(_this) { + return function(data) { + var choicesFiltersFormat, selectedStatuses, selectedTags, tagsFilterFormat; + choicesFiltersFormat = function(choices, type, byIdObject) { + return _.map(choices, function(t) { + t.type = type; + return t; + }); }; - if (_this.isFilterSelected("tags", obj.id)) { - obj.selected = true; - } - return obj; - }; - })(this)); - selectedTags = _.filter(this.scope.filters.tags, "selected"); - selectedTags = _.map(selectedTags, "name"); - plainStatuses = _.map(this.scope.visibleUserstories, "status"); - plainStatuses = _.filter(plainStatuses, (function(_this) { - return function(status) { - if (status) { - return status; - } - }; - })(this)); - if (plainStatuses.length === 0 && urlfilters["statuses"]) { - plainStatuses.push(urlfilters["statuses"]); - } - this.scope.filters.statuses = _.map(_.countBy(plainStatuses), (function(_this) { - return function(v, k) { - var obj; - obj = { - id: k, - type: "statuses", - name: _this.scope.usStatusById[k].name, - color: _this.scope.usStatusById[k].color, - count: v + tagsFilterFormat = function(tags) { + return _.map(tags, function(t) { + t.id = t.name; + t.type = 'tags'; + return t; + }); }; - if (_this.isFilterSelected("statuses", obj.id)) { - obj.selected = true; - } - return obj; + _this.scope.filters.status = choicesFiltersFormat(data.statuses, "status", _this.scope.usStatusById); + _this.scope.filters.tags = tagsFilterFormat(data.tags); + selectedTags = _.filter(_this.scope.filters.tags, "selected"); + selectedTags = _.map(selectedTags, "id"); + selectedStatuses = _.filter(_this.scope.filters.status, "selected"); + selectedStatuses = _.map(selectedStatuses, "id"); + _this.markSelectedFilters(_this.scope.filters, urlfilters); + return _this.rs.userstories.storeQueryParams(_this.scope.projectId, { + "status": selectedStatuses, + "tags": selectedTags, + "project": _this.scope.projectId, + "milestone": null + }); }; })(this)); - selectedStatuses = _.filter(this.scope.filters.statuses, "selected"); - selectedStatuses = _.map(selectedStatuses, "id"); - return this.rs.userstories.storeQueryParams(this.scope.projectId, { - "status": selectedStatuses, - "tags": selectedTags, - "project": this.scope.projectId, - "milestone": null - }); + }; + + BacklogController.prototype.markSelectedFilters = function(filters, urlfilters) { + var isSelected, j, key, len, name, obj, ref1, ref2, results, searchdata, val, value; + searchdata = {}; + ref1 = _.omit(urlfilters, "page", "orderBy"); + for (name in ref1) { + value = ref1[name]; + if (searchdata[name] == null) { + searchdata[name] = {}; + } + ref2 = ("" + value).split(","); + for (j = 0, len = ref2.length; j < len; j++) { + val = ref2[j]; + searchdata[name][val] = true; + } + } + isSelected = function(type, id) { + if ((searchdata[type] != null) && searchdata[type][id]) { + return true; + } + return false; + }; + results = []; + for (key in filters) { + value = filters[key]; + results.push((function() { + var l, len1, results1; + results1 = []; + for (l = 0, len1 = value.length; l < len1; l++) { + obj = value[l]; + results1.push(obj.selected = isSelected(obj.type, obj.id) ? true : void 0); + } + return results1; + })()); + } + return results; }; BacklogController.prototype.updateUserStoryStatus = function() { this.setSearchDataFilters(); - this.filterVisibleUserstories(); - this.generateFilters(); - this.rootscope.$broadcast("filters:update", this.scope.filters['statuses']); - return this.loadProjectStats(); + return this.generateFilters().then((function(_this) { + return function() { + _this.rootscope.$broadcast("filters:update"); + return _this.loadProjectStats(); + }; + })(this)); }; BacklogController.prototype.editUserStory = function(projectId, ref, $event) { @@ -9608,17 +10157,16 @@ title = this.translate.instant("US.TITLE_DELETE_ACTION"); message = us.subject; return this.confirm.askOnDelete(title, message).then((function(_this) { - return function(finish) { + return function(askResponse) { var promise; _this.scope.userstories = _.without(_this.scope.userstories, us); - _this.filterVisibleUserstories(); promise = _this.repo.remove(us); promise.then(function() { - finish(); + askResponse.finish(); return _this.loadBacklog(); }); return promise.then(null, function() { - finish(false); + askResponse.finish(false); return _this.confirm.notify("error"); }); }; @@ -9651,15 +10199,15 @@ var addDoomLineDom, getUsItems, reloadDoomLine, removeDoomlineDom; reloadDoomLine = function() { var current_sum, domElement, i, j, len, ref1, results, stats, total_points, us; - if ($scope.stats != null) { + if (($scope.stats != null) && ($scope.stats.total_points != null) && $scope.stats.total_points !== 0) { removeDoomlineDom(); stats = $scope.stats; total_points = stats.total_points; current_sum = stats.assigned_points; - if (!$scope.visibleUserstories) { + if (!$scope.userstories) { return; } - ref1 = $scope.visibleUserstories; + ref1 = $scope.userstories; results = []; for (i = j = 0, len = ref1.length; j < len; i = ++j) { us = ref1[i]; @@ -9709,7 +10257,6 @@ }); $scope.sprints[0].user_stories = _.union($scope.sprints[0].user_stories, selectedUss); $scope.sprints[0].total_points += totalExtraPoints; - $ctrl.filterVisibleUserstories(); return $repo.saveAll(selectedUss).then(function() { $ctrl.loadSprints(); return $ctrl.loadProjectStats(); @@ -9721,7 +10268,7 @@ var moveToCurrentSprintDom, selectedUsDom; lastChecked = target.closest(".us-item-row"); moveToCurrentSprintDom = $el.find("#move-to-current-sprint"); - selectedUsDom = $el.find(".backlog-table-body .user-stories input:checkbox:checked"); + selectedUsDom = $el.find(".backlog-table-body input:checkbox:checked"); if (selectedUsDom.length > 0 && $scope.sprints.length > 0) { moveToCurrentSprintDom.show(); } else { @@ -9733,7 +10280,7 @@ shiftPressed = !!event.shiftKey; return true; }); - $el.on("change", ".backlog-table-body .user-stories input:checkbox", function(event) { + $el.on("change", ".backlog-table-body input:checkbox", function(event) { var current, elements, nextAll, prevAll, target; if (lastChecked && shiftPressed) { elements = []; @@ -9757,12 +10304,13 @@ }); } target = angular.element(event.currentTarget); + target.closest(".us-item-row").toggleClass('is-checked'); return checkSelected(target); }); $el.on("click", "#move-to-current-sprint", (function(_this) { return function(event) { var ussDom, ussToMove; - ussDom = $el.find(".backlog-table-body .user-stories input:checkbox:checked"); + ussDom = $el.find(".backlog-table-body input:checkbox:checked"); ussToMove = _.map(ussDom, function(item) { var itemScope; item = $(item).closest('.tg-scope'); @@ -9785,11 +10333,11 @@ if ($ctrl.showTags) { elm.addClass("active"); text = $translate.instant("BACKLOG.TAGS.HIDE"); - return elm.find(".text").text(text); + return elm.text(text); } else { elm.removeClass("active"); text = $translate.instant("BACKLOG.TAGS.SHOW"); - return elm.find(".text").text(text); + return elm.text(text); } }; showHideFilter = function($scope, $el, $ctrl) { @@ -9830,7 +10378,7 @@ linkDoomLine($scope, $el, $attrs, $ctrl); $el.find(".backlog-table-body").disableSelection(); filters = $ctrl.getUrlFilters(); - if (filters.statuses || filters.tags || filters.q) { + if (filters.status || filters.tags || filters.q) { showHideFilter($scope, $el, $ctrl); } $scope.$on("showTags", function() { @@ -10023,6 +10571,56 @@ module.directive("tgBacklogUsPoints", ["$tgEstimationsService", "$tgRepo", "$tgTemplate", UsPointsDirective]); + ToggleBurndownVisibility = function($storage) { + var hide, link, show; + hide = function() { + $(".js-burndown-graph").removeClass("shown"); + $(".js-toggle-burndown-visibility-button").removeClass("active"); + return $(".js-burndown-graph").removeClass("open"); + }; + show = function(firstLoad) { + $(".js-toggle-burndown-visibility-button").addClass("active"); + if (firstLoad) { + return $(".js-burndown-graph").addClass("shown"); + } else { + return $(".js-burndown-graph").addClass("open"); + } + }; + link = function($scope, $el, $attrs) { + var firstLoad, hash, toggleGraph; + firstLoad = true; + hash = generateHash(["is-burndown-grpahs-collapsed"]); + $scope.isBurndownGraphCollapsed = $storage.get(hash) || false; + toggleGraph = function() { + if ($scope.isBurndownGraphCollapsed) { + hide(firstLoad); + } else { + show(firstLoad); + } + return firstLoad = false; + }; + $scope.$watch("showGraphPlaceholder", function() { + if ($scope.showGraphPlaceholder != null) { + $scope.isBurndownGraphCollapsed = $scope.isBurndownGraphCollapsed || $scope.showGraphPlaceholder; + return toggleGraph(); + } + }); + $el.on("click", ".js-toggle-burndown-visibility-button", function() { + $scope.isBurndownGraphCollapsed = !$scope.isBurndownGraphCollapsed; + $storage.set(hash, $scope.isBurndownGraphCollapsed); + return toggleGraph(); + }); + return $scope.$on("$destroy", function() { + return $el.off(); + }); + }; + return { + link: link + }; + }; + + module.directive("tgToggleBurndownVisibility", ["$tgStorage", ToggleBurndownVisibility]); + BurndownBacklogGraphDirective = function($translate) { var link, redrawChart; redrawChart = function(element, dataToDraw) { @@ -10135,26 +10733,26 @@ var ctx; if (flotItem.seriesIndex === 1) { ctx = { - xval: xval, - yval: yval + sprintName: dataToDraw.milestones[xval].name, + value: Math.abs(yval) }; return $translate.instant("BACKLOG.CHART.OPTIMAL", ctx); } else if (flotItem.seriesIndex === 2) { ctx = { - xval: xval, - yval: yval + sprintName: dataToDraw.milestones[xval].name, + value: Math.abs(yval) }; return $translate.instant("BACKLOG.CHART.REAL", ctx); } else if (flotItem.seriesIndex === 3) { ctx = { - xval: xval, - yval: Math.abs(yval) + sprintName: dataToDraw.milestones[xval].name, + value: Math.abs(yval) }; return $translate.instant("BACKLOG.CHART.INCREMENT_TEAM", ctx); } else { ctx = { - xval: xval, - yval: Math.abs(yval) + sprintName: dataToDraw.milestones[xval].name, + value: Math.abs(yval) }; return $translate.instant("BACKLOG.CHART.INCREMENT_CLIENT", ctx); } @@ -10186,14 +10784,17 @@ module.directive("tgBurndownBacklogGraph", ["$translate", BurndownBacklogGraphDirective]); - TgBacklogProgressBarDirective = function($template) { + TgBacklogProgressBarDirective = function($template, $compile) { var adjustPercentaje, link, render, template; template = $template.get("backlog/progress-bar.html", true); - render = function(el, projectPointsPercentaje, closedPointsPercentaje) { - return el.html(template({ + render = function(scope, el, projectPointsPercentaje, closedPointsPercentaje) { + var html; + html = template({ projectPointsPercentaje: projectPointsPercentaje, closedPointsPercentaje: closedPointsPercentaje - })); + }); + html = $compile(html)(scope); + return el.html(html); }; adjustPercentaje = function(percentage) { var adjusted; @@ -10207,7 +10808,7 @@ $scope.$watch($attrs.tgBacklogProgressBar, function(stats) { var closedPoints, closedPointsPercentaje, definedPoints, projectPointsPercentaje, totalPoints; if (stats != null) { - totalPoints = stats.total_points; + totalPoints = stats.total_points ? stats.total_points : stats.defined_points; definedPoints = stats.defined_points; closedPoints = stats.closed_points; if (definedPoints > totalPoints) { @@ -10219,7 +10820,7 @@ } projectPointsPercentaje = adjustPercentaje(projectPointsPercentaje - 3); closedPointsPercentaje = adjustPercentaje(closedPointsPercentaje - 3); - return render($el, projectPointsPercentaje, closedPointsPercentaje); + return render($scope, $el, projectPointsPercentaje, closedPointsPercentaje); } }); return $scope.$on("$destroy", function() { @@ -10231,29 +10832,29 @@ }; }; - module.directive("tgBacklogProgressBar", ["$tgTemplate", TgBacklogProgressBarDirective]); + module.directive("tgBacklogProgressBar", ["$tgTemplate", "$compile", TgBacklogProgressBarDirective]); }).call(this); /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/backlog/sortable.coffee */ @@ -10379,6 +10980,7 @@ bindOnce($scope, "project", function(project) { if (project.my_permissions.indexOf("modify_us") > -1) { $el.sortable({ + items: ".us-item-row", dropOnEmpty: true }); return $el.on("sortreceive", function(event, ui) { @@ -10466,23 +11068,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/backlog/sprints.coffee */ @@ -10494,29 +11096,19 @@ module = angular.module("taigaBacklog"); BacklogSprintDirective = function($repo, $rootscope) { - var link, refreshSprintTableHeight, slideOptions, sprintTableMinHeight, toggleSprint; + var link, slideOptions, sprintTableMinHeight, toggleSprint; sprintTableMinHeight = 50; slideOptions = { duration: 500, easing: 'linear' }; - refreshSprintTableHeight = (function(_this) { - return function(sprintTable) { - if (!sprintTable.find(".row").length) { - return sprintTable.css("height", sprintTableMinHeight); - } else { - return sprintTable.css("height", "auto"); - } - }; - })(this); toggleSprint = (function(_this) { return function($el) { var sprintArrow, sprintTable; sprintTable = $el.find(".sprint-table"); sprintArrow = $el.find(".icon-arrow-up"); sprintArrow.toggleClass('active'); - sprintTable.toggleClass('open'); - return refreshSprintTableHeight(sprintTable); + return sprintTable.toggleClass('open'); }; })(this); link = function($scope, $el, $attrs) { @@ -10650,23 +11242,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/taskboard/charts.coffee */ @@ -10820,23 +11412,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/taskboard/lightboxes.coffee */ @@ -10980,23 +11572,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/taskboard.coffee */ @@ -11145,7 +11737,7 @@ return e.id; }); _this.scope.$emit('project:loaded', project); - _this.fillUsersAndRoles(project.users, project.roles); + _this.fillUsersAndRoles(project.members, project.roles); return project; }; })(this)); @@ -11200,7 +11792,7 @@ TaskboardController.prototype.loadTasks = function() { return this.rs.tasks.list(this.scope.projectId, this.scope.sprintId).then((function(_this) { return function(tasks) { - var i, j, k, len, len1, len2, ref, ref1, ref2, status, task, us; + var i, j, k, len, len1, len2, ref, ref1, ref2, status, task, us, usId; _this.scope.tasks = _.sortBy(tasks, 'taskboard_order'); _this.scope.usTasks = {}; ref = _.union(_this.scope.userstories, [ @@ -11224,6 +11816,16 @@ _this.scope.usTasks[task.user_story][task.status].push(task); } } + if (tasks.length === 0) { + if (_this.scope.userstories.length > 0) { + usId = _this.scope.userstories[0].id; + } else { + usId = null; + } + _this.scope.usTasks[usId][_this.scope.taskStatusList[0].id].push({ + isPlaceholder: true + }); + } return tasks; }; })(this)); @@ -11570,23 +12172,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/taskboard/sortable.coffee */ @@ -11669,28 +12271,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/kanban/main.coffee */ (function() { - var KanbanArchivedStatusHeaderDirective, KanbanArchivedStatusIntroDirective, KanbanController, KanbanDirective, KanbanSquishColumnDirective, KanbanUserDirective, KanbanUserstoryDirective, KanbanWipLimitDirective, bindMethods, bindOnce, defaultViewMode, defaultViewModes, groupBy, mixOf, module, scopeDefer, taiga, timeout, toggleText, + var KanbanArchivedStatusHeaderDirective, KanbanArchivedStatusIntroDirective, KanbanController, KanbanDirective, KanbanSquishColumnDirective, KanbanUserDirective, KanbanUserstoryDirective, KanbanWipLimitDirective, bindMethods, bindOnce, defaultViewMode, groupBy, mixOf, module, scopeDefer, taiga, timeout, toggleText, viewModes, extend = 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; }, hasProp = {}.hasOwnProperty; @@ -11714,14 +12316,7 @@ defaultViewMode = "maximized"; - defaultViewModes = { - maximized: { - cardClass: "kanban-task-maximized" - }, - minimized: { - cardClass: "kanban-task-minimized" - } - }; + viewModes = ["maximized", "minimized"]; KanbanController = (function(superClass) { extend(KanbanController, superClass); @@ -11857,6 +12452,12 @@ } usByStatus[status.id] = _.sortBy(usByStatus[status.id], "kanban_order"); } + if (userstories.length === 0) { + status = _this.scope.usStatusList[0]; + usByStatus[status.id].push({ + isPlaceholder: true + }); + } _this.scope.usByStatus = usByStatus; scopeDefer(_this.scope, function() { return _this.scope.$broadcast("userstories:loaded", userstories); @@ -11928,7 +12529,7 @@ promise = this.loadProject(); return promise.then((function(_this) { return function(project) { - _this.fillUsersAndRoles(project.users, project.roles); + _this.fillUsersAndRoles(project.members, project.roles); _this.initializeSubscription(); return _this.loadKanban().then(function() { return _this.scope.$broadcast("redraw:wip"); @@ -11944,8 +12545,8 @@ ref = this.scope.usStatusList; for (i = 0, len = ref.length; i < len; i++) { status = ref[i]; - mode = storedStatusViewModes[status.id]; - this.scope.statusViewModes[status.id] = _.has(defaultViewModes, mode) ? mode : defaultViewMode; + mode = storedStatusViewModes[status.id] || defaultViewMode; + this.scope.statusViewModes[status.id] = mode; } return this.storeStatusViewModes(); }; @@ -11959,10 +12560,16 @@ return this.storeStatusViewModes(); }; - KanbanController.prototype.getCardClass = function(statusId) { + KanbanController.prototype.isMaximized = function(statusId) { var mode; mode = this.scope.statusViewModes[statusId] || defaultViewMode; - return defaultViewModes[mode].cardClass || defaultViewModes[defaultViewMode].cardClass; + return mode === 'maximized'; + }; + + KanbanController.prototype.isMinimized = function(statusId) { + var mode; + mode = this.scope.statusViewModes[statusId] || defaultViewMode; + return mode === 'minimized'; }; KanbanController.prototype.prepareBulkUpdateData = function(uses, field) { @@ -12056,17 +12663,17 @@ var hidden, status; status = $scope.$eval($attrs.tgKanbanArchivedStatusHeader); hidden = true; - $scope["class"] = "icon icon-open-eye"; + $scope["class"] = "icon-open-eye"; $scope.title = showArchivedText; $el.on("click", function(event) { hidden = !hidden; return $scope.$apply(function() { if (hidden) { - $scope["class"] = "icon icon-open-eye"; + $scope["class"] = "icon-open-eye"; $scope.title = showArchivedText; return $rootscope.$broadcast("kanban:hide-userstories-for-status", status.id); } else { - $scope["class"] = "icon icon-closed-eye"; + $scope["class"] = "icon-closed-eye"; $scope.title = hideArchivedText; return $rootscope.$broadcast("kanban:show-userstories-for-status", status.id); } @@ -12152,7 +12759,7 @@ return $el.removeClass("blocked"); } }); - $el.find(".icon-edit").on("click", function(event) { + $el.on('click', '.icon-edit', function(event) { var currentLoading, target, us; if ($el.find(".icon-edit").hasClass("noclick")) { return; @@ -12167,12 +12774,19 @@ }; })(this)); }); + $scope.getTemplateUrl = function() { + if ($scope.us.isPlaceholder) { + return "common/components/kanban-placeholder.html"; + } else { + return "kanban/kanban-task.html"; + } + }; return $scope.$on("$destroy", function() { return $el.off(); }); }; return { - templateUrl: "kanban/kanban-task.html", + template: '', link: link, require: "ngModel" }; @@ -12332,23 +12946,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/kanban/sortable.coffee */ @@ -12431,28 +13045,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/issues/detail.coffee */ (function() { - var IssueDetailController, IssuePriorityButtonDirective, IssueSeverityButtonDirective, IssueStatusButtonDirective, IssueStatusDisplayDirective, IssueTypeButtonDirective, PromoteIssueToUsButtonDirective, bindOnce, groupBy, joinStr, mixOf, module, taiga, toString, + var IssueDetailController, IssuePriorityButtonDirective, IssueSeverityButtonDirective, IssueStatusButtonDirective, IssueStatusDisplayDirective, IssueTypeButtonDirective, PromoteIssueToUsButtonDirective, bindMethods, bindOnce, groupBy, joinStr, mixOf, module, taiga, toString, extend = 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; }, hasProp = {}.hasOwnProperty; @@ -12468,6 +13082,8 @@ bindOnce = this.taiga.bindOnce; + bindMethods = this.taiga.bindMethods; + module = angular.module("taigaIssues"); IssueDetailController = (function(superClass) { @@ -12490,6 +13106,7 @@ this.analytics = analytics; this.navUrls = navUrls; this.translate = translate; + bindMethods(this); this.scope.issueRef = this.params.issueref; this.scope.sectionName = this.translate.instant("ISSUES.SECTION_NAME"); this.initializeEventHandlers(); @@ -12523,20 +13140,9 @@ IssueDetailController.prototype.initializeEventHandlers = function() { this.scope.$on("attachment:create", (function(_this) { return function() { - _this.rootscope.$broadcast("object:updated"); return _this.analytics.trackEvent("attachment", "create", "create attachment on issue", 1); }; })(this)); - this.scope.$on("attachment:edit", (function(_this) { - return function() { - return _this.rootscope.$broadcast("object:updated"); - }; - })(this)); - this.scope.$on("attachment:delete", (function(_this) { - return function() { - return _this.rootscope.$broadcast("object:updated"); - }; - })(this)); this.scope.$on("promote-issue-to-us:success", (function(_this) { return function() { _this.analytics.trackEvent("issue", "promoteToUserstory", "promote issue to userstory", 1); @@ -12544,6 +13150,11 @@ return _this.loadIssue(); }; })(this)); + this.scope.$on("comment:new", (function(_this) { + return function() { + return _this.loadIssue(); + }; + })(this)); return this.scope.$on("custom-attributes-values:edit", (function(_this) { return function() { return _this.rootscope.$broadcast("object:updated"); @@ -12585,9 +13196,6 @@ _this.scope.priorityById = groupBy(project.priorities, function(x) { return x.id; }); - _this.scope.membersById = groupBy(project.memberships, function(x) { - return x.user; - }); return project; }; })(this)); @@ -12623,12 +13231,88 @@ promise = this.loadProject(); return promise.then((function(_this) { return function(project) { - _this.fillUsersAndRoles(project.users, project.roles); + _this.fillUsersAndRoles(project.members, project.roles); return _this.loadIssue(); }; })(this)); }; + + /* + * Note: This methods (onUpvote() and onDownvote()) are related to tg-vote-button. + * See app/modules/components/vote-button for more info + */ + + IssueDetailController.prototype.onUpvote = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadIssue(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.issues.upvote(this.scope.issueId).then(onSuccess, onError); + }; + + IssueDetailController.prototype.onDownvote = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadIssue(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.issues.downvote(this.scope.issueId).then(onSuccess, onError); + }; + + + /* + * Note: This methods (onWatch() and onUnwatch()) are related to tg-watch-button. + * See app/modules/components/watch-button for more info + */ + + IssueDetailController.prototype.onWatch = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadIssue(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.issues.watch(this.scope.issueId).then(onSuccess, onError); + }; + + IssueDetailController.prototype.onUnwatch = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadIssue(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.issues.unwatch(this.scope.issueId).then(onSuccess, onError); + }; + return IssueDetailController; })(mixOf(taiga.Controller, taiga.PageMixin)); @@ -12992,7 +13676,7 @@ link = function($scope, $el, $attrs, $model) { var save; save = $qqueue.bindAdd((function(_this) { - return function(issue, finish) { + return function(issue, askResponse) { var data, onError, onSuccess; data = { generated_from_issue: issue.id, @@ -13004,12 +13688,12 @@ blocked_note: issue.blocked_note }; onSuccess = function() { - finish(); + askResponse.finish(); $confirm.notify("success"); return $rootScope.$broadcast("promote-issue-to-us:success"); }; onError = function() { - finish(false); + askResponse.finish(); return $confirm.notify("error"); }; return $repo.create("userstories", data).then(onSuccess, onError); @@ -13023,8 +13707,8 @@ message = $translate.instant("ISSUES.CONFIRM_PROMOTE.MESSAGE"); subtitle = issue.subject; return $confirm.ask(title, subtitle, message).then((function(_this) { - return function(finish) { - return save(issue, finish); + return function(response) { + return save(issue, response); }; })(this)); }); @@ -13046,23 +13730,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/issues/lightboxes.coffee */ @@ -13182,23 +13866,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/issues/list.coffee */ @@ -13277,8 +13961,7 @@ this.scope.$on("issueform:new:success", (function(_this) { return function() { _this.analytics.trackEvent("issue", "create", "create issue on issues list", 1); - _this.loadIssues(); - return _this.loadFilters(); + return _this.loadIssues(); }; })(this)); } @@ -13322,9 +14005,6 @@ _this.scope.issueTypeById = groupBy(project.issue_types, function(x) { return x.id; }); - _this.scope.membersById = groupBy(project.memberships, function(x) { - return x.user; - }); return project; }; })(this)); @@ -13332,7 +14012,7 @@ IssuesController.prototype.getUrlFilters = function() { var filters; - filters = _.pick(this.location.search(), "page", "tags", "statuses", "types", "q", "severities", "priorities", "assignedTo", "createdBy", "orderBy"); + filters = _.pick(this.location.search(), "page", "tags", "status", "types", "q", "severities", "priorities", "assignedTo", "createdBy", "orderBy"); if (!filters.page) { filters.page = 1; } @@ -13428,7 +14108,7 @@ }; IssuesController.prototype.loadFilters = function() { - var promise, urlfilters; + var loadFilters, promise, urlfilters; urlfilters = this.getUrlFilters(); if (urlfilters.q) { this.scope.filtersQ = urlfilters.q; @@ -13439,9 +14119,19 @@ return myFilters; }; })(this)); + loadFilters = {}; + loadFilters.project = this.scope.projectId; + loadFilters.tags = urlfilters.tags; + loadFilters.status = urlfilters.status; + loadFilters.q = urlfilters.q; + loadFilters.types = urlfilters.types; + loadFilters.severities = urlfilters.severities; + loadFilters.priorities = urlfilters.priorities; + loadFilters.assigned_to = urlfilters.assignedTo; + loadFilters.owner = urlfilters.createdBy; promise = promise.then((function(_this) { return function() { - return _this.rs.issues.filtersData(_this.scope.projectId); + return _this.rs.issues.filtersData(loadFilters); }; })(this)); return promise.then((function(_this) { @@ -13450,12 +14140,9 @@ usersFiltersFormat = function(users, type, unknownOption) { var reformatedUsers, unknownItem; reformatedUsers = _.map(users, function(t) { - return { - id: t[0], - count: t[1], - type: type, - name: t[0] ? _this.scope.usersById[t[0]].full_name_display : unknownOption - }; + t.type = type; + t.name = t.full_name ? t.full_name : unknownOption; + return t; }); unknownItem = _.remove(reformatedUsers, function(u) { return !u.id; @@ -13470,31 +14157,22 @@ }; choicesFiltersFormat = function(choices, type, byIdObject) { return _.map(choices, function(t) { - return { - id: t[0], - name: byIdObject[t[0]].name, - color: byIdObject[t[0]].color, - count: t[1], - type: type - }; + t.type = type; + return t; }); }; tagsFilterFormat = function(tags) { return _.map(tags, function(t) { - return { - id: t[0], - name: t[0], - color: _this.scope.project.tags_colors[t[0]], - count: t[1], - type: "tags" - }; + t.id = t.name; + t.type = 'tags'; + return t; }); }; - _this.scope.filters.statuses = choicesFiltersFormat(data.statuses, "statuses", _this.scope.issueStatusById); + _this.scope.filters.status = choicesFiltersFormat(data.statuses, "status", _this.scope.issueStatusById); _this.scope.filters.severities = choicesFiltersFormat(data.severities, "severities", _this.scope.severityById); _this.scope.filters.priorities = choicesFiltersFormat(data.priorities, "priorities", _this.scope.priorityById); _this.scope.filters.assignedTo = usersFiltersFormat(data.assigned_to, "assignedTo", "Unassigned"); - _this.scope.filters.createdBy = usersFiltersFormat(data.created_by, "createdBy", "Unknown"); + _this.scope.filters.createdBy = usersFiltersFormat(data.owners, "createdBy", "Unknown"); _this.scope.filters.types = choicesFiltersFormat(data.types, "types", _this.scope.issueTypeById); _this.scope.filters.tags = tagsFilterFormat(data.tags); _this.removeNotExistingFiltersFromUrl(); @@ -13523,7 +14201,7 @@ name = "assigned_to"; } else if (name === "createdBy") { name = "owner"; - } else if (name === "statuses") { + } else if (name === "status") { name = "status"; } else if (name === "types") { name = "type"; @@ -13533,7 +14211,7 @@ promise = this.rs.issues.list(this.scope.projectId, this.scope.httpParams); this.loadIssuesRequests += 1; promise.index = this.loadIssuesRequests; - return promise.then((function(_this) { + promise.then((function(_this) { return function(data) { if (promise.index === _this.loadIssuesRequests) { _this.scope.issues = data.models; @@ -13544,6 +14222,7 @@ return data; }; })(this)); + return promise; }; IssuesController.prototype.loadInitialData = function() { @@ -13551,9 +14230,10 @@ promise = this.loadProject(); return promise.then((function(_this) { return function(project) { - _this.fillUsersAndRoles(project.users, project.roles); + _this.fillUsersAndRoles(project.members, project.roles); _this.initializeSubscription(); - return _this.q.all([_this.loadFilters(), _this.loadIssues()]); + _this.loadFilters(); + return _this.loadIssues(); }; })(this)); }; @@ -13702,7 +14382,7 @@ var colHeadElement, currentOrder, icon; currentOrder = $ctrl.getUrlFilter("orderBy") || "created_date"; if (currentOrder) { - icon = startswith(currentOrder, "-") ? "icon-caret-up" : "icon-caret-down"; + icon = startswith(currentOrder, "-") ? "icon-arrow-up" : "icon-arrow-bottom"; colHeadElement = $el.find(".row.title > div[data-fieldname='" + (trim(currentOrder, "-")) + "']"); colHeadElement.html((colHeadElement.html()) + ""); } @@ -13717,7 +14397,7 @@ $ctrl.storeFilters(); return $ctrl.loadIssues().then(function() { $el.find(".row.title > div > span.icon").remove(); - icon = startswith(finalOrder, "-") ? "icon-caret-up" : "icon-caret-down"; + icon = startswith(finalOrder, "-") ? "icon-arrow-up" : "icon-arrow-bottom"; return target.html((target.html()) + ""); }); }); @@ -13739,12 +14419,12 @@ module.directive("tgIssues", ["$log", "$tgLocation", "$tgTemplate", "$compile", IssuesDirective]); - IssuesFiltersDirective = function($log, $location, $rs, $confirm, $loading, $template, $translate, $compile, $auth) { + IssuesFiltersDirective = function($q, $log, $location, $rs, $confirm, $loading, $template, $translate, $compile, $auth) { var link, template, templateSelected; template = $template.get("issue/issues-filters.html", true); templateSelected = $template.get("issue/issues-filters-selected.html", true); link = function($scope, $el, $attrs) { - var $ctrl, initializeSelectedFilters, renderFilters, renderSelectedFilters, selectQFilter, selectedFilters, showCategories, showFilters, toggleFilterSelection; + var $ctrl, getFiltersType, initializeSelectedFilters, reloadIssues, renderFilters, renderSelectedFilters, selectQFilter, selectedFilters, showCategories, showFilters, toggleFilterSelection; $ctrl = $el.closest(".wrapper").controller(); selectedFilters = []; showFilters = function(title, type) { @@ -13808,6 +14488,18 @@ html = $compile(html)($scope); return $el.find(".filter-list").html(html); }; + getFiltersType = function() { + return $el.find("h2 a.subfilter span.title").prop('data-type'); + }; + reloadIssues = function() { + var currentFiltersType; + currentFiltersType = getFiltersType(); + return $q.all([$ctrl.loadIssues(), $ctrl.loadFilters()]).then(function() { + var filters; + filters = $scope.filters[currentFiltersType]; + return renderFilters(_.reject(filters, "selected")); + }); + }; toggleFilterSelection = function(type, id) { var currentFiltersType, filter, filterId, filters; if (type === "myFilters") { @@ -13835,23 +14527,20 @@ } if (filter.selected) { selectedFilters.push(filter); - $scope.$apply(function() { - $ctrl.selectFilter(type, id); - $ctrl.selectFilter("page", 1); - $ctrl.storeFilters(); - return $ctrl.loadIssues(); - }); + $ctrl.selectFilter(type, id); + $ctrl.selectFilter("page", 1); + $ctrl.storeFilters(); } else { - selectedFilters = _.reject(selectedFilters, filter); - $scope.$apply(function() { - $ctrl.unselectFilter(type, id); - $ctrl.selectFilter("page", 1); - $ctrl.storeFilters(); - return $ctrl.loadIssues(); + selectedFilters = _.reject(selectedFilters, function(f) { + return f.id === filter.id && f.type === filter.type; }); + $ctrl.unselectFilter(type, id); + $ctrl.selectFilter("page", 1); + $ctrl.storeFilters(); } + reloadIssues(); renderSelectedFilters(selectedFilters); - currentFiltersType = $el.find("h2 a.subfilter span.title").prop('data-type'); + currentFiltersType = getFiltersType(); if (type === currentFiltersType) { return renderFilters(_.reject(filters, "selected")); } @@ -13862,7 +14551,7 @@ $scope.$on("filters:issueupdate", function(ctx, filters) { var html; html = template({ - filters: filters.statuses + filters: filters.status }); html = $compile(html)($scope); return $el.find(".filter-list").html(html); @@ -13879,7 +14568,7 @@ $ctrl.replaceFilter("q", value); $ctrl.storeFilters(); } - return $ctrl.loadIssues(); + return reloadIssues(); }); $scope.$watch("filtersQ", selectQFilter); $el.on("click", ".filters-cats > ul > li > a", function(event) { @@ -13924,22 +14613,22 @@ message = $translate.instant("ISSUES.FILTERS.CONFIRM_DELETE.MESSAGE", { customFilterName: customFilterName }); - return $confirm.askOnDelete(title, message).then(function(finish) { + return $confirm.askOnDelete(title, message).then(function(askResponse) { var promise; promise = $ctrl.deleteMyFilter(customFilterName); promise.then(function() { promise = $ctrl.loadMyFilters(); promise.then(function(filters) { - finish(); + askResponse.finish(); $scope.filters.myFilters = filters; return renderFilters($scope.filters.myFilters); }); return promise.then(null, function() { - return finish(); + return askResponse.finish(); }); }); return promise.then(null, function() { - finish(false); + askResponse.finish(false); return $confirm.notify("error"); }); }); @@ -13997,7 +14686,7 @@ }; }; - module.directive("tgIssuesFilters", ["$log", "$tgLocation", "$tgResources", "$tgConfirm", "$tgLoading", "$tgTemplate", "$translate", "$compile", "$tgAuth", IssuesFiltersDirective]); + module.directive("tgIssuesFilters", ["$q", "$log", "$tgLocation", "$tgResources", "$tgConfirm", "$tgLoading", "$tgTemplate", "$translate", "$compile", "$tgAuth", IssuesFiltersDirective]); IssueStatusInlineEditionDirective = function($repo, $template, $rootscope) { @@ -14039,7 +14728,7 @@ event.preventDefault(); event.stopPropagation(); target = angular.element(event.currentTarget); - ref = $scope.filters.statuses; + ref = $scope.filters.status; for (j = 0, len = ref.length; j < len; j++) { filter = ref[j]; if (filter.id === issue.status) { @@ -14052,18 +14741,9 @@ return $scope.$apply(function() { var k, len1, ref1; $repo.save(issue).then(function() { - var k, len1, ref1; - $ctrl.loadIssues(); - ref1 = $scope.filters.statuses; - for (k = 0, len1 = ref1.length; k < len1; k++) { - filter = ref1[k]; - if (filter.id === issue.status) { - filter.count++; - } - } - return $rootscope.$broadcast("filters:issueupdate", $scope.filters); + return $ctrl.loadIssues(); }); - ref1 = $scope.filters.statuses; + ref1 = $scope.filters.status; for (k = 0, len1 = ref1.length; k < len1; k++) { filter = ref1[k]; if (filter.id === issue.status) { @@ -14159,28 +14839,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/userstories/detail.coffee */ (function() { - var UsClientRequirementButtonDirective, UsStatusButtonDirective, UsStatusDisplayDirective, UsTasksProgressDisplayDirective, UsTeamRequirementButtonDirective, UserStoryDetailController, bindOnce, groupBy, mixOf, module, taiga, + var UsClientRequirementButtonDirective, UsStatusButtonDirective, UsStatusDisplayDirective, UsTasksProgressDisplayDirective, UsTeamRequirementButtonDirective, UserStoryDetailController, bindMethods, bindOnce, groupBy, mixOf, module, taiga, extend = 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; }, hasProp = {}.hasOwnProperty; @@ -14192,6 +14872,8 @@ bindOnce = this.taiga.bindOnce; + bindMethods = this.taiga.bindMethods; + module = angular.module("taigaUserStories"); UserStoryDetailController = (function(superClass) { @@ -14214,6 +14896,7 @@ this.navUrls = navUrls; this.analytics = analytics; this.translate = translate; + bindMethods(this); this.scope.usRef = this.params.usref; this.scope.sectionName = this.translate.instant("US.SECTION_NAME"); this.initializeEventHandlers(); @@ -14258,11 +14941,16 @@ return _this.scope.tasks = _.clone(_this.scope.tasks, false); }; })(this)); - return this.scope.$on("attachment:create", (function(_this) { + this.scope.$on("attachment:create", (function(_this) { return function() { return _this.analytics.trackEvent("attachment", "create", "create attachment on userstory", 1); }; })(this)); + return this.scope.$on("comment:new", (function(_this) { + return function() { + return _this.loadUs(); + }; + })(this)); }; UserStoryDetailController.prototype.initializeOnDeleteGoToUrl = function() { @@ -14296,9 +14984,6 @@ _this.scope.taskStatusById = groupBy(project.task_statuses, function(x) { return x.id; }); - _this.scope.membersById = groupBy(project.memberships, function(x) { - return x.user; - }); _this.scope.pointsList = _.sortBy(project.points, "order"); _this.scope.pointsById = groupBy(_this.scope.pointsList, function(e) { return e.id; @@ -14382,7 +15067,7 @@ promise = this.loadProject(); return promise.then((function(_this) { return function(project) { - _this.fillUsersAndRoles(project.users, project.roles); + _this.fillUsersAndRoles(project.members, project.roles); return _this.loadUs().then(function() { return _this.q.all([_this.loadSprint(), _this.loadTasks()]); }); @@ -14390,6 +15075,82 @@ })(this)); }; + + /* + * Note: This methods (onUpvote() and onDownvote()) are related to tg-vote-button. + * See app/modules/components/vote-button for more info + */ + + UserStoryDetailController.prototype.onUpvote = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadUs(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.userstories.upvote(this.scope.usId).then(onSuccess, onError); + }; + + UserStoryDetailController.prototype.onDownvote = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadUs(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.userstories.downvote(this.scope.usId).then(onSuccess, onError); + }; + + + /* + * Note: This methods (onWatch() and onUnwatch()) are related to tg-watch-button. + * See app/modules/components/watch-button for more info + */ + + UserStoryDetailController.prototype.onWatch = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadUs(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.userstories.watch(this.scope.usId).then(onSuccess, onError); + }; + + UserStoryDetailController.prototype.onUnwatch = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadUs(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.userstories.unwatch(this.scope.usId).then(onSuccess, onError); + }; + return UserStoryDetailController; })(mixOf(taiga.Controller, taiga.PageMixin)); @@ -14682,28 +15443,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/tasks/detail.coffee */ (function() { - var TaskDetailController, TaskIsIocaineButtonDirective, TaskStatusButtonDirective, TaskStatusDisplayDirective, groupBy, mixOf, module, taiga, + var TaskDetailController, TaskIsIocaineButtonDirective, TaskStatusButtonDirective, TaskStatusDisplayDirective, bindMethods, groupBy, mixOf, module, taiga, extend = 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; }, hasProp = {}.hasOwnProperty; @@ -14713,6 +15474,8 @@ groupBy = this.taiga.groupBy; + bindMethods = this.taiga.bindMethods; + module = angular.module("taigaTasks"); TaskDetailController = (function(superClass) { @@ -14735,6 +15498,7 @@ this.navUrls = navUrls; this.analytics = analytics; this.translate = translate; + bindMethods(this); this.scope.taskRef = this.params.taskref; this.scope.sectionName = this.translate.instant("TASK.SECTION_NAME"); this.initializeEventHandlers(); @@ -14765,23 +15529,17 @@ TaskDetailController.prototype.initializeEventHandlers = function() { this.scope.$on("attachment:create", (function(_this) { return function() { - _this.analytics.trackEvent("attachment", "create", "create attachment on task", 1); - return _this.rootscope.$broadcast("object:updated"); + return _this.analytics.trackEvent("attachment", "create", "create attachment on task", 1); }; })(this)); - this.scope.$on("attachment:edit", (function(_this) { + this.scope.$on("custom-attributes-values:edit", (function(_this) { return function() { return _this.rootscope.$broadcast("object:updated"); }; })(this)); - this.scope.$on("attachment:delete", (function(_this) { + return this.scope.$on("comment:new", (function(_this) { return function() { - return _this.rootscope.$broadcast("object:updated"); - }; - })(this)); - return this.scope.$on("custom-attributes-values:edit", (function(_this) { - return function() { - return _this.rootscope.$broadcast("object:updated"); + return _this.loadTask(); }; })(this)); }; @@ -14818,9 +15576,6 @@ _this.scope.statusById = groupBy(project.task_statuses, function(x) { return x.id; }); - _this.scope.membersById = groupBy(project.memberships, function(x) { - return x.user; - }); return project; }; })(this)); @@ -14879,7 +15634,7 @@ promise = this.loadProject(); return promise.then((function(_this) { return function(project) { - _this.fillUsersAndRoles(project.users, project.roles); + _this.fillUsersAndRoles(project.members, project.roles); return _this.loadTask().then(function() { return _this.q.all([_this.loadSprint(), _this.loadUserStory()]); }); @@ -14887,6 +15642,82 @@ })(this)); }; + + /* + * Note: This methods (onUpvote() and onDownvote()) are related to tg-vote-button. + * See app/modules/components/vote-button for more info + */ + + TaskDetailController.prototype.onUpvote = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadTask(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.tasks.upvote(this.scope.taskId).then(onSuccess, onError); + }; + + TaskDetailController.prototype.onDownvote = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadTask(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.tasks.downvote(this.scope.taskId).then(onSuccess, onError); + }; + + + /* + * Note: This methods (onWatch() and onUnwatch()) are related to tg-watch-button. + * See app/modules/components/watch-button for more info + */ + + TaskDetailController.prototype.onWatch = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadTask(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.tasks.watch(this.scope.taskId).then(onSuccess, onError); + }; + + TaskDetailController.prototype.onUnwatch = function() { + var onError, onSuccess; + onSuccess = (function(_this) { + return function() { + _this.loadTask(); + return _this.rootscope.$broadcast("object:updated"); + }; + })(this); + onError = (function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this); + return this.rs.tasks.unwatch(this.scope.taskId).then(onSuccess, onError); + }; + return TaskDetailController; })(mixOf(taiga.Controller, taiga.PageMixin)); @@ -14926,9 +15757,9 @@ module.directive("tgTaskStatusDisplay", ["$tgTemplate", "$compile", TaskStatusDisplayDirective]); - TaskStatusButtonDirective = function($rootScope, $repo, $confirm, $loading, $qqueue, $compile, $translate) { + TaskStatusButtonDirective = function($rootScope, $repo, $confirm, $loading, $qqueue, $compile, $translate, $template) { var link, template; - template = _.template("
clickable<% }%>\">\n \">\n <%- status.name %>\n <% if(editable){ %><% }%>\n \n\n \n
"); + template = $template.get("us/us-status-button.html", true); link = function($scope, $el, $attrs, $model) { var isEditable, render, save; isEditable = function() { @@ -15000,7 +15831,7 @@ }; }; - module.directive("tgTaskStatusButton", ["$rootScope", "$tgRepo", "$tgConfirm", "$tgLoading", "$tgQqueue", "$compile", "$translate", TaskStatusButtonDirective]); + module.directive("tgTaskStatusButton", ["$rootScope", "$tgRepo", "$tgConfirm", "$tgLoading", "$tgQqueue", "$compile", "$translate", "$tgTemplate", TaskStatusButtonDirective]); TaskIsIocaineButtonDirective = function($rootscope, $tgrepo, $confirm, $loading, $qqueue, $compile) { var link, template; @@ -15073,23 +15904,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/team/main.coffee */ @@ -15150,46 +15981,20 @@ }; TeamController.prototype.loadMembers = function() { - var currentUser, i, len, membership, memberships, ref, results; - currentUser = this.auth.getUser(); - if ((currentUser != null) && (currentUser.photo == null)) { - currentUser.photo = "/images/unnamed.png"; - } - memberships = this.projectService.project.toJS().memberships; - this.scope.currentUser = _.find(memberships, (function(_this) { - return function(membership) { - return (currentUser != null) && membership.user === currentUser.id; - }; - })(this)); + var i, len, member, ref, user; + user = this.auth.getUser(); this.scope.totals = {}; - _.forEach(memberships, (function(_this) { - return function(membership) { - return _this.scope.totals[membership.user] = 0; - }; - })(this)); - this.scope.memberships = _.filter(memberships, (function(_this) { - return function(membership) { - if (membership.user && ((currentUser == null) || membership.user !== currentUser.id)) { - return membership; - } - }; - })(this)); - this.scope.memberships = _.filter(memberships, (function(_this) { - return function(membership) { - return membership.is_active; - }; - })(this)); - ref = this.scope.memberships; - results = []; + ref = this.scope.activeUsers; for (i = 0, len = ref.length; i < len; i++) { - membership = ref[i]; - if (membership.photo == null) { - results.push(membership.photo = "/images/unnamed.png"); - } else { - results.push(void 0); - } + member = ref[i]; + this.scope.totals[member.id] = 0; } - return results; + this.scope.currentUser = _.find(this.scope.activeUsers, { + id: user != null ? user.id : void 0 + }); + return this.scope.memberships = _.reject(this.scope.activeUsers, { + id: user != null ? user.id : void 0 + }); }; TeamController.prototype.loadProject = function() { @@ -15221,13 +16026,13 @@ }); return _this.scope.totals[userId] = total; }); - _this.scope.stats = _this.processStats(stats); + _this.scope.stats = _this._processStats(stats); return _this.scope.stats.totals = _this.scope.totals; }; })(this)); }; - TeamController.prototype.processStat = function(stat) { + TeamController.prototype._processStat = function(stat) { var max, min, singleStat; max = _.max(stat); min = _.min(stat); @@ -15244,11 +16049,11 @@ return singleStat; }; - TeamController.prototype.processStats = function(stats) { + TeamController.prototype._processStats = function(stats) { var key, value; for (key in stats) { value = stats[key]; - stats[key] = this.processStat(value); + stats[key] = this._processStat(value); } return stats; }; @@ -15258,7 +16063,7 @@ promise = this.loadProject(); return promise.then((function(_this) { return function(project) { - _this.fillUsersAndRoles(project.users, project.roles); + _this.fillUsersAndRoles(project.members, project.roles); _this.loadMembers(); return _this.loadMemberStats(); }; @@ -15337,16 +16142,16 @@ leave_project_text = $translate.instant("TEAM.ACTION_LEAVE_PROJECT"); confirm_leave_project_text = $translate.instant("TEAM.CONFIRM_LEAVE_PROJECT"); return $confirm.ask(leave_project_text, confirm_leave_project_text).then((function(_this) { - return function(finish) { + return function(response) { var promise; promise = $rs.projects.leave($attrs.projectid); promise.then(function() { - finish(); + response.finish(); $confirm.notify("success"); return $location.path($navurls.resolve("home")); }); return promise.then(null, function(response) { - finish(); + response.finish(); return $confirm.notify('error', response.data._error_message); }); }; @@ -15376,28 +16181,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/wiki/detail.coffee */ (function() { - var EditableWikiContentDirective, WikiDetailController, WikiSummaryDirective, bindOnce, debounce, groupBy, mixOf, module, taiga, unslugify, + var EditableWikiContentDirective, WikiDetailController, WikiSummaryDirective, bindOnce, debounce, groupBy, mixOf, module, taiga, extend = 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; }, hasProp = {}.hasOwnProperty; @@ -15409,8 +16214,6 @@ bindOnce = this.taiga.bindOnce; - unslugify = this.taiga.unslugify; - debounce = this.taiga.debounce; module = angular.module("taigaWiki"); @@ -15439,6 +16242,7 @@ this.translate = translate; this.scope.projectSlug = this.params.pslug; this.scope.wikiSlug = this.params.slug; + this.scope.wikiTitle = this.scope.wikiSlug; this.scope.sectionName = "Wiki"; promise = this.loadInitialData(); promise.then((function(_this) { @@ -15452,7 +16256,7 @@ WikiDetailController.prototype._setMeta = function() { var description, title; title = this.translate.instant("WIKI.PAGE_TITLE", { - wikiPageName: unslugify(this.scope.wiki.slug), + wikiPageName: this.scope.wikiTitle, projectName: this.scope.project.name }); description = this.translate.instant("WIKI.PAGE_DESCRIPTION", { @@ -15472,9 +16276,6 @@ _this.scope.projectId = project.id; _this.scope.project = project; _this.scope.$emit('project:loaded', project); - _this.scope.membersById = groupBy(project.memberships, function(x) { - return x.user; - }); return project; }; })(this)); @@ -15511,7 +16312,14 @@ WikiDetailController.prototype.loadWikiLinks = function() { return this.rs.wiki.listLinks(this.scope.projectId).then((function(_this) { return function(wikiLinks) { - return _this.scope.wikiLinks = wikiLinks; + var selectedWikiLink; + _this.scope.wikiLinks = wikiLinks; + selectedWikiLink = _.find(wikiLinks, { + href: _this.scope.wikiSlug + }); + if (selectedWikiLink != null) { + return _this.scope.wikiTitle = selectedWikiLink.title; + } }; })(this)); }; @@ -15521,7 +16329,7 @@ promise = this.loadProject(); return promise.then((function(_this) { return function(project) { - _this.fillUsersAndRoles(project.users, project.roles); + _this.fillUsersAndRoles(project.members, project.roles); return _this.q.all([_this.loadWikiLinks(), _this.loadWiki()]).then(function() {}); }; })(this)); @@ -15530,13 +16338,13 @@ WikiDetailController.prototype["delete"] = function() { var message, title; title = this.translate.instant("WIKI.DELETE_LIGHTBOX_TITLE"); - message = unslugify(this.scope.wiki.slug); + message = this.scope.wikiTitle; return this.confirm.askOnDelete(title, message).then((function(_this) { - return function(finish) { + return function(askResponse) { var onError, onSuccess; onSuccess = function() { var ctx; - finish(); + askResponse.finish(); ctx = { project: _this.scope.projectSlug }; @@ -15544,7 +16352,7 @@ return _this.confirm.notify("success"); }; onError = function() { - finish(false); + askResponse.finish(false); return _this.confirm.notify("error"); }; return _this.repo.remove(_this.scope.wiki).then(onSuccess, onError); @@ -15573,7 +16381,7 @@ if (user === void 0) { user = { name: "unknown", - imgUrl: "/images/unnamed.png" + imgUrl: "/images/user-noimage.png" }; } else { user = { @@ -15661,7 +16469,6 @@ onError = function() { return $confirm.notify("error"); }; - console.log($el.find('.save-container')); currentLoading = $loading().removeClasses("icon-floppy").target($el.find('.icon-floppy')).start(); if (wiki.id != null) { promise = $repo.save(wiki).then(onSuccess, onError); @@ -15672,6 +16479,15 @@ return currentLoading.finish(); }); }); + $el.on("click", "a", function(event) { + var href, target; + target = angular.element(event.target); + href = target.attr('href'); + if (href.indexOf("#") === 0) { + event.preventDefault(); + return $('body').scrollTop($(href).offset().top); + } + }); $el.on("mousedown", ".view-wiki-content", function(event) { var target; target = angular.element(event.target); @@ -15741,28 +16557,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/wiki/detail.coffee */ (function() { - var WikiNavDirective, bindOnce, groupBy, mixOf, module, slugify, taiga, unslugify; + var WikiNavDirective, bindOnce, groupBy, mixOf, module, taiga; taiga = this.taiga; @@ -15772,10 +16588,6 @@ bindOnce = this.taiga.bindOnce; - slugify = this.taiga.slugify; - - unslugify = this.taiga.slugify; - module = angular.module("taigaWiki"); WikiNavDirective = function($tgrepo, $log, $location, $confirm, $navUrls, $analytics, $loading, $template, $compile, $translate) { @@ -15830,21 +16642,21 @@ title = $translate.instant("WIKI.DELETE_LIGHTBOX_TITLE"); message = $scope.wikiLinks[linkId].title; return $confirm.askOnDelete(title, message).then((function(_this) { - return function(finish) { + return function(askResponse) { var promise; promise = $tgrepo.remove($scope.wikiLinks[linkId]); promise.then(function() { promise = $ctrl.loadWikiLinks(); promise.then(function() { - finish(); + askResponse.finish(); return render($scope.wikiLinks); }); return promise.then(null, function() { - return finish(); + return askResponse.finish(); }); }); return promise.then(null, function() { - finish(false); + askResponse.finish(false); return $confirm.notify("error"); }); }; @@ -15859,8 +16671,7 @@ currentLoading = $loading().target($el.find(".new")).start(); promise = $tgrepo.create("wiki-links", { project: $scope.projectId, - title: newLink, - href: slugify(newLink) + title: newLink }); promise.then(function() { var loadPromise; @@ -15913,23 +16724,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/admin/lightboxes.coffee */ @@ -15947,7 +16758,7 @@ CreateMembersDirective = function($rs, $rootScope, $confirm, $loading, lightboxService, $compile) { var extraTextTemplate, link, template; extraTextTemplate = "
\n \n
"; - template = _.template("
\n
\n data-required=\"true\" <% } %> data-type=\"email\" />\n
\n
\n \n \n
\n
"); + template = _.template("
\n
\n data-required=\"true\" <% } %> data-type=\"email\" />\n
\n
\n \n \n
\n
"); link = function($scope, $el, $attrs) { var createFieldSet, resetForm, submit, submitButton; createFieldSet = function(required) { @@ -16059,23 +16870,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/admin/memberships.coffee */ @@ -16307,17 +17118,19 @@ module.directive("tgMemberships", ["$tgTemplate", "$compile", MembershipsDirective]); - MembershipsRowAvatarDirective = function($log, $template) { + MembershipsRowAvatarDirective = function($log, $template, $translate) { var link, template; template = $template.get("admin/memberships-row-avatar.html", true); link = function($scope, $el, $attrs) { - var member, render; + var member, pending, render; + pending = $translate.instant("ADMIN.MEMBERSHIP.STATUS_PENDING"); render = function(member) { var ctx, html; ctx = { full_name: member.full_name ? member.full_name : "", email: member.user_email ? member.user_email : member.email, - imgurl: member.photo ? member.photo : "/images/unnamed.png" + imgurl: member.photo ? member.photo : "/images/unnamed.png", + pending: !member.is_user_active ? pending : "" }; html = template(ctx); return $el.html(html); @@ -16336,7 +17149,7 @@ }; }; - module.directive("tgMembershipsRowAvatar", ["$log", "$tgTemplate", MembershipsRowAvatarDirective]); + module.directive("tgMembershipsRowAvatar", ["$log", "$tgTemplate", '$translate', MembershipsRowAvatarDirective]); MembershipsRowAdminCheckboxDirective = function($log, $repo, $confirm, $template, $compile) { var link, template; @@ -16438,7 +17251,7 @@ MembershipsRowActionsDirective = function($log, $repo, $rs, $confirm, $compile, $translate) { var activedTemplate, link, pendingTemplate; activedTemplate = "
\n
\n\n \n"; - pendingTemplate = "\n {{'ADMIN.MEMBERSHIP.STATUS_PENDING' | translate}}\n \n\n\n \n"; + pendingTemplate = "\n {{'ADMIN.MEMBERSHIP.RESEND' | translate}}\n\n\n \n"; link = function($scope, $el, $attrs) { var $ctrl, member, render; render = function(member) { @@ -16481,26 +17294,30 @@ email: member.email }); message = member.user ? member.full_name : defaultMsg; - return $confirm.askOnDelete(title, message).then(function(finish) { + return $confirm.askOnDelete(title, message).then(function(askResponse) { var onError, onSuccess; - onSuccess = function() { - var text; - finish(); - if ($scope.page > 1 && ($scope.count - 1) <= $scope.paginatedBy) { - $ctrl.selectFilter("page", $scope.page - 1); - } - $ctrl.loadMembers(); - text = $translate.instant("ADMIN.MEMBERSHIP.SUCCESS_DELETE"); - return $confirm.notify("success", null, text); - }; - onError = function() { - var text; - finish(false); - text = $translate.instant("ADMIN.MEMBERSHIP.ERROR_DELETE", { - message: message - }); - return $confirm.notify("error", null, text); - }; + onSuccess = (function(_this) { + return function() { + var text; + askResponse.finish(); + if ($scope.page > 1 && ($scope.count - 1) <= $scope.paginatedBy) { + $ctrl.selectFilter("page", $scope.page - 1); + } + $ctrl.loadMembers(); + text = $translate.instant("ADMIN.MEMBERSHIP.SUCCESS_DELETE"); + return $confirm.notify("success", null, text); + }; + })(this); + onError = (function(_this) { + return function() { + var text; + askResponse.finish(false); + text = $translate.instant("ADMIN.MEMBERSHIP.ERROR_DELETE", { + message: message + }); + return $confirm.notify("error", null, text); + }; + })(this); return $repo.remove(member).then(onSuccess, onError); }); }); @@ -16519,23 +17336,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/admin/nav.coffee */ @@ -16566,23 +17383,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/admin/project-profile.coffee */ @@ -16694,7 +17511,7 @@ module.controller("ProjectProfileController", ProjectProfileController); - ProjectProfileDirective = function($repo, $confirm, $loading, $navurls, $location, projectService) { + ProjectProfileDirective = function($repo, $confirm, $loading, $navurls, $location, projectService, currentUserService) { var link; link = function($scope, $el, $attrs) { var $ctrl, form, submit, submitButton; @@ -16720,7 +17537,8 @@ }); $location.path(newUrl); $ctrl.loadInitialData(); - return projectService.fetchProject(); + projectService.fetchProject(); + return currentUserService.loadProjects(); }); return promise.then(null, function(data) { currentLoading.finish(); @@ -16739,7 +17557,7 @@ }; }; - module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", "$tgNavUrls", "$tgLocation", "tgProjectService", ProjectProfileDirective]); + module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", "$tgNavUrls", "$tgLocation", "tgProjectService", "tgCurrentUserService", ProjectProfileDirective]); ProjectDefaultValuesDirective = function($repo, $confirm, $loading) { var link; @@ -16786,11 +17604,11 @@ ProjectModulesDirective = function($repo, $confirm, $loading, projectService) { var link; link = function($scope, $el, $attrs) { - var form, submit; - form = $el.find("form").checksley(); + var submit; submit = (function(_this) { return function() { - var currentLoading, promise, target; + var currentLoading, form, promise, target; + form = $el.find("form").checksley(); if (!form.validate()) { return; } @@ -16823,7 +17641,7 @@ } else { $el.find(".videoconference-attributes").addClass("hidden"); $scope.project.videoconferences = null; - return $scope.project.videoconferences_salt = ""; + return $scope.project.videoconferences_extra_data = ""; } }); return $scope.$watch("project", function(project) { @@ -16990,8 +17808,11 @@ return this.scope.csvUuid = this.scope.project[this.type + "_csv_uuid"]; }; - CsvExporterController.prototype._generateUuid = function(finish) { + CsvExporterController.prototype._generateUuid = function(response) { var promise; + if (response == null) { + response = null; + } promise = this.rs.projects["regenerate_" + this.type + "_csv_uuid"](this.scope.projectId); promise.then((function(_this) { return function(data) { @@ -17005,7 +17826,9 @@ }; })(this)); promise["finally"](function() { - return finish(); + if (response) { + return response.finish(); + } }); return promise; }; @@ -17017,7 +17840,7 @@ subtitle = this.translate.instant("ADMIN.REPORTS.REGENERATE_SUBTITLE"); return this.confirm.ask(title, subtitle).then(this._generateUuid); } else { - return this._generateUuid(_.identity); + return this._generateUuid(); } }; @@ -17122,28 +17945,28 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/admin/project-profile.coffee */ (function() { - var ColorSelectionDirective, ProjectCustomAttributesController, ProjectCustomAttributesDirective, ProjectValuesController, ProjectValuesDirective, ProjectValuesSectionController, bindOnce, debounce, groupBy, joinStr, mixOf, module, taiga, toString, trim, + var ColorSelectionDirective, DATE_TYPE, MULTILINE_TYPE, ProjectCustomAttributesController, ProjectCustomAttributesDirective, ProjectValuesController, ProjectValuesDirective, ProjectValuesSectionController, TEXT_TYPE, TYPE_CHOICES, bindOnce, debounce, groupBy, joinStr, mixOf, module, taiga, toString, trim, extend = 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; }, hasProp = {}.hasOwnProperty, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; @@ -17457,7 +18280,7 @@ }); subtitle = value.name; if (_.keys(choices).length === 0) { - return $confirm.error("ADMIN.PROJECT_VALUES.ERROR_DELETE_ALL"); + return $confirm.error($translate.instant("ADMIN.PROJECT_VALUES.ERROR_DELETE_ALL")); } title = $translate.instant("ADMIN.COMMON.TITLE_ACTION_DELETE_VALUE"); text = $translate.instant("ADMIN.PROJECT_VALUES.REPLACEMENT"); @@ -17544,6 +18367,25 @@ module.directive("tgColorSelection", ColorSelectionDirective); + TEXT_TYPE = "text"; + + MULTILINE_TYPE = "multiline"; + + DATE_TYPE = "date"; + + TYPE_CHOICES = [ + { + key: TEXT_TYPE, + name: "ADMIN.CUSTOM_FIELDS.FIELD_TYPE_TEXT" + }, { + key: MULTILINE_TYPE, + name: "ADMIN.CUSTOM_FIELDS.FIELD_TYPE_MULTI" + }, { + key: DATE_TYPE, + name: "ADMIN.CUSTOM_FIELDS.FIELD_TYPE_DATE" + } + ]; + ProjectCustomAttributesController = (function(superClass) { extend(ProjectCustomAttributesController, superClass); @@ -17565,6 +18407,7 @@ this.saveCustomAttribute = bind(this.saveCustomAttribute, this); this.createCustomAttribute = bind(this.createCustomAttribute, this); this.loadCustomAttributes = bind(this.loadCustomAttributes, this); + this.scope.TYPE_CHOICES = TYPE_CHOICES; this.scope.project = {}; this.rootscope.$on("project:loaded", (function(_this) { return function() { @@ -17810,15 +18653,14 @@ message = attr.name; title = $translate.instant("COMMON.CUSTOM_ATTRIBUTES.DELETE"); text = $translate.instant("COMMON.CUSTOM_ATTRIBUTES.CONFIRM_DELETE"); - return $confirm.ask(title, text, message).then(function(finish) { + return $confirm.ask(title, text, message).then(function(response) { var onError, onSucces; onSucces = function() { return $ctrl.loadCustomAttributes()["finally"](function() { - return finish(); + return response.finish(); }); }; onError = function() { - finish(false); return $confirm.notify("error", null, "We have not been able to delete '" + message + "'."); }; return $ctrl.deleteCustomAttribute(attr).then(onSucces, onError); @@ -17843,28 +18685,29 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/admin/memberships.coffee */ (function() { var EditRoleDirective, NewRoleDirective, RolePermissionsDirective, RolesController, RolesDirective, bindMethods, bindOnce, debounce, mixOf, module, taiga, + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, extend = 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; }, hasProp = {}.hasOwnProperty, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; @@ -17899,6 +18742,8 @@ this.navUrls = navUrls; this.appMetaService = appMetaService; this.translate = translate; + this._disableComputable = bind(this._disableComputable, this); + this._enableComputable = bind(this._enableComputable, this); bindMethods(this); this.scope.sectionName = "ADMIN.MENU.PERMISSIONS"; this.scope.project = {}; @@ -18007,7 +18852,7 @@ })(this)); }; - RolesController.prototype.setComputable = debounce(2000, function() { + RolesController.prototype._enableComputable = function() { var onError, onSuccess; onSuccess = (function(_this) { return function() { @@ -18022,6 +18867,45 @@ }; })(this); return this.repo.save(this.scope.role).then(onSuccess, onError); + }; + + RolesController.prototype._disableComputable = function() { + var askOnError, askOnSuccess, message, subtitle, title; + askOnSuccess = (function(_this) { + return function(response) { + var onError, onSuccess; + onSuccess = function() { + response.finish(); + _this.confirm.notify("success"); + return _this.loadProject(); + }; + onError = function() { + response.finish(); + _this.confirm.notify("error"); + return _this.scope.role.revert(); + }; + return _this.repo.save(_this.scope.role).then(onSuccess, onError); + }; + })(this); + askOnError = (function(_this) { + return function(response) { + return _this.scope.role.revert(); + }; + })(this); + title = this.translate.instant("ADMIN.ROLES.DISABLE_COMPUTABLE_ALERT_TITLE"); + subtitle = this.translate.instant("ADMIN.ROLES.DISABLE_COMPUTABLE_ALERT_SUBTITLE", { + roleName: this.scope.role.name + }); + message = this.translate.instant("ADMIN.ROLES.DISABLE_COMPUTABLE_ALERT_MESSAGE"); + return this.confirm.ask(title, subtitle, message).then(askOnSuccess, askOnError); + }; + + RolesController.prototype.toggleComputable = debounce(2000, function() { + if (!this.scope.role.computable) { + return this._disableComputable(); + } else { + return this._enableComputable(); + } }); return RolesController; @@ -18387,23 +19271,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/admin/third-parties.coffee */ @@ -18609,14 +19493,14 @@ name: webhook.name }); return $confirm.askOnDelete(title, message).then((function(_this) { - return function(finish) { + return function(askResponse) { var onError, onSucces; onSucces = function() { - finish(); + askResponse.finish(); return $scope.$emit("webhooks:reload"); }; onError = function() { - finish(false); + askResponse.finish(false); return $confirm.notify("error"); }; return $repo.remove(webhook).then(onSucces, onError); @@ -19102,23 +19986,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/common/attachments.coffee */ @@ -19152,7 +20036,7 @@ $confirm.notify("success", $translate.instant("COMMON.SAVE")); $location.url($projectUrl.get(response)); lightboxService.close($el); - return currentUserService._loadProjects(); + return currentUserService.loadProjects(); }; onErrorSubmit = function(response) { var error_field, error_step, i, len, ref, selectors; @@ -19182,10 +20066,7 @@ }; })(this); openLightbox = function() { - $scope.data = { - total_story_points: 100, - total_milestones: 5 - }; + $scope.data = {}; if (!$scope.templates.length) { $rs.projects.templates().then((function(_this) { return function(result) { @@ -19281,7 +20162,7 @@ $rootscope.$broadcast("projects:reload"); $location.path($navUrls.resolve("home")); $confirm.notify("success"); - return currentUserService._loadProjects(); + return currentUserService.loadProjects(); }); return promise.then(null, function() { $confirm.notify("error"); @@ -19308,23 +20189,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/bind.coffee */ @@ -19469,23 +20350,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/conf.coffee */ @@ -19519,23 +20400,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/contrib.coffee */ @@ -19603,23 +20484,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/filters.coffee */ @@ -19658,23 +20539,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/http.coffee */ @@ -19807,23 +20688,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/location.coffee */ @@ -19856,23 +20737,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/model.coffee */ @@ -20077,23 +20958,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/navurl.coffee */ @@ -20162,25 +21043,40 @@ return defered.promise; }; parseNav = function(data, $scope) { - var name, params, promises, ref, values; + var index, name, obj, params, promises, ref, result, values; ref = _.map(data.split(":"), trim), name = ref[0], params = ref[1]; if (params) { - params = _.map(params.split(","), trim); + result = params.split(/(\w+)=/); + result = _.filter(result, function(str) { + return str.length; + }); + result = _.map(result, function(str) { + return trim(str.replace(/,$/g, '')); + }); + params = []; + index = 0; + while (index < result.length) { + obj = {}; + obj[result[index]] = result[index + 1]; + params.push(obj); + index = index + 2; + } } else { params = []; } - values = _.map(params, function(x) { - return trim(x.split("=")[1]); + values = _.map(params, function(param) { + return _.values(param)[0]; }); promises = _.map(values, function(x) { return bindOnceP($scope, x); }); return $q.all(promises).then(function() { - var i, item, key, len, options, ref1, value; + var i, key, len, options, param, value; options = {}; for (i = 0, len = params.length; i < len; i++) { - item = params[i]; - ref1 = _.map(item.split("="), trim), key = ref1[0], value = ref1[1]; + param = params[i]; + key = Object.keys(param)[0]; + value = param[key]; options[key] = $scope.$eval(value); } return [name, options]; @@ -20248,23 +21144,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/repository.coffee */ @@ -20436,11 +21332,14 @@ return defered.promise; }; - RepositoryService.prototype.queryMany = function(name, params, options) { + RepositoryService.prototype.queryMany = function(name, params, options, headers) { var httpOptions, url; if (options == null) { options = {}; } + if (headers == null) { + headers = false; + } url = this.urls.resolve(name); httpOptions = { headers: {} @@ -20450,9 +21349,14 @@ } return this.http.get(url, params, httpOptions).then((function(_this) { return function(data) { - return _.map(data.data, function(x) { + var result; + result = _.map(data.data, function(x) { return _this.model.make_model(name, x); }); + if (headers) { + return [result, data.headers]; + } + return result; }; })(this)); }; @@ -20613,23 +21517,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/storage.coffee */ @@ -20696,23 +21600,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/base/http.coffee */ @@ -20780,23 +21684,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/attachments.coffee */ @@ -20849,12 +21753,12 @@ uploadComplete = (function(_this) { return function(evt) { return $rootScope.$apply(function() { - var data, model, ref, status; + var data, error, model, ref, status; file.status = "done"; status = evt.target.status; try { data = JSON.parse(evt.target.responseText); - } catch (_error) { + } catch (error) { data = {}; } if (status >= 200 && status < 400) { @@ -20907,23 +21811,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/custom-field-values.coffee */ @@ -20967,23 +21871,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/projects.coffee */ @@ -21031,23 +21935,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/history.coffee */ @@ -21101,23 +22005,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/projects.coffee */ @@ -21145,23 +22049,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/issues.coffee */ @@ -21212,11 +22116,31 @@ }; return $http.post(url, params); }; + service.upvote = function(issueId) { + var url; + url = $urls.resolve("issue-upvote", issueId); + return $http.post(url); + }; + service.downvote = function(issueId) { + var url; + url = $urls.resolve("issue-downvote", issueId); + return $http.post(url); + }; + service.watch = function(issueId) { + var url; + url = $urls.resolve("issue-watch", issueId); + return $http.post(url); + }; + service.unwatch = function(issueId) { + var url; + url = $urls.resolve("issue-unwatch", issueId); + return $http.post(url); + }; service.stats = function(projectId) { return $repo.queryOneRaw("projects", projectId + "/issues_stats"); }; - service.filtersData = function(projectId) { - return $repo.queryOneRaw("projects", projectId + "/issue_filters_data"); + service.filtersData = function(params) { + return $repo.queryOneRaw("issues-filters", null, params); }; service.listValues = function(projectId, type) { var params; @@ -21319,23 +22243,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/kanban.coffee */ @@ -21391,20 +22315,20 @@ * Copyright (C) 2015 Andrey Antukh * Copyright (C) 2015 Jesús Espino Garcia * Copyright (C) 2015 David Barragán Merino -# + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/locales.coffee */ @@ -21435,23 +22359,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/mdrender.coffee */ @@ -21492,23 +22416,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/memberships.coffee */ @@ -21573,6 +22497,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: modules.coffee + */ + (function() { var module, resourceProvider; @@ -21595,23 +22539,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/memberships.coffee */ @@ -21644,23 +22588,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/projects.coffee */ @@ -21789,11 +22733,11 @@ })(this); complete = (function(_this) { return function(evt) { - var ref; + var error, ref; response = {}; try { response.data = JSON.parse(evt.target.responseText); - } catch (_error) { + } catch (error) { response.data = {}; } response.status = evt.target.status; @@ -21836,23 +22780,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/memberships.coffee */ @@ -21885,23 +22829,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/search.coffee */ @@ -21938,23 +22882,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/sprints.coffee */ @@ -21988,9 +22932,11 @@ "project": projectId }; params = _.extend({}, params, filters || {}); - return $repo.queryMany("milestones", params).then((function(_this) { - return function(milestones) { - var i, len, m, uses; + return $repo.queryMany("milestones", params, {}, true).then((function(_this) { + return function(result) { + var headers, i, len, m, milestones, uses; + milestones = result[0]; + headers = result[1]; for (i = 0, len = milestones.length; i < len; i++) { m = milestones[i]; uses = m.user_stories; @@ -21999,7 +22945,11 @@ }); m._attrs.user_stories = uses; } - return milestones; + return { + milestones: milestones, + closed: parseInt(headers("Taiga-Info-Total-Closed-Milestones"), 10), + open: parseInt(headers("Taiga-Info-Total-Opened-Milestones"), 10) + }; }; })(this)); }; @@ -22016,23 +22966,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/tasks.coffee */ @@ -22098,6 +23048,26 @@ return result.data; }); }; + service.upvote = function(taskId) { + var url; + url = $urls.resolve("task-upvote", taskId); + return $http.post(url); + }; + service.downvote = function(taskId) { + var url; + url = $urls.resolve("task-downvote", taskId); + return $http.post(url); + }; + service.watch = function(taskId) { + var url; + url = $urls.resolve("task-watch", taskId); + return $http.post(url); + }; + service.unwatch = function(taskId) { + var url; + url = $urls.resolve("task-unwatch", taskId); + return $http.post(url); + }; service.bulkUpdateTaskTaskboardOrder = function(projectId, data) { var params, url; url = $urls.resolve("bulk-update-task-taskboard-order"); @@ -22163,23 +23133,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/memberships.coffee */ @@ -22245,23 +23215,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/user.coffee */ @@ -22280,7 +23250,7 @@ if (options == null) { options = {}; } - url = $urls.resolve("contacts", userId); + url = $urls.resolve("user-contacts", userId); httpOptions = { headers: {} }; @@ -22304,23 +23274,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/userstories.coffee */ @@ -22351,6 +23321,9 @@ service.listInAllProjects = function(filters) { return $repo.queryMany("userstories", filters); }; + service.filtersData = function(params) { + return $repo.queryOneRaw("userstories-filters", null, params); + }; service.listUnassigned = function(projectId, filters) { var params; params = { @@ -22380,6 +23353,26 @@ url = $urls.resolve("bulk-create-us"); return $http.post(url, data); }; + service.upvote = function(userStoryId) { + var url; + url = $urls.resolve("userstory-upvote", userStoryId); + return $http.post(url); + }; + service.downvote = function(userStoryId) { + var url; + url = $urls.resolve("userstory-downvote", userStoryId); + return $http.post(url); + }; + service.watch = function(userStoryId) { + var url; + url = $urls.resolve("userstory-watch", userStoryId); + return $http.post(url); + }; + service.unwatch = function(userStoryId) { + var url; + url = $urls.resolve("userstory-unwatch", userStoryId); + return $http.post(url); + }; service.bulkUpdateBacklogOrder = function(projectId, data) { var params, url; url = $urls.resolve("bulk-update-us-backlog-order"); @@ -22448,6 +23441,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: webhooklogs.coffee + */ + (function() { var module, resourceProvider; @@ -22477,6 +23490,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: webhooks.coffee + */ + (function() { var module, resourceProvider; @@ -22508,23 +23541,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/resources/wikis.coffee */ @@ -22560,23 +23593,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/user-settings/main.coffee */ @@ -22655,29 +23688,29 @@ }; }; - module.directive("tgUserChangePassword", ["$tgResources", "$tgConfirm", "$tgLoading", UserChangePasswordDirective]); + module.directive("tgUserChangePassword", ["$tgResources", "$tgConfirm", "$tgLoading", "$translate", UserChangePasswordDirective]); }).call(this); /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/issues/lightboxes.coffee */ @@ -22735,23 +23768,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/user-settings/main.coffee */ @@ -22797,6 +23830,7 @@ this.location.replace(); } this.scope.lang = this.getLan(); + this.scope.theme = this.getTheme(); maxFileSize = this.config.get("maxUploadFileSize", null); if (maxFileSize) { text = this.translate.instant("USER_SETTINGS.AVATAR_MAX_SIZE", { @@ -22809,6 +23843,7 @@ } UserSettingsController.prototype.loadInitialData = function() { + this.scope.availableThemes = this.config.get("themes", []); return this.rs.locales.list().then((function(_this) { return function(locales) { _this.scope.locales = locales; @@ -22825,6 +23860,10 @@ return this.scope.user.lang || this.translate.preferredLanguage(); }; + UserSettingsController.prototype.getTheme = function() { + return this.scope.user.theme || this.config.get("defaultTheme") || "taiga"; + }; + return UserSettingsController; })(mixOf(taiga.Controller, taiga.PageMixin)); @@ -22845,6 +23884,7 @@ } changeEmail = $scope.user.isAttributeModified("email"); $scope.user.lang = $scope.lang; + $scope.user.theme = $scope.theme; onSuccess = function(data) { var text; $auth.setUser(data); @@ -22943,23 +23983,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/user-settings/nav.coffee */ @@ -22990,23 +24030,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/user-settings/notifications.coffee */ @@ -23122,20 +24162,20 @@ /* * Copyright (C) 2015 Taiga Agile LLC -# + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: components.module.coffee */ @@ -23144,6 +24184,53 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: external-apps.module.coffee + */ + +(function() { + var module; + + module = angular.module("taigaExternalApps", []); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: home.module.coffee + */ + (function() { var module; @@ -23151,11 +24238,51 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: navigation-bar.module.coffee + */ + (function() { angular.module("taigaNavigationBar", []); }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile.module.coffee + */ + (function() { var module; @@ -23163,21 +24290,375 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: projects.module.coffee + */ + (function() { angular.module("taigaProjects", []); }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: resources.module.coffee + */ + (function() { angular.module("taigaResources2", []); }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: user-timeline.module.coffee + */ + (function() { angular.module("taigaUserTimeline", []); }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: joy-ride.directive.coffee + */ + +(function() { + var JoyRideDirective, taiga; + + taiga = this.taiga; + + JoyRideDirective = function($rootScope, currentUserService, joyRideService, $location) { + var link; + link = function(scope, el, attrs, ctrl) { + var initJoyrRide, intro, unsuscribe; + unsuscribe = null; + intro = introJs(); + intro.setOptions({ + exitOnEsc: false, + exitOnOverlayClick: false, + showStepNumbers: false, + nextLabel: 'Next →', + prevLabel: '← Back', + skipLabel: 'Skip', + doneLabel: 'Done', + disableInteraction: true + }); + intro.oncomplete(function() { + return $('html,body').scrollTop(0); + }); + intro.onexit(function() { + return currentUserService.disableJoyRide(); + }); + initJoyrRide = function(next, config) { + if (!config[next.joyride]) { + return; + } + intro.setOption('steps', joyRideService.get(next.joyride)); + return intro.start(); + }; + return $rootScope.$on('$routeChangeSuccess', function(event, next) { + if (!next.joyride || !currentUserService.isAuthenticated()) { + intro.exit(); + if (unsuscribe) { + unsuscribe(); + } + return; + } + intro.oncomplete(function() { + return currentUserService.disableJoyRide(next.joyride); + }); + if (next.loader) { + return unsuscribe = $rootScope.$on('loader:end', function() { + currentUserService.loadJoyRideConfig().then(function(config) { + return initJoyrRide(next, config); + }); + return unsuscribe(); + }); + } else { + return currentUserService.loadJoyRideConfig().then(function(config) { + return initJoyrRide(next, config); + }); + } + }); + }; + return { + scope: {}, + link: link + }; + }; + + JoyRideDirective.$inject = ["$rootScope", "tgCurrentUserService", "tgJoyRideService", "$location"]; + + angular.module("taigaComponents").directive("tgJoyRide", JoyRideDirective); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: joy-ride.service.coffee + */ + +(function() { + var JoyRideService, + extend = 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; }, + hasProp = {}.hasOwnProperty; + + JoyRideService = (function(superClass) { + extend(JoyRideService, superClass); + + JoyRideService.$inject = ['$translate', 'tgCheckPermissionsService']; + + function JoyRideService(translate, checkPermissionsService) { + this.translate = translate; + this.checkPermissionsService = checkPermissionsService; + } + + JoyRideService.prototype.getConfig = function() { + return { + dashboard: (function(_this) { + return function() { + var steps; + steps = [ + { + element: '.project-list > section:not(.ng-hide)', + position: 'left', + joyride: { + title: _this.translate.instant('JOYRIDE.DASHBOARD.STEP1.TITLE'), + text: _this.translate.instant('JOYRIDE.DASHBOARD.STEP1.TEXT') + } + }, { + element: '.working-on-container', + position: 'right', + joyride: { + title: _this.translate.instant('JOYRIDE.DASHBOARD.STEP2.TITLE'), + text: _this.translate.instant('JOYRIDE.DASHBOARD.STEP2.TEXT') + } + }, { + element: '.watching-container', + position: 'right', + joyride: { + title: _this.translate.instant('JOYRIDE.DASHBOARD.STEP3.TITLE'), + text: [_this.translate.instant('JOYRIDE.DASHBOARD.STEP3.TEXT1'), _this.translate.instant('JOYRIDE.DASHBOARD.STEP3.TEXT2')] + } + } + ]; + if (!$('.project-list .create-project-button').is(':hidden')) { + steps.push({ + element: '.project-list .create-project-button', + position: 'bottom', + joyride: { + title: _this.translate.instant('JOYRIDE.DASHBOARD.STEP4.TITLE'), + text: [_this.translate.instant('JOYRIDE.DASHBOARD.STEP4.TEXT1'), _this.translate.instant('JOYRIDE.DASHBOARD.STEP4.TEXT2')] + } + }); + } + return steps; + }; + })(this), + backlog: (function(_this) { + return function() { + var steps; + steps = [ + { + element: '.summary', + position: 'bottom', + joyride: { + title: _this.translate.instant('JOYRIDE.BACKLOG.STEP1.TITLE'), + text: [_this.translate.instant('JOYRIDE.BACKLOG.STEP1.TEXT1'), _this.translate.instant('JOYRIDE.BACKLOG.STEP1.TEXT2')] + } + }, { + element: '.backlog-table-empty', + position: 'bottom', + joyride: { + title: _this.translate.instant('JOYRIDE.BACKLOG.STEP2.TITLE'), + text: _this.translate.instant('JOYRIDE.BACKLOG.STEP2.TEXT') + } + }, { + element: '.sprints', + position: 'left', + joyride: { + title: _this.translate.instant('JOYRIDE.BACKLOG.STEP3.TITLE'), + text: _this.translate.instant('JOYRIDE.BACKLOG.STEP3.TEXT') + } + } + ]; + if (_this.checkPermissionsService.check('add_us')) { + steps.push({ + element: '.new-us', + position: 'rigth', + joyride: { + title: _this.translate.instant('JOYRIDE.BACKLOG.STEP4.TITLE'), + text: _this.translate.instant('JOYRIDE.BACKLOG.STEP4.TEXT') + } + }); + } + return steps; + }; + })(this), + kanban: (function(_this) { + return function() { + var steps; + steps = [ + { + element: '.kanban-table-inner', + position: 'bottom', + joyride: { + title: _this.translate.instant('JOYRIDE.KANBAN.STEP1.TITLE'), + text: _this.translate.instant('JOYRIDE.KANBAN.STEP1.TEXT') + } + }, { + element: '.card-placeholder', + position: 'right', + joyride: { + title: _this.translate.instant('JOYRIDE.KANBAN.STEP2.TITLE'), + text: _this.translate.instant('JOYRIDE.KANBAN.STEP2.TEXT') + } + } + ]; + if (_this.checkPermissionsService.check('add_us')) { + steps.push({ + element: '.icon-plus', + position: 'bottom', + joyride: { + title: _this.translate.instant('JOYRIDE.KANBAN.STEP3.TITLE'), + text: [_this.translate.instant('JOYRIDE.KANBAN.STEP3.TEXT1'), _this.translate.instant('JOYRIDE.KANBAN.STEP3.TEXT2')] + } + }); + } + return steps; + }; + })(this) + }; + }; + + JoyRideService.prototype.get = function(name) { + var joyRide, joyRides; + joyRides = this.getConfig(); + joyRide = joyRides[name].call(this); + return _.map(joyRide, function(item) { + var html; + html = ""; + if (item.joyride.title) { + html += "

" + item.joyride.title + "

"; + } + if (_.isArray(item.joyride.text)) { + _.forEach(item.joyride.text, function(text) { + return html += "

" + text + "

"; + }); + } else { + html += "

" + item.joyride.text + "

"; + } + item.intro = html; + return item; + }); + }; + + return JoyRideService; + + })(taiga.Service); + + angular.module("taigaComponents").service("tgJoyRideService", JoyRideService); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: project-menu.controller.coffee + */ + (function() { var ProjectMenuController; @@ -23271,14 +24752,16 @@ baseUrl = "https://talky.io/"; } else if (this.project.get("videoconferences") === "jitsi") { baseUrl = "https://meet.jit.si/"; - url = this.project.get("slug") + "-" + taiga.slugify(this.project.get("videoconferences_salt")); + url = this.project.get("slug") + "-" + taiga.slugify(this.project.get("videoconferences_extra_data")); url = url.replace(/-/g, ""); return baseUrl + url; + } else if (this.project.get("videoconferences") === "custom") { + return this.project.get("videoconferences_extra_data"); } else { return ""; } - if (this.project.get("videoconferences_salt")) { - url = this.project.get("slug") + "-" + this.project.get("videoconferences_salt"); + if (this.project.get("videoconferences_extra_data")) { + url = this.project.get("slug") + "-" + this.project.get("videoconferences_extra_data"); } else { url = this.project.get("slug"); } @@ -23293,6 +24776,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: project-menu.directive.coffee + */ + (function() { var ProjectMenuDirective, taiga; @@ -23328,6 +24831,470 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: modules/components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.directive.coffee + */ + +(function() { + var TermsOfServiceAndPrivacyPolicyNoticeDirective; + + TermsOfServiceAndPrivacyPolicyNoticeDirective = function($config) { + var link; + link = function(scope, el, attrs) { + scope.privacyPolicyUrl = $config.get("privacyPolicyUrl"); + return scope.termsOfServiceUrl = $config.get("termsOfServiceUrl"); + }; + return { + restrict: "AE", + scope: {}, + link: link, + templateUrl: "components/terms-of-service-and-privacy-policy-notice/terms-of-service-and-privacy-policy-notice.html" + }; + }; + + angular.module("taigaComponents").directive("tgTermsOfServiceAndPrivacyPolicyNotice", ["$tgConfig", TermsOfServiceAndPrivacyPolicyNoticeDirective]); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: vote-button.controller.coffee + */ + +(function() { + var VoteButtonController; + + VoteButtonController = (function() { + VoteButtonController.$inject = ["tgCurrentUserService"]; + + function VoteButtonController(currentUserService) { + this.currentUserService = currentUserService; + this.user = this.currentUserService.getUser(); + this.isMouseOver = false; + this.loading = false; + } + + VoteButtonController.prototype.showTextWhenMouseIsOver = function() { + return this.isMouseOver = true; + }; + + VoteButtonController.prototype.showTextWhenMouseIsLeave = function() { + return this.isMouseOver = false; + }; + + VoteButtonController.prototype.toggleVote = function() { + var promise; + this.loading = true; + if (!this.item.is_voter) { + promise = this._upvote(); + } else { + promise = this._downvote(); + } + promise["finally"]((function(_this) { + return function() { + return _this.loading = false; + }; + })(this)); + return promise; + }; + + VoteButtonController.prototype._upvote = function() { + return this.onUpvote().then((function(_this) { + return function() { + return _this.showTextWhenMouseIsLeave(); + }; + })(this)); + }; + + VoteButtonController.prototype._downvote = function() { + return this.onDownvote(); + }; + + return VoteButtonController; + + })(); + + angular.module("taigaComponents").controller("VoteButton", VoteButtonController); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: vote-button.directive.coffee + */ + +(function() { + var VoteButtonDirective; + + VoteButtonDirective = function() { + return { + scope: {}, + controller: "VoteButton", + bindToController: { + item: "=", + onUpvote: "=", + onDownvote: "=" + }, + controllerAs: "vm", + templateUrl: "components/vote-button/vote-button.html" + }; + }; + + angular.module("taigaComponents").directive("tgVoteButton", VoteButtonDirective); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: watch-button.controller.coffee + */ + +(function() { + var WatchButtonController; + + WatchButtonController = (function() { + WatchButtonController.$inject = ["tgCurrentUserService"]; + + function WatchButtonController(currentUserService) { + this.currentUserService = currentUserService; + this.user = this.currentUserService.getUser(); + this.isMouseOver = false; + this.loading = false; + } + + WatchButtonController.prototype.showTextWhenMouseIsOver = function() { + return this.isMouseOver = true; + }; + + WatchButtonController.prototype.showTextWhenMouseIsLeave = function() { + return this.isMouseOver = false; + }; + + WatchButtonController.prototype.toggleWatch = function() { + var promise; + this.loading = true; + if (!this.item.is_watcher) { + promise = this._watch(); + } else { + promise = this._unwatch(); + } + promise["finally"]((function(_this) { + return function() { + return _this.loading = false; + }; + })(this)); + return promise; + }; + + WatchButtonController.prototype._watch = function() { + return this.onWatch().then((function(_this) { + return function() { + return _this.showTextWhenMouseIsLeave(); + }; + })(this)); + }; + + WatchButtonController.prototype._unwatch = function() { + return this.onUnwatch(); + }; + + return WatchButtonController; + + })(); + + angular.module("taigaComponents").controller("WatchButton", WatchButtonController); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: watch-button.directive.coffee + */ + +(function() { + var WatchButtonDirective; + + WatchButtonDirective = function() { + return { + scope: {}, + controller: "WatchButton", + bindToController: { + item: "=", + onWatch: "=", + onUnwatch: "=" + }, + controllerAs: "vm", + templateUrl: "components/watch-button/watch-button.html" + }; + }; + + angular.module("taigaComponents").directive("tgWatchButton", WatchButtonDirective); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: external-app.controller.coffee + */ + +(function() { + var ExternalAppController, taiga, + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + extend = 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; }, + hasProp = {}.hasOwnProperty; + + taiga = this.taiga; + + ExternalAppController = (function(superClass) { + extend(ExternalAppController, superClass); + + ExternalAppController.$inject = ["$routeParams", "tgExternalAppsService", "$window", "tgCurrentUserService", "$location", "$tgNavUrls", "tgXhrErrorService", "tgLoader"]; + + function ExternalAppController(routeParams, externalAppsService, window, currentUserService, location, navUrls, xhrError, loader) { + var loginUrl, nextUrl; + this.routeParams = routeParams; + this.externalAppsService = externalAppsService; + this.window = window; + this.currentUserService = currentUserService; + this.location = location; + this.navUrls = navUrls; + this.xhrError = xhrError; + this.loader = loader; + this.createApplicationToken = bind(this.createApplicationToken, this); + this._getApplicationToken = bind(this._getApplicationToken, this); + this._redirect = bind(this._redirect, this); + this.loader.start(false); + this._applicationId = this.routeParams.application; + this._state = this.routeParams.state; + this._getApplicationToken(); + this._user = this.currentUserService.getUser(); + this._application = null; + nextUrl = encodeURIComponent(this.location.url()); + loginUrl = this.navUrls.resolve("login"); + this.loginWithAnotherUserUrl = loginUrl + "?next=" + nextUrl; + taiga.defineImmutableProperty(this, "user", (function(_this) { + return function() { + return _this._user; + }; + })(this)); + taiga.defineImmutableProperty(this, "application", (function(_this) { + return function() { + return _this._application; + }; + })(this)); + } + + ExternalAppController.prototype._redirect = function(applicationToken) { + var nextUrl; + nextUrl = applicationToken.get("next_url"); + return this.window.open(nextUrl, "_self"); + }; + + ExternalAppController.prototype._getApplicationToken = function() { + return this.externalAppsService.getApplicationToken(this._applicationId, this._state).then((function(_this) { + return function(data) { + _this._application = data.get("application"); + if (data.get("auth_code")) { + return _this._redirect(data); + } else { + return _this.loader.pageLoaded(); + } + }; + })(this))["catch"]((function(_this) { + return function(xhr) { + _this.loader.pageLoaded(); + return _this.xhrError.response(xhr); + }; + })(this)); + }; + + ExternalAppController.prototype.cancel = function() { + return this.window.history.back(); + }; + + ExternalAppController.prototype.createApplicationToken = function() { + return this.externalAppsService.authorizeApplicationToken(this._applicationId, this._state).then((function(_this) { + return function(data) { + return _this._redirect(data); + }; + })(this))["catch"]((function(_this) { + return function(xhr) { + return _this.xhrError.response(xhr); + }; + })(this)); + }; + + return ExternalAppController; + + })(taiga.Controller); + + angular.module("taigaExternalApps").controller("ExternalApp", ExternalAppController); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: external-app.service.coffee + */ + +(function() { + var ExternalAppsService, + extend = 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; }, + hasProp = {}.hasOwnProperty; + + ExternalAppsService = (function(superClass) { + extend(ExternalAppsService, superClass); + + ExternalAppsService.$inject = ["tgResources"]; + + function ExternalAppsService(rs) { + this.rs = rs; + } + + ExternalAppsService.prototype.getApplicationToken = function(applicationId, state) { + return this.rs.externalapps.getApplicationToken(applicationId, state); + }; + + ExternalAppsService.prototype.authorizeApplicationToken = function(applicationId, state) { + return this.rs.externalapps.authorizeApplicationToken(applicationId, state); + }; + + return ExternalAppsService; + + })(taiga.Service); + + angular.module("taigaExternalApps").service("tgExternalAppsService", ExternalAppsService); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: feedback.service.coffee + */ + (function() { var FeedbackService, extend = 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; }, @@ -23356,6 +25323,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: duty.directive.coffee + */ + (function() { var DutyDirective; @@ -23393,6 +25380,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: home.service.coffee + */ + (function() { var HomeService, groupBy, extend = 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; }, @@ -23533,6 +25540,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: home-project-list.directive.coffee + */ + (function() { var HomeProjectListDirective; @@ -23561,6 +25588,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: working-on.controller.coffee + */ + (function() { var WorkingOnController; @@ -23616,6 +25663,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: working-on.directive.coffee + */ + (function() { var WorkingOnDirective; @@ -23644,6 +25711,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: dropdown-project-list.directive.coffee + */ + (function() { var DropdownProjectListDirective; @@ -23672,6 +25759,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: dropdown-user.directive.coffee + */ + (function() { var DropdownUserDirective; @@ -23705,10 +25812,30 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: navigation-bar.directive.coffee + */ + (function() { var NavigationBarDirective; - NavigationBarDirective = function(currentUserService, $location) { + NavigationBarDirective = function(currentUserService, navigationBarService, $location) { var directive, link; link = function(scope, el, attrs, ctrl) { scope.vm = {}; @@ -23722,9 +25849,12 @@ taiga.defineImmutableProperty(scope.vm, "projects", function() { return currentUserService.projects.get("recents"); }); - return taiga.defineImmutableProperty(scope.vm, "isAuthenticated", function() { + taiga.defineImmutableProperty(scope.vm, "isAuthenticated", function() { return currentUserService.isAuthenticated(); }); + return taiga.defineImmutableProperty(scope.vm, "isEnabledHeader", function() { + return navigationBarService.isEnabledHeader(); + }); }; directive = { templateUrl: "navigation-bar/navigation-bar.html", @@ -23734,12 +25864,84 @@ return directive; }; - NavigationBarDirective.$inject = ["tgCurrentUserService", "$location"]; + NavigationBarDirective.$inject = ["tgCurrentUserService", "tgNavigationBarService", "$location"]; angular.module("taigaNavigationBar").directive("tgNavigationBar", NavigationBarDirective); }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: navigation-bar.service.coffee + */ + +(function() { + var NavigationBarService, + extend = 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; }, + hasProp = {}.hasOwnProperty; + + NavigationBarService = (function(superClass) { + extend(NavigationBarService, superClass); + + function NavigationBarService() { + this.disableHeader(); + } + + NavigationBarService.prototype.enableHeader = function() { + return this.enabledHeader = true; + }; + + NavigationBarService.prototype.disableHeader = function() { + return this.enabledHeader = false; + }; + + NavigationBarService.prototype.isEnabledHeader = function() { + return this.enabledHeader; + }; + + return NavigationBarService; + + })(taiga.Service); + + angular.module("taigaNavigationBar").service("tgNavigationBarService", NavigationBarService); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-bar.controller.coffee + */ + (function() { var ProfileBarController; @@ -23767,6 +25969,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-bar.directive.coffee + */ + (function() { var ProfileBarDirective; @@ -23787,6 +26009,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-contacts.controller.coffee + */ + (function() { var ProfileContactsController; @@ -23819,6 +26061,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-contacts.directive.coffee + */ + (function() { var ProfileContactsDirective; @@ -23843,6 +26105,352 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: items.directive.coffee + */ + +(function() { + var FavItemDirective; + + FavItemDirective = function() { + var link, templateUrl; + link = function(scope, el, attrs, ctrl) { + return scope.vm = { + item: scope.item + }; + }; + templateUrl = function(el, attrs) { + if (attrs.itemType === "project") { + return "profile/profile-favs/items/project.html"; + } else { + return "profile/profile-favs/items/ticket.html"; + } + }; + return { + scope: { + "item": "=tgFavItem" + }, + link: link, + templateUrl: templateUrl + }; + }; + + angular.module("taigaProfile").directive("tgFavItem", FavItemDirective); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-favs.controller.coffee + */ + +(function() { + var FavsBaseController, ProfileLikedController, ProfileVotedController, ProfileWatchedController, debounceLeading, + extend = 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; }, + hasProp = {}.hasOwnProperty; + + debounceLeading = this.taiga.debounceLeading; + + FavsBaseController = (function() { + function FavsBaseController() { + this._init(); + } + + FavsBaseController.prototype._init = function() { + this.enableFilterByAll = true; + this.enableFilterByProjects = true; + this.enableFilterByUserStories = true; + this.enableFilterByTasks = true; + this.enableFilterByIssues = true; + this.enableFilterByTextQuery = true; + this._resetList(); + this.q = null; + return this.type = null; + }; + + FavsBaseController.prototype._resetList = function() { + this.items = Immutable.List(); + this.scrollDisabled = false; + return this._page = 1; + }; + + FavsBaseController.prototype._enableLoadingSpinner = function() { + return this.isLoading = true; + }; + + FavsBaseController.prototype._disableLoadingSpinner = function() { + return this.isLoading = false; + }; + + FavsBaseController.prototype._enableScroll = function() { + return this.scrollDisabled = false; + }; + + FavsBaseController.prototype._disableScroll = function() { + return this.scrollDisabled = true; + }; + + FavsBaseController.prototype._checkIfHasMorePages = function(hasNext) { + if (hasNext) { + this._page += 1; + return this._enableScroll(); + } else { + return this._disableScroll(); + } + }; + + FavsBaseController.prototype._checkIfHasNoResults = function() { + return this.hasNoResults = this.items.size === 0; + }; + + FavsBaseController.prototype.loadItems = function() { + this._enableLoadingSpinner(); + this._disableScroll(); + return this._getItems(this.user.get("id"), this._page, this.type, this.q).then((function(_this) { + return function(response) { + _this.items = _this.items.concat(response.get("data")); + _this._checkIfHasMorePages(response.get("next")); + _this._checkIfHasNoResults(); + _this._disableLoadingSpinner(); + return _this.items; + }; + })(this))["catch"]((function(_this) { + return function() { + _this._disableLoadingSpinner(); + return _this.items; + }; + })(this)); + }; + + FavsBaseController.prototype.filterByTextQuery = debounceLeading(500, function() { + this._resetList(); + return this.loadItems(); + }); + + FavsBaseController.prototype.showAll = function() { + if (this.type !== null) { + this.type = null; + this._resetList(); + return this.loadItems(); + } + }; + + FavsBaseController.prototype.showProjectsOnly = function() { + if (this.type !== "project") { + this.type = "project"; + this._resetList(); + return this.loadItems(); + } + }; + + FavsBaseController.prototype.showUserStoriesOnly = function() { + if (this.type !== "userstory") { + this.type = "userstory"; + this._resetList(); + return this.loadItems(); + } + }; + + FavsBaseController.prototype.showTasksOnly = function() { + if (this.type !== "task") { + this.type = "task"; + this._resetList(); + return this.loadItems(); + } + }; + + FavsBaseController.prototype.showIssuesOnly = function() { + if (this.type !== "issue") { + this.type = "issue"; + this._resetList(); + return this.loadItems(); + } + }; + + return FavsBaseController; + + })(); + + ProfileLikedController = (function(superClass) { + extend(ProfileLikedController, superClass); + + ProfileLikedController.$inject = ["tgUserService"]; + + function ProfileLikedController(userService) { + this.userService = userService; + ProfileLikedController.__super__.constructor.call(this); + this.enableFilterByAll = false; + this.enableFilterByProjects = false; + this.enableFilterByUserStories = false; + this.enableFilterByTasks = false; + this.enableFilterByIssues = false; + this.enableFilterByTextQuery = true; + this._getItems = this.userService.getLiked; + } + + return ProfileLikedController; + + })(FavsBaseController); + + angular.module("taigaProfile").controller("ProfileLiked", ProfileLikedController); + + ProfileVotedController = (function(superClass) { + extend(ProfileVotedController, superClass); + + ProfileVotedController.$inject = ["tgUserService"]; + + function ProfileVotedController(userService) { + this.userService = userService; + ProfileVotedController.__super__.constructor.call(this); + this.enableFilterByAll = true; + this.enableFilterByProjects = false; + this.enableFilterByUserStories = true; + this.enableFilterByTasks = true; + this.enableFilterByIssues = true; + this.enableFilterByTextQuery = true; + this._getItems = this.userService.getVoted; + } + + return ProfileVotedController; + + })(FavsBaseController); + + angular.module("taigaProfile").controller("ProfileVoted", ProfileVotedController); + + ProfileWatchedController = (function(superClass) { + extend(ProfileWatchedController, superClass); + + ProfileWatchedController.$inject = ["tgUserService"]; + + function ProfileWatchedController(userService) { + this.userService = userService; + ProfileWatchedController.__super__.constructor.call(this); + this._getItems = this.userService.getWatched; + } + + return ProfileWatchedController; + + })(FavsBaseController); + + angular.module("taigaProfile").controller("ProfileWatched", ProfileWatchedController); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-favs.directive.coffee + */ + +(function() { + var ProfileLikedDirective, ProfileVotedDirective, ProfileWatchedDirective, base; + + base = { + scope: {}, + bindToController: { + user: "=", + type: "@", + q: "@", + scrollDisabled: "@", + isLoading: "@", + hasNoResults: "@" + }, + controller: null, + controllerAs: "vm", + templateUrl: "profile/profile-favs/profile-favs.html" + }; + + ProfileLikedDirective = function() { + return _.extend({}, base, { + controller: "ProfileLiked" + }); + }; + + angular.module("taigaProfile").directive("tgProfileLiked", ProfileLikedDirective); + + ProfileVotedDirective = function() { + return _.extend({}, base, { + controller: "ProfileVoted" + }); + }; + + angular.module("taigaProfile").directive("tgProfileVoted", ProfileVotedDirective); + + ProfileWatchedDirective = function() { + return _.extend({}, base, { + controller: "ProfileWatched" + }); + }; + + angular.module("taigaProfile").directive("tgProfileWatched", ProfileWatchedDirective); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-hints.controller.coffee + */ + (function() { var ProfileHints; @@ -23875,6 +26483,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-hints.directive.coffee + */ + (function() { var ProfileHints; @@ -23893,6 +26521,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-projects.controller.coffee + */ + (function() { var ProfileProjectsController; @@ -23924,6 +26572,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-projects.directive.coffee + */ + (function() { var ProfileProjectsDirective; @@ -23948,6 +26616,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-tab.directive.coffee + */ + (function() { var ProfileTabDirective; @@ -23955,10 +26643,12 @@ var link; link = function(scope, element, attrs, ctrl, transclude) { scope.tab = {}; + attrs.$observe("tgProfileTab", function(name) { + return scope.tab.name = name; + }); attrs.$observe("tabTitle", function(title) { return scope.tab.title = title; }); - scope.tab.name = attrs.tgProfileTab; scope.tab.icon = attrs.tabIcon; scope.tab.active = !!attrs.tabActive; if (scope.$eval(attrs.tabDisabled) !== true) { @@ -23978,6 +26668,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-tabs.controller.coffee + */ + (function() { var ProfileTabsController; @@ -24005,6 +26715,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile-tabs.directive.coffee + */ + (function() { var ProfileTabsDirective; @@ -24022,6 +26752,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: profile.controller.coffee + */ + (function() { var ProfileController; @@ -24079,6 +26829,254 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: like-project-button.controller.coffee + */ + +(function() { + var LikeProjectButtonController; + + LikeProjectButtonController = (function() { + LikeProjectButtonController.$inject = ["$tgConfirm", "tgLikeProjectButtonService"]; + + function LikeProjectButtonController(confirm, likeButtonService) { + this.confirm = confirm; + this.likeButtonService = likeButtonService; + this.isMouseOver = false; + this.loading = false; + } + + LikeProjectButtonController.prototype.showTextWhenMouseIsOver = function() { + return this.isMouseOver = true; + }; + + LikeProjectButtonController.prototype.showTextWhenMouseIsLeave = function() { + return this.isMouseOver = false; + }; + + LikeProjectButtonController.prototype.toggleLike = function() { + var promise; + this.loading = true; + if (!this.project.get("is_fan")) { + promise = this._like(); + } else { + promise = this._unlike(); + } + promise["finally"]((function(_this) { + return function() { + return _this.loading = false; + }; + })(this)); + return promise; + }; + + LikeProjectButtonController.prototype._like = function() { + return this.likeButtonService.like(this.project.get('id')).then((function(_this) { + return function() { + return _this.showTextWhenMouseIsLeave(); + }; + })(this))["catch"]((function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this)); + }; + + LikeProjectButtonController.prototype._unlike = function() { + return this.likeButtonService.unlike(this.project.get('id'))["catch"]((function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this)); + }; + + return LikeProjectButtonController; + + })(); + + angular.module("taigaProjects").controller("LikeProjectButton", LikeProjectButtonController); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: like-project-button.directive.coffee + */ + +(function() { + var LikeProjectButtonDirective; + + LikeProjectButtonDirective = function() { + return { + scope: {}, + controller: "LikeProjectButton", + bindToController: { + project: '=' + }, + controllerAs: "vm", + templateUrl: "projects/components/like-project-button/like-project-button.html" + }; + }; + + angular.module("taigaProjects").directive("tgLikeProjectButton", LikeProjectButtonDirective); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: like-project-button.service.coffee + */ + +(function() { + var LikeProjectButtonService, taiga, + extend = 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; }, + hasProp = {}.hasOwnProperty; + + taiga = this.taiga; + + LikeProjectButtonService = (function(superClass) { + extend(LikeProjectButtonService, superClass); + + LikeProjectButtonService.$inject = ["tgResources", "tgCurrentUserService", "tgProjectService"]; + + function LikeProjectButtonService(rs, currentUserService, projectService) { + this.rs = rs; + this.currentUserService = currentUserService; + this.projectService = projectService; + } + + LikeProjectButtonService.prototype._getProjectIndex = function(projectId) { + return this.currentUserService.projects.get('all').findIndex(function(project) { + return project.get('id') === projectId; + }); + }; + + LikeProjectButtonService.prototype._updateProjects = function(projectId, isFan) { + var projectIndex, projects; + projectIndex = this._getProjectIndex(projectId); + projects = this.currentUserService.projects.get('all').update(projectIndex, function(project) { + var totalFans; + totalFans = project.get("total_fans"); + if (isFan) { + totalFans++; + } else { + totalFans--; + } + return project.merge({ + is_fan: isFan, + total_fans: totalFans + }); + }); + return this.currentUserService.setProjects(projects); + }; + + LikeProjectButtonService.prototype._updateCurrentProject = function(isFan) { + var project, totalFans; + totalFans = this.projectService.project.get("total_fans"); + if (isFan) { + totalFans++; + } else { + totalFans--; + } + project = this.projectService.project.merge({ + is_fan: isFan, + total_fans: totalFans + }); + return this.projectService.setProject(project); + }; + + LikeProjectButtonService.prototype.like = function(projectId) { + return this.rs.projects.likeProject(projectId).then((function(_this) { + return function() { + _this._updateProjects(projectId, true); + return _this._updateCurrentProject(true); + }; + })(this)); + }; + + LikeProjectButtonService.prototype.unlike = function(projectId) { + return this.rs.projects.unlikeProject(projectId).then((function(_this) { + return function() { + _this._updateProjects(projectId, false); + return _this._updateCurrentProject(false); + }; + })(this)); + }; + + return LikeProjectButtonService; + + })(taiga.Service); + + angular.module("taigaProjects").service("tgLikeProjectButtonService", LikeProjectButtonService); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: sort-projects.directive.coffee + */ + (function() { var SortProjectsDirective; @@ -24129,6 +27127,250 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: watch-project-button.controller.coffee + */ + +(function() { + var WatchProjectButtonController; + + WatchProjectButtonController = (function() { + WatchProjectButtonController.$inject = ["$tgConfirm", "tgWatchProjectButtonService"]; + + function WatchProjectButtonController(confirm, watchButtonService) { + this.confirm = confirm; + this.watchButtonService = watchButtonService; + this.showWatchOptions = false; + this.loading = false; + } + + WatchProjectButtonController.prototype.toggleWatcherOptions = function() { + return this.showWatchOptions = !this.showWatchOptions; + }; + + WatchProjectButtonController.prototype.closeWatcherOptions = function() { + return this.showWatchOptions = false; + }; + + WatchProjectButtonController.prototype.watch = function(notifyLevel) { + this.loading = true; + this.closeWatcherOptions(); + return this.watchButtonService.watch(this.project.get('id'), notifyLevel)["catch"]((function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this))["finally"]((function(_this) { + return function() { + return _this.loading = false; + }; + })(this)); + }; + + WatchProjectButtonController.prototype.unwatch = function() { + this.loading = true; + this.closeWatcherOptions(); + return this.watchButtonService.unwatch(this.project.get('id'))["catch"]((function(_this) { + return function() { + return _this.confirm.notify("error"); + }; + })(this))["finally"]((function(_this) { + return function() { + return _this.loading = false; + }; + })(this)); + }; + + return WatchProjectButtonController; + + })(); + + angular.module("taigaProjects").controller("WatchProjectButton", WatchProjectButtonController); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: watch-project-button.directive.coffee + */ + +(function() { + var WatchProjectButtonDirective; + + WatchProjectButtonDirective = function() { + return { + scope: {}, + controller: "WatchProjectButton", + bindToController: { + project: "=" + }, + controllerAs: "vm", + templateUrl: "projects/components/watch-project-button/watch-project-button.html" + }; + }; + + angular.module("taigaProjects").directive("tgWatchProjectButton", WatchProjectButtonDirective); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: watch-project-button.service.coffee + */ + +(function() { + var WatchProjectButtonService, taiga, + extend = 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; }, + hasProp = {}.hasOwnProperty; + + taiga = this.taiga; + + WatchProjectButtonService = (function(superClass) { + extend(WatchProjectButtonService, superClass); + + WatchProjectButtonService.$inject = ["tgResources", "tgCurrentUserService", "tgProjectService"]; + + function WatchProjectButtonService(rs, currentUserService, projectService) { + this.rs = rs; + this.currentUserService = currentUserService; + this.projectService = projectService; + } + + WatchProjectButtonService.prototype._getProjectIndex = function(projectId) { + return this.currentUserService.projects.get('all').findIndex(function(project) { + return project.get('id') === projectId; + }); + }; + + WatchProjectButtonService.prototype._updateProjects = function(projectId, notifyLevel, isWatcher) { + var projectIndex, projects; + projectIndex = this._getProjectIndex(projectId); + projects = this.currentUserService.projects.get('all').update(projectIndex, (function(_this) { + return function(project) { + var totalWatchers; + totalWatchers = project.get('total_watchers'); + if (isWatcher) { + totalWatchers++; + } else { + totalWatchers--; + } + return project.merge({ + is_watcher: isWatcher, + total_watchers: totalWatchers, + notify_level: notifyLevel + }); + }; + })(this)); + return this.currentUserService.setProjects(projects); + }; + + WatchProjectButtonService.prototype._updateCurrentProject = function(notifyLevel, isWatcher) { + var project, totalWatchers; + totalWatchers = this.projectService.project.get("total_watchers"); + if (isWatcher) { + totalWatchers++; + } else { + totalWatchers--; + } + project = this.projectService.project.merge({ + is_watcher: isWatcher, + total_watchers: totalWatchers, + notify_level: notifyLevel + }); + return this.projectService.setProject(project); + }; + + WatchProjectButtonService.prototype.watch = function(projectId, notifyLevel) { + return this.rs.projects.watchProject(projectId, notifyLevel).then((function(_this) { + return function() { + _this._updateProjects(projectId, notifyLevel, true); + return _this._updateCurrentProject(notifyLevel, true); + }; + })(this)); + }; + + WatchProjectButtonService.prototype.unwatch = function(projectId) { + return this.rs.projects.unwatchProject(projectId).then((function(_this) { + return function() { + _this._updateProjects(projectId, null, false); + return _this._updateCurrentProject(null, false); + }; + })(this)); + }; + + return WatchProjectButtonService; + + })(taiga.Service); + + angular.module("taigaProjects").service("tgWatchProjectButtonService", WatchProjectButtonService); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: projects-listing.controller.coffee + */ + (function() { var ProjectsListingController; @@ -24157,42 +27399,66 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: project.controller.coffee + */ + (function() { var ProjectController; ProjectController = (function() { - ProjectController.$inject = ["tgProjectsService", "$routeParams", "tgAppMetaService", "$tgAuth", "tgXhrErrorService", "$translate"]; + ProjectController.$inject = ["$routeParams", "tgAppMetaService", "$tgAuth", "$translate", "tgProjectService"]; - function ProjectController(projectsService, routeParams, appMetaService, auth, xhrError, translate) { + function ProjectController(routeParams, appMetaService, auth, translate, projectService) { var projectSlug; - this.projectsService = projectsService; this.routeParams = routeParams; this.appMetaService = appMetaService; this.auth = auth; - this.xhrError = xhrError; this.translate = translate; + this.projectService = projectService; projectSlug = this.routeParams.pslug; this.user = this.auth.userData; - this.projectsService.getProjectBySlug(projectSlug).then((function(_this) { - return function(project) { - _this.project = project; - return _this._setMeta(_this.project); - }; - })(this))["catch"]((function(_this) { - return function(xhr) { - return _this.xhrError.response(xhr); + taiga.defineImmutableProperty(this, "project", (function(_this) { + return function() { + return _this.projectService.project; }; })(this)); + taiga.defineImmutableProperty(this, "members", (function(_this) { + return function() { + return _this.projectService.activeMembers; + }; + })(this)); + this.appMetaService.setfn(this._setMeta.bind(this)); } ProjectController.prototype._setMeta = function(project) { - var ctx, description, title; + var ctx, metas; + metas = {}; + if (!this.project) { + return metas; + } ctx = { - projectName: project.get("name") + projectName: this.project.get("name") }; - title = this.translate.instant("PROJECT.PAGE_TITLE", ctx); - description = project.get("description"); - return this.appMetaService.setAll(title, description); + metas.title = this.translate.instant("PROJECT.PAGE_TITLE", ctx); + metas.description = this.project.get("description"); + return metas; }; return ProjectController; @@ -24203,6 +27469,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: projects.service.coffee + */ + (function() { var ProjectsService, groupBy, taiga, extend = 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; }, @@ -24281,6 +27567,87 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: external-apps-resource.service.coffee + */ + +(function() { + var Resource, module; + + Resource = function(urlsService, http) { + var service; + service = {}; + service.getApplicationToken = function(applicationId, state) { + var url; + url = urlsService.resolve("applications"); + url = url + "/" + applicationId + "/token?state=" + state; + return http.get(url).then(function(result) { + return Immutable.fromJS(result.data); + }); + }; + service.authorizeApplicationToken = function(applicationId, state) { + var data, url; + url = urlsService.resolve("application-tokens"); + url = url + "/authorize"; + data = { + "state": state, + "application": applicationId + }; + return http.post(url, data).then(function(result) { + return Immutable.fromJS(result.data); + }); + }; + return function() { + return { + "externalapps": service + }; + }; + }; + + Resource.$inject = ["$tgUrls", "$tgHttp"]; + + module = angular.module("taigaResources2"); + + module.factory("tgExternalAppsResource", Resource); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: issues-resource.service.coffee + */ + (function() { var Resource, module; @@ -24314,6 +27681,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: projects-resource.service.coffee + */ + (function() { var Resource, module, pagination; @@ -24375,6 +27762,29 @@ return paginateResponseService(result); }); }; + service.likeProject = function(projectId) { + var url; + url = urlsService.resolve("project-like", projectId); + return http.post(url); + }; + service.unlikeProject = function(projectId) { + var url; + url = urlsService.resolve("project-unlike", projectId); + return http.post(url); + }; + service.watchProject = function(projectId, notifyPolicy) { + var data, url; + data = { + notify_policy: notifyPolicy + }; + url = urlsService.resolve("project-watch", projectId); + return http.post(url, data); + }; + service.unwatchProject = function(projectId) { + var url; + url = urlsService.resolve("project-unwatch", projectId); + return http.post(url); + }; return function() { return { "projects": service @@ -24390,10 +27800,30 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: resources.coffee + */ + (function() { var Resources, services; - services = ["tgProjectsResources", "tgUsersResources", "tgUserstoriesResource", "tgTasksResource", "tgIssuesResource"]; + services = ["tgProjectsResources", "tgUserResources", "tgUsersResources", "tgUserstoriesResource", "tgTasksResource", "tgIssuesResource", "tgExternalAppsResource"]; Resources = function($injector) { var i, j, len, len1, ref, service, serviceFn, serviceName, serviceProperty; @@ -24419,6 +27849,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: tasks-resource.service.coffee + */ + (function() { var Resource, module; @@ -24452,6 +27902,96 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: user-resource.service.coffee + */ + +(function() { + var Resource, module; + + Resource = function(urlsService, http, paginateResponseService) { + var service; + service = {}; + service.getUserStorage = function(key) { + var httpOptions, url; + url = urlsService.resolve("user-storage"); + if (key) { + url += '/' + key; + } + httpOptions = {}; + return http.get(url, {}).then(function(response) { + return response.data.value; + }); + }; + service.setUserStorage = function(key, value) { + var params, url; + url = urlsService.resolve("user-storage") + '/' + key; + params = { + key: key, + value: value + }; + return http.put(url, params); + }; + service.createUserStorage = function(key, value) { + var params, url; + url = urlsService.resolve("user-storage"); + params = { + key: key, + value: value + }; + return http.post(url, params); + }; + return function() { + return { + "user": service + }; + }; + }; + + Resource.$inject = ["$tgUrls", "$tgHttp"]; + + module = angular.module("taigaResources2"); + + module.factory("tgUserResources", Resource); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: users-resource.service.coffee + */ + (function() { var Resource, module; @@ -24475,7 +28015,7 @@ }; service.getStats = function(userId) { var httpOptions, url; - url = urlsService.resolve("stats", userId); + url = urlsService.resolve("user-stats", userId); httpOptions = { headers: { "x-disable-pagination": "1" @@ -24487,7 +28027,7 @@ }; service.getContacts = function(userId) { var httpOptions, url; - url = urlsService.resolve("contacts", userId); + url = urlsService.resolve("user-contacts", userId); httpOptions = { headers: { "x-disable-pagination": "1" @@ -24497,6 +28037,60 @@ return Immutable.fromJS(result.data); }); }; + service.getLiked = function(userId, page, type, q) { + var params, url; + url = urlsService.resolve("user-liked", userId); + params = {}; + if (page != null) { + params.page = page; + } + if (type != null) { + params.type = type; + } + if (q != null) { + params.q = q; + } + return http.get(url, params).then(function(result) { + result = Immutable.fromJS(result); + return paginateResponseService(result); + }); + }; + service.getVoted = function(userId, page, type, q) { + var params, url; + url = urlsService.resolve("user-voted", userId); + params = {}; + if (page != null) { + params.page = page; + } + if (type != null) { + params.type = type; + } + if (q != null) { + params.q = q; + } + return http.get(url, params).then(function(result) { + result = Immutable.fromJS(result); + return paginateResponseService(result); + }); + }; + service.getWatched = function(userId, page, type, q) { + var params, url; + url = urlsService.resolve("user-watched", userId); + params = {}; + if (page != null) { + params.page = page; + } + if (type != null) { + params.type = type; + } + if (q != null) { + params.q = q; + } + return http.get(url, params).then(function(result) { + result = Immutable.fromJS(result); + return paginateResponseService(result); + }); + }; service.getProfileTimeline = function(userId, page) { var params, url; params = { @@ -24536,6 +28130,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: userstories-resource.service.coffee + */ + (function() { var Resource, module; @@ -24569,88 +28183,192 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: app-meta.service.coffee + */ + (function() { - var AppMetaService, taiga, truncate, - extend = 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; }, - hasProp = {}.hasOwnProperty; + var AppMetaService, taiga, truncate; taiga = this.taiga; truncate = taiga.truncate; - AppMetaService = (function(superClass) { - extend(AppMetaService, superClass); + AppMetaService = (function() { + AppMetaService.$inject = ["$rootScope"]; - function AppMetaService() { - return AppMetaService.__super__.constructor.apply(this, arguments); + function AppMetaService(rootScope) { + this.rootScope = rootScope; } + AppMetaService.prototype._set = function(key, value) { + var meta; + if (!key) { + return; + } + if (key === "title") { + meta = $("title"); + if (meta.length === 0) { + meta = $(""); + $("head").append(meta); + } + return meta.text(value || ""); + } else if (key.indexOf("og:") === 0) { + meta = $("meta[property='" + key + "']"); + if (meta.length === 0) { + meta = $(""); + $("head").append(meta); + } + return meta.attr("content", value || ""); + } else { + meta = $("meta[name='" + key + "']"); + if (meta.length === 0) { + meta = $(""); + $("head").append(meta); + } + return meta.attr("content", value || ""); + } + }; + + AppMetaService.prototype.setTitle = function(title) { + return this._set('title', title); + }; + + AppMetaService.prototype.setDescription = function(description) { + return this._set("description", truncate(description, 250)); + }; + + AppMetaService.prototype.setTwitterMetas = function(title, description) { + this._set("twitter:card", "summary"); + this._set("twitter:site", "@taigaio"); + this._set("twitter:title", title); + this._set("twitter:description", truncate(description, 300)); + return this._set("twitter:image", window.location.origin + "/images/logo-color.png"); + }; + + AppMetaService.prototype.setOpenGraphMetas = function(title, description) { + this._set("og:type", "object"); + this._set("og:site_name", "Taiga - Love your projects"); + this._set("og:title", title); + this._set("og:description", truncate(description, 300)); + this._set("og:image", window.location.origin + "/images/logo-color.png"); + return this._set("og:url", window.location.href); + }; + + AppMetaService.prototype.setAll = function(title, description) { + this.setTitle(title); + this.setDescription(description); + this.setTwitterMetas(title, description); + return this.setOpenGraphMetas(title, description); + }; + + AppMetaService.prototype.addMobileViewport = function() { + return $("head").append(""); + }; + + AppMetaService.prototype.removeMobileViewport = function() { + return $("meta[name=\"viewport\"]").remove(); + }; + + AppMetaService.prototype.setfn = function(fn) { + if (this.listener) { + this._listener(); + } + return this._listener = this.rootScope.$watchCollection(fn, (function(_this) { + return function(metas) { + return _this.setAll(metas.title, metas.description); + }; + })(this)); + }; + return AppMetaService; - })(taiga.Service = function() { - return { - _set: function(key, value) { - var meta; - if (!key) { - return; - } - if (key === "title") { - meta = $("title"); - if (meta.length === 0) { - meta = $(""); - $("head").append(meta); - } - return meta.text(value || ""); - } else if (key.indexOf("og:") === 0) { - meta = $("meta[property='" + key + "']"); - if (meta.length === 0) { - meta = $(""); - $("head").append(meta); - } - return meta.attr("content", value || ""); - } else { - meta = $("meta[name='" + key + "']"); - if (meta.length === 0) { - meta = $(""); - $("head").append(meta); - } - return meta.attr("content", value || ""); - } - }, - setTitle: function(title) { - return this._set('title', title); - }, - setDescription: function(description) { - return this._set("description", truncate(description, 250)); - }, - setTwitterMetas: function(title, description) { - this._set("twitter:card", "summary"); - this._set("twitter:site", "@taigaio"); - this._set("twitter:title", title); - this._set("twitter:description", truncate(description, 300)); - return this._set("twitter:image", window.location.origin + "/images/logo-color.png"); - }, - setOpenGraphMetas: function(title, description) { - this._set("og:type", "object"); - this._set("og:site_name", "Taiga - Love your projects"); - this._set("og:title", title); - this._set("og:description", truncate(description, 300)); - this._set("og:image", window.location.origin + "/images/logo-color.png"); - return this._set("og:url", window.location.href); - }, - setAll: function(title, description) { - this.setTitle(title); - this.setDescription(description); - this.setTwitterMetas(title, description); - return this.setOpenGraphMetas(title, description); - } - }; - }); + })(); angular.module("taigaCommon").service("tgAppMetaService", AppMetaService); }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: check-permissions.service.coffee + */ + +(function() { + var ChekcPermissionsService, taiga; + + taiga = this.taiga; + + ChekcPermissionsService = (function() { + ChekcPermissionsService.$inject = ["tgProjectService"]; + + function ChekcPermissionsService(projectService) { + this.projectService = projectService; + } + + ChekcPermissionsService.prototype.check = function(permission) { + return this.projectService.project.get('my_permissions').indexOf(permission) !== -1; + }; + + return ChekcPermissionsService; + + })(); + + angular.module("taigaCommon").service("tgCheckPermissionsService", ChekcPermissionsService); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: current-user.service.coffee + */ + (function() { var CurrentUserService, groupBy, taiga; @@ -24659,14 +28377,16 @@ groupBy = this.taiga.groupBy; CurrentUserService = (function() { - CurrentUserService.$inject = ["tgProjectsService", "$tgStorage"]; + CurrentUserService.$inject = ["tgProjectsService", "$tgStorage", "tgResources"]; - function CurrentUserService(projectsService, storageService) { + function CurrentUserService(projectsService, storageService, rs) { this.projectsService = projectsService; this.storageService = storageService; + this.rs = rs; this._user = null; this._projects = Immutable.Map(); this._projectsById = Immutable.Map(); + this._joyride = null; taiga.defineImmutableProperty(this, "projects", (function(_this) { return function() { return _this._projects; @@ -24701,7 +28421,8 @@ CurrentUserService.prototype.removeUser = function() { this._user = null; this._projects = Immutable.Map(); - return this._projectsById = Immutable.Map(); + this._projectsById = Immutable.Map(); + return this._joyride = null; }; CurrentUserService.prototype.setUser = function(user) { @@ -24712,26 +28433,66 @@ CurrentUserService.prototype.bulkUpdateProjectsOrder = function(sortData) { return this.projectsService.bulkUpdateProjectsOrder(sortData).then((function(_this) { return function() { - return _this._loadProjects(); + return _this.loadProjects(); }; })(this)); }; - CurrentUserService.prototype._loadProjects = function() { + CurrentUserService.prototype.loadProjects = function() { return this.projectsService.getProjectsByUserId(this._user.get("id")).then((function(_this) { return function(projects) { - _this._projects = _this._projects.set("all", projects); - _this._projects = _this._projects.set("recents", projects.slice(0, 10)); - _this._projectsById = Immutable.fromJS(groupBy(projects.toJS(), function(p) { - return p.id; - })); - return _this.projects; + return _this.setProjects(projects); + }; + })(this)); + }; + + CurrentUserService.prototype.disableJoyRide = function(section) { + if (section) { + this._joyride[section] = false; + } else { + this._joyride = { + backlog: false, + kanban: false, + dashboard: false + }; + } + return this.rs.user.setUserStorage('joyride', this._joyride); + }; + + CurrentUserService.prototype.loadJoyRideConfig = function() { + return new Promise((function(_this) { + return function(resolve) { + if (_this._joyride !== null) { + resolve(_this._joyride); + return; + } + return _this.rs.user.getUserStorage('joyride').then(function(config) { + _this._joyride = config; + return resolve(_this._joyride); + })["catch"](function() { + _this._joyride = { + backlog: true, + kanban: true, + dashboard: true + }; + _this.rs.user.createUserStorage('joyride', _this._joyride); + return resolve(_this._joyride); + }); }; })(this)); }; CurrentUserService.prototype._loadUserInfo = function() { - return this._loadProjects(); + return Promise.all([this.loadProjects()]); + }; + + CurrentUserService.prototype.setProjects = function(projects) { + this._projects = this._projects.set("all", projects); + this._projects = this._projects.set("recents", projects.slice(0, 10)); + this._projectsById = Immutable.fromJS(groupBy(projects.toJS(), function(p) { + return p.id; + })); + return this.projects; }; return CurrentUserService; @@ -24742,6 +28503,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: lightbox-factory.service.coffee + */ + (function() { var LightboxFactory; @@ -24773,6 +28554,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: paginate-response.service.coffee + */ + (function() { var PaginateResponse; @@ -24794,19 +28595,41 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: project.service.coffee + */ + (function() { var ProjectService, taiga; taiga = this.taiga; ProjectService = (function() { - ProjectService.$inject = ["tgProjectsService"]; + ProjectService.$inject = ["tgProjectsService", "tgXhrErrorService"]; - function ProjectService(projectsService) { + function ProjectService(projectsService, xhrError) { this.projectsService = projectsService; + this.xhrError = xhrError; this._project = null; this._section = null; this._sectionsBreadcrumb = Immutable.List(); + this._activeMembers = Immutable.List(); taiga.defineImmutableProperty(this, "project", (function(_this) { return function() { return _this._project; @@ -24822,6 +28645,11 @@ return _this._sectionsBreadcrumb; }; })(this)); + taiga.defineImmutableProperty(this, "activeMembers", (function(_this) { + return function() { + return _this._activeMembers; + }; + })(this)); } ProjectService.prototype.setSection = function(section) { @@ -24833,24 +28661,43 @@ } }; - ProjectService.prototype.setProject = function(pslug) { - if (this._pslug !== pslug) { - this._pslug = pslug; - return this.fetchProject(); - } + ProjectService.prototype.setProjectBySlug = function(pslug) { + return new Promise((function(_this) { + return function(resolve, reject) { + if (!_this.project || _this.project.get('slug') !== pslug) { + return _this.projectsService.getProjectBySlug(pslug).then(function(project) { + _this.setProject(project); + return resolve(); + })["catch"](function(xhr) { + return _this.xhrError.response(xhr); + }); + } else { + return resolve(); + } + }; + })(this)); + }; + + ProjectService.prototype.setProject = function(project) { + this._project = project; + return this._activeMembers = this._project.get('members').filter(function(member) { + return member.get('is_active'); + }); }; ProjectService.prototype.cleanProject = function() { - this._pslug = null; this._project = null; + this._activeMembers = Immutable.List(); this._section = null; return this._sectionsBreadcrumb = Immutable.List(); }; ProjectService.prototype.fetchProject = function() { - return this.projectsService.getProjectBySlug(this._pslug).then((function(_this) { + var pslug; + pslug = this.project.get('slug'); + return this.projectsService.getProjectBySlug(pslug).then((function(_this) { return function(project) { - return _this._project = project; + return _this.setProject(project); }; })(this)); }; @@ -24863,6 +28710,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: scope-event.service.coffee + */ + (function() { var ScopeEvent; @@ -24918,13 +28785,89 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: theme.service.coffee + */ + (function() { - var UserService, taiga, + var ThemeService, taiga, extend = 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; }, hasProp = {}.hasOwnProperty; taiga = this.taiga; + ThemeService = (function(superClass) { + extend(ThemeService, superClass); + + function ThemeService() { + return ThemeService.__super__.constructor.apply(this, arguments); + } + + return ThemeService; + + })(taiga.Service = function() { + return { + use: function(themeName) { + var stylesheetEl; + stylesheetEl = $("link[rel='stylesheet']"); + if (stylesheetEl.length === 0) { + stylesheetEl = $(""); + $("head").append(stylesheetEl); + } + return stylesheetEl.attr("href", "/styles/theme-" + themeName + ".css"); + } + }; + }); + + angular.module("taigaCommon").service("tgThemeService", ThemeService); + +}).call(this); + + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: user.service.coffee + */ + +(function() { + var UserService, bindMethods, taiga, + extend = 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; }, + hasProp = {}.hasOwnProperty; + + taiga = this.taiga; + + bindMethods = taiga.bindMethods; + UserService = (function(superClass) { extend(UserService, superClass); @@ -24932,6 +28875,7 @@ function UserService(rs) { this.rs = rs; + bindMethods(this); } UserService.prototype.getUserByUserName = function(username) { @@ -24942,6 +28886,18 @@ return this.rs.users.getContacts(userId); }; + UserService.prototype.getLiked = function(userId, pageNumber, objectType, textQuery) { + return this.rs.users.getLiked(userId, pageNumber, objectType, textQuery); + }; + + UserService.prototype.getVoted = function(userId, pageNumber, objectType, textQuery) { + return this.rs.users.getVoted(userId, pageNumber, objectType, textQuery); + }; + + UserService.prototype.getWatched = function(userId, pageNumber, objectType, textQuery) { + return this.rs.users.getWatched(userId, pageNumber, objectType, textQuery); + }; + UserService.prototype.getStats = function(userId) { return this.rs.users.getStats(userId); }; @@ -24970,6 +28926,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: xhrError.service.coffee + */ + (function() { var xhrError, extend = 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; }, @@ -25015,6 +28991,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: user-timeline-attachment.directive.coffee + */ + (function() { var UserTimelineAttachmentDirective; @@ -25029,7 +29025,7 @@ }; link = function(scope, el) { var is_image, templateHtml; - is_image = isImage(scope.attachment.url); + is_image = isImage(scope.attachment.get('url')); if (is_image) { templateHtml = template.get("user-timeline/user-timeline-attachment/user-timeline-attachment-image.html"); } else { @@ -25055,6 +29051,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: user-timeline-item-title.service.coffee + */ + (function() { var UserTimelineItemTitle, unslugify; @@ -25072,7 +29088,77 @@ 'severity': 'ISSUES.FIELDS.SEVERITY', 'priority': 'ISSUES.FIELDS.PRIORITY', 'type': 'ISSUES.FIELDS.TYPE', - 'is_iocaine': 'TASK.FIELDS.IS_IOCAINE' + 'is_iocaine': 'TASK.FIELDS.IS_IOCAINE', + 'is_blocked': 'COMMON.FIELDS.IS_BLOCKED' + }; + + UserTimelineItemTitle.prototype._params = { + username: function(timeline, event) { + var title_attr, url, user; + user = timeline.getIn(['data', 'user']); + if (user.get('is_profile_visible')) { + title_attr = this.translate.instant('COMMON.SEE_USER_PROFILE', { + username: user.get('username') + }); + url = "user-profile:username=timeline.getIn(['data', 'user', 'username'])"; + return this._getLink(url, user.get('name'), title_attr); + } else { + return this._getUsernameSpan(user.get('name')); + } + }, + field_name: function(timeline, event) { + var field_name; + field_name = timeline.getIn(['data', 'value_diff', 'key']); + return this.translate.instant(this._fieldTranslationKey[field_name]); + }, + project_name: function(timeline, event) { + var url; + url = "project:project=timeline.getIn(['data', 'project', 'slug'])"; + return this._getLink(url, timeline.getIn(["data", "project", "name"])); + }, + new_value: function(timeline, event) { + var value; + if (_.isArray(timeline.getIn(["data", "value_diff", "value"]).toJS())) { + value = timeline.getIn(["data", "value_diff", "value"]).get(1); + if (value === null && timeline.getIn(["data", "value_diff", "key"]) === 'assigned_to') { + value = this.translate.instant('ACTIVITY.VALUES.UNASSIGNED'); + } + return value; + } else { + return timeline.getIn(["data", "value_diff", "value"]).first().get(1); + } + }, + sprint_name: function(timeline, event) { + var url; + url = "project-taskboard:project=timeline.getIn(['data', 'project', 'slug']),sprint=timeline.getIn(['data', 'milestone', 'slug'])"; + return this._getLink(url, timeline.getIn(['data', 'milestone', 'name'])); + }, + us_name: function(timeline, event) { + var event_us, obj, text, url; + obj = this._getTimelineObj(timeline, event).get('userstory'); + event_us = { + obj: 'parent_userstory' + }; + url = this._getDetailObjUrl(event_us); + text = '#' + obj.get('ref') + ' ' + obj.get('subject'); + return this._getLink(url, text); + }, + obj_name: function(timeline, event) { + var obj, text, url; + obj = this._getTimelineObj(timeline, event); + url = this._getDetailObjUrl(event); + if (event.obj === 'wikipage') { + text = unslugify(obj.get('slug')); + } else if (event.obj === 'milestone') { + text = obj.get('name'); + } else { + text = '#' + obj.get('ref') + ' ' + obj.get('subject'); + } + return this._getLink(url, text); + }, + role_name: function(timeline, event) { + return timeline.getIn(['data', 'value_diff', 'value']).keySeq().first(); + } }; function UserTimelineItemTitle(translate) { @@ -25080,58 +29166,22 @@ } UserTimelineItemTitle.prototype._translateTitleParams = function(param, timeline, event) { - var event_us, field_name, obj, text, title_attr, url, user; - if (param === "username") { - user = timeline.data.user; - title_attr = this.translate.instant('COMMON.SEE_USER_PROFILE', { - username: user.username - }); - url = 'user-profile:username=vm.activity.user.username'; - return this._getLink(url, user.name, title_attr); - } else if (param === 'field_name') { - field_name = Object.keys(timeline.data.values_diff)[0]; - return this.translate.instant(this._fieldTranslationKey[field_name]); - } else if (param === 'project_name') { - url = 'project:project=vm.activity.project.slug'; - return this._getLink(url, timeline.data.project.name); - } else if (param === 'sprint_name') { - url = 'project-taskboard:project=vm.activity.project.slug,sprint=vm.activity.sprint.slug'; - return this._getLink(url, timeline.data.milestone.name); - } else if (param === 'us_name') { - obj = this._getTimelineObj(timeline, event).userstory; - event_us = { - obj: 'parent_userstory' - }; - url = this._getDetailObjUrl(event_us); - text = '#' + obj.ref + ' ' + obj.subject; - return this._getLink(url, text); - } else if (param === 'obj_name') { - obj = this._getTimelineObj(timeline, event); - url = this._getDetailObjUrl(event); - if (event.obj === 'wikipage') { - text = unslugify(obj.slug); - } else if (event.obj === 'milestone') { - text = obj.name; - } else { - text = '#' + obj.ref + ' ' + obj.subject; - } - return this._getLink(url, text); - } + return this._params[param].call(this, timeline, event); }; UserTimelineItemTitle.prototype._getTimelineObj = function(timeline, event) { - return timeline.data[event.obj]; + return timeline.getIn(['data', event.obj]); }; UserTimelineItemTitle.prototype._getDetailObjUrl = function(event) { var url; url = { - "issue": ["project-issues-detail", ":project=vm.activity.project.slug,ref=vm.activity.obj.ref"], - "wikipage": ["project-wiki-page", ":project=vm.activity.project.slug,slug=vm.activity.obj.slug"], - "task": ["project-tasks-detail", ":project=vm.activity.project.slug,ref=vm.activity.obj.ref"], - "userstory": ["project-userstories-detail", ":project=vm.activity.project.slug,ref=vm.activity.obj.ref"], - "parent_userstory": ["project-userstories-detail", ":project=vm.activity.project.slug,ref=vm.activity.obj.userstory.ref"], - "milestone": ["project-taskboard", ":project=vm.activity.project.slug,sprint=vm.activity.obj.slug"] + "issue": ["project-issues-detail", ":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"], + "wikipage": ["project-wiki-page", ":project=timeline.getIn(['data', 'project', 'slug']),slug=timeline.getIn(['obj', 'slug'])"], + "task": ["project-tasks-detail", ":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"], + "userstory": ["project-userstories-detail", ":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'ref'])"], + "parent_userstory": ["project-userstories-detail", ":project=timeline.getIn(['data', 'project', 'slug']),ref=timeline.getIn(['obj', 'userstory', 'ref'])"], + "milestone": ["project-taskboard", ":project=timeline.getIn(['data', 'project', 'slug']),sprint=timeline.getIn(['obj', 'slug'])"] }; return url[event.obj][0] + url[event.obj][1]; }; @@ -25141,6 +29191,12 @@ return $('').attr('tg-nav', url).text(text).attr('title', title).prop('outerHTML'); }; + UserTimelineItemTitle.prototype._getUsernameSpan = function(text) { + var title; + title = title || text; + return $('').addClass('username').text(text).prop('outerHTML'); + }; + UserTimelineItemTitle.prototype._getParams = function(timeline, event, timeline_type) { var params; params = {}; @@ -25164,11 +29220,31 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: user-timeline-item-type.service.coffee + */ + (function() { var UserTimelineType, timelineType; timelineType = function(timeline, event) { - var field_name, types; + var types; types = [ { check: function(timeline, event) { @@ -25177,10 +29253,10 @@ key: 'TIMELINE.NEW_MEMBER', translate_params: ['project_name'], member: function(timeline) { - return { - user: timeline.data.user, - role: timeline.data.role - }; + return Immutable.Map({ + user: timeline.getIn(['data', 'user']), + role: timeline.getIn(['data', 'role']) + }); } }, { check: function(timeline, event) { @@ -25189,11 +29265,11 @@ key: 'TIMELINE.NEW_PROJECT', translate_params: ['username', 'project_name'], description: function(timeline) { - return timeline.data.project.description; + return timeline.getIn(['data', 'project', 'description']); } }, { check: function(timeline, event) { - return event.type === 'change' && timeline.data.values_diff.attachments; + return event.type === 'change' && timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'attachments'; }, key: 'TIMELINE.UPLOAD_ATTACHMENT', translate_params: ['username', 'obj_name'] @@ -25217,13 +29293,13 @@ translate_params: ['username', 'project_name', 'obj_name'] }, { check: function(timeline, event) { - return event.obj === 'task' && event.type === 'create' && !timeline.data.task.userstory; + return event.obj === 'task' && event.type === 'create' && !timeline.getIn(['data', 'task', 'userstory']); }, key: 'TIMELINE.TASK_CREATED', translate_params: ['username', 'project_name', 'obj_name'] }, { check: function(timeline, event) { - return event.obj === 'task' && event.type === 'create' && timeline.data.task.userstory; + return event.obj === 'task' && event.type === 'create' && timeline.getIn(['data', 'task', 'userstory']); }, key: 'TIMELINE.TASK_CREATED_WITH_US', translate_params: ['username', 'project_name', 'obj_name', 'us_name'] @@ -25235,44 +29311,41 @@ translate_params: ['username', 'project_name', 'obj_name'] }, { check: function(timeline, event) { - return timeline.data.comment && event.obj === 'userstory'; + return timeline.getIn(['data', 'comment']) && event.obj === 'userstory'; }, key: 'TIMELINE.NEW_COMMENT_US', translate_params: ['username', 'obj_name'], description: function(timeline) { - return $(timeline.data.comment_html).text(); + return $(timeline.getIn(['data', 'comment_html'])).text(); } }, { check: function(timeline, event) { - return timeline.data.comment && event.obj === 'issue'; + return timeline.getIn(['data', 'comment']) && event.obj === 'issue'; }, key: 'TIMELINE.NEW_COMMENT_ISSUE', translate_params: ['username', 'obj_name'], description: function(timeline) { - return $(timeline.data.comment_html).text(); + return $(timeline.getIn(['data', 'comment_html'])).text(); } }, { check: function(timeline, event) { - return timeline.data.comment && event.obj === 'task'; + return timeline.getIn(['data', 'comment']) && event.obj === 'task'; }, key: 'TIMELINE.NEW_COMMENT_TASK', translate_params: ['username', 'obj_name'], description: function(timeline) { - return $(timeline.data.comment_html).text(); + return $(timeline.getIn(['data', 'comment_html'])).text(); } }, { - check: function(timeline, event, field_name) { - if (field_name === 'milestone' && event.type === 'change') { - return timeline.data.values_diff.milestone[0] === null; - } - return false; + check: function(timeline, event) { + return timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'moveInBacklog' && timeline.hasIn(['data', 'value_diff', 'value', 'backlog_order']) && event.type === 'change'; }, - key: 'TIMELINE.US_ADDED_MILESTONE', - translate_params: ['username', 'obj_name', 'sprint_name'] + key: 'TIMELINE.US_MOVED', + translate_params: ['username', 'obj_name'] }, { - check: function(timeline, event, field_name) { - if (field_name === 'milestone' && event.type === 'change') { - return timeline.data.values_diff.milestone[1] === null; + check: function(timeline, event) { + if (timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'moveInBacklog' && event.type === 'change') { + return timeline.getIn(['data', 'value_diff', 'value', 'milestone']).get(1) === null; } return false; }, @@ -25280,24 +29353,30 @@ translate_params: ['username', 'obj_name'] }, { check: function(timeline, event) { - if (event.type === 'change' && timeline.data.values_diff.is_blocked) { - return timeline.data.values_diff.is_blocked[1] === true; + return timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'moveInBacklog' && event.type === 'change'; + }, + key: 'TIMELINE.US_ADDED_MILESTONE', + translate_params: ['username', 'obj_name', 'sprint_name'] + }, { + check: function(timeline, event) { + if (timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'blocked' && event.type === 'change') { + return timeline.getIn(['data', 'value_diff', 'value', 'is_blocked']).get(1) === true; } return false; }, key: 'TIMELINE.BLOCKED', translate_params: ['username', 'obj_name'], description: function(timeline) { - if (timeline.data.values_diff.blocked_note_html) { - return $(timeline.data.values_diff.blocked_note_html[1]).text(); + if (timeline.hasIn(['data', 'value_diff', 'value', 'blocked_note_html'])) { + return $(timeline.getIn(['data', 'value_diff', 'value', 'blocked_note_html']).get(1)).text(); } else { return false; } } }, { check: function(timeline, event) { - if (event.type === 'change' && timeline.data.values_diff.is_blocked) { - return timeline.data.values_diff.is_blocked[1] === false; + if (timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'blocked' && event.type === 'change') { + return timeline.getIn(['data', 'value_diff', 'value', 'is_blocked']).get(1) === false; } return false; }, @@ -25317,28 +29396,58 @@ translate_params: ['username', 'obj_name'] }, { check: function(timeline, event) { - return event.obj === 'userstory' && event.type === 'change'; + return event.obj === 'userstory' && event.type === 'change' && timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'points'; + }, + key: 'TIMELINE.US_UPDATED_POINTS', + translate_params: ['username', 'field_name', 'obj_name', 'new_value', 'role_name'] + }, { + check: function(timeline, event) { + return event.obj === 'userstory' && event.type === 'change' && timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'description_diff'; }, key: 'TIMELINE.US_UPDATED', translate_params: ['username', 'field_name', 'obj_name'] }, { check: function(timeline, event) { - return event.obj === 'issue' && event.type === 'change'; + return event.obj === 'userstory' && event.type === 'change'; + }, + key: 'TIMELINE.US_UPDATED_WITH_NEW_VALUE', + translate_params: ['username', 'field_name', 'obj_name', 'new_value'] + }, { + check: function(timeline, event) { + return event.obj === 'issue' && event.type === 'change' && timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'description_diff'; }, key: 'TIMELINE.ISSUE_UPDATED', translate_params: ['username', 'field_name', 'obj_name'] }, { check: function(timeline, event) { - return event.obj === 'task' && event.type === 'change' && !timeline.data.task.userstory; + return event.obj === 'issue' && event.type === 'change'; + }, + key: 'TIMELINE.ISSUE_UPDATED_WITH_NEW_VALUE', + translate_params: ['username', 'field_name', 'obj_name', 'new_value'] + }, { + check: function(timeline, event) { + return event.obj === 'task' && event.type === 'change' && !timeline.getIn('data', 'task', 'userstory') && timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'description_diff'; }, key: 'TIMELINE.TASK_UPDATED', translate_params: ['username', 'field_name', 'obj_name'] }, { check: function(timeline, event) { - return event.obj === 'task' && event.type === 'change' && timeline.data.task.userstory; + return event.obj === 'task' && event.type === 'change' && timeline.getIn('data', 'task', 'userstory') && timeline.hasIn(['data', 'value_diff']) && timeline.getIn(['data', 'value_diff', 'key']) === 'description_diff'; }, key: 'TIMELINE.TASK_UPDATED_WITH_US', translate_params: ['username', 'field_name', 'obj_name', 'us_name'] + }, { + check: function(timeline, event) { + return event.obj === 'task' && event.type === 'change' && !timeline.getIn(['data', 'task', 'userstory']); + }, + key: 'TIMELINE.TASK_UPDATED_WITH_NEW_VALUE', + translate_params: ['username', 'field_name', 'obj_name', 'new_value'] + }, { + check: function(timeline, event) { + return event.obj === 'task' && event.type === 'change' && timeline.getIn(['data', 'task', 'userstory']); + }, + key: 'TIMELINE.TASK_UPDATED_WITH_US_NEW_VALUE', + translate_params: ['username', 'field_name', 'obj_name', 'us_name', 'new_value'] }, { check: function(timeline, event) { return event.obj === 'user' && event.type === 'create'; @@ -25347,11 +29456,8 @@ translate_params: ['username'] } ]; - if (timeline.data.values_diff) { - field_name = Object.keys(timeline.data.values_diff)[0]; - } return _.find(types, function(obj) { - return obj.check(timeline, event, field_name); + return obj.check(timeline, event); }); }; @@ -25370,68 +29476,31 @@ }).call(this); -(function() { - var UserTimelineItemController; - UserTimelineItemController = (function() { - UserTimelineItemController.$inject = ["tgUserTimelineItemType", "tgUserTimelineItemTitle"]; - - function UserTimelineItemController(userTimelineItemType, userTimelineItemTitle) { - var event, ref, timeline, type; - this.userTimelineItemType = userTimelineItemType; - this.userTimelineItemTitle = userTimelineItemTitle; - timeline = this.timeline.toJS(); - event = this.parseEventType(timeline.event_type); - type = this.userTimelineItemType.getType(timeline, event); - this.activity = {}; - this.activity.user = timeline.data.user; - this.activity.project = timeline.data.project; - this.activity.sprint = timeline.data.milestone; - this.activity.title = this.userTimelineItemTitle.getTitle(timeline, event, type); - this.activity.created_formated = moment(timeline.created).fromNow(); - this.activity.obj = this.getObject(timeline, event); - if (type.description) { - this.activity.description = type.description(timeline); - } - if (type.member) { - this.activity.member = type.member(timeline); - } - if ((ref = timeline.data.values_diff) != null ? ref.attachments : void 0) { - this.activity.attachments = timeline.data.values_diff.attachments["new"]; - } - } - - UserTimelineItemController.prototype.parseEventType = function(event_type) { - event_type = event_type.split("."); - return { - section: event_type[0], - obj: event_type[1], - type: event_type[2] - }; - }; - - UserTimelineItemController.prototype.getObject = function(timeline, event) { - if (timeline.data[event.obj]) { - return timeline.data[event.obj]; - } - }; - - return UserTimelineItemController; - - })(); - - angular.module("taigaUserTimeline").controller("UserTimelineItem", UserTimelineItemController); - -}).call(this); +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: user-timeline-item.directive.coffee + */ (function() { var UserTimelineItemDirective; UserTimelineItemDirective = function() { return { - controllerAs: "vm", - controller: "UserTimelineItem", - bindToController: true, templateUrl: "user-timeline/user-timeline-item/user-timeline-item.html", scope: { timeline: "=tgUserTimelineItem" @@ -25443,11 +29512,33 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: user-timeline-pagination-sequence.service.coffee + */ + (function() { var UserTimelinePaginationSequence; UserTimelinePaginationSequence = function() { - return function(config) { + var obj; + obj = {}; + obj.generate = function(config) { var getContent, items, next, page; page = 1; items = Immutable.List(); @@ -25462,7 +29553,10 @@ page++; data = response.get("data"); if (config.filter) { - data = config.filter(response.get("data")); + data = config.filter(data); + } + if (config.map) { + data = data.map(config.map); } items = items.concat(data); if (items.size < config.minItems && response.get("next")) { @@ -25480,6 +29574,7 @@ } }; }; + return obj; }; angular.module("taigaUserTimeline").factory("tgUserTimelinePaginationSequenceService", UserTimelinePaginationSequence); @@ -25488,23 +29583,23 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# + * * File: modules/profile/profile-timeline/profile-timeline.controller.coffee */ @@ -25557,6 +29652,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: user-timeline.directive.coffee + */ + (function() { var UserTimelineDirective; @@ -25578,6 +29693,26 @@ }).call(this); + +/* + * Copyright (C) 2014-2015 Taiga Agile LLC + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program 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 program. If not, see . + * + * File: user-timeline.service.coffee + */ + (function() { var UserTimelineService, taiga, extend = 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; }, @@ -25588,29 +29723,27 @@ UserTimelineService = (function(superClass) { extend(UserTimelineService, superClass); - UserTimelineService.$inject = ["tgResources", "tgUserTimelinePaginationSequenceService"]; + UserTimelineService.$inject = ["tgResources", "tgUserTimelinePaginationSequenceService", "tgUserTimelineItemType", "tgUserTimelineItemTitle"]; - function UserTimelineService(rs, userTimelinePaginationSequenceService) { + function UserTimelineService(rs, userTimelinePaginationSequenceService, userTimelineItemType, userTimelineItemTitle) { this.rs = rs; this.userTimelinePaginationSequenceService = userTimelinePaginationSequenceService; + this.userTimelineItemType = userTimelineItemType; + this.userTimelineItemTitle = userTimelineItemTitle; } + UserTimelineService.prototype._valid_fields = ['status', 'subject', 'description_diff', 'assigned_to', 'points', 'severity', 'priority', 'type', 'attachments', 'is_iocaine', 'content_diff', 'name', 'estimated_finish', 'estimated_start', 'blocked', 'moveInBacklog', 'milestone']; + UserTimelineService.prototype._invalid = [ { check: function(timeline) { - var values, values_diff; - values_diff = timeline.get("data").get("values_diff"); - if (values_diff) { - values = Object.keys(values_diff.toJS()); - } - if (values && values.length) { - if (_.every(values, (function(_this) { - return function(value) { - return _this._valid_fields.indexOf(value) === -1; - }; - })(this))) { + var fieldKey, value_diff; + value_diff = timeline.get("data").get("value_diff"); + if (value_diff) { + fieldKey = value_diff.get('key'); + if (this._valid_fields.indexOf(fieldKey) === -1) { return true; - } else if (values[0] === 'attachments' && values_diff.get('attachments').get('new').size === 0) { + } else if (fieldKey === 'attachments' && value_diff.get('value').get('new').size === 0) { return true; } } @@ -25634,18 +29767,17 @@ } }, { check: function(timeline) { - var event; + var event, value_diff; event = timeline.get('event_type').split("."); - if (event[1] === "task" && event[2] === "change") { - return timeline.get("data").get("values_diff").get("milestone"); + value_diff = timeline.get("data").get("value_diff"); + if (value_diff && event[1] === "task" && event[2] === "change" && value_diff.get("key") === "milestone") { + return timeline.get("data").get("value_diff").get("value"); } return false; } } ]; - UserTimelineService.prototype._valid_fields = ['status', 'subject', 'description_diff', 'assigned_to', 'points', 'severity', 'priority', 'type', 'attachments', 'milestone', 'is_blocked', 'is_iocaine', 'content_diff', 'name', 'estimated_finish', 'estimated_start']; - UserTimelineService.prototype._isInValidTimeline = function(timeline) { return _.some(this._invalid, (function(_this) { return function(invalid) { @@ -25654,12 +29786,101 @@ })(this)); }; - UserTimelineService.prototype.getProfileTimeline = function(userId, page) { + UserTimelineService.prototype._parseEventType = function(event_type) { + event_type = event_type.split("."); + return { + section: event_type[0], + obj: event_type[1], + type: event_type[2] + }; + }; + + UserTimelineService.prototype._getTimelineObject = function(timeline, event) { + if (timeline.get('data').get(event.obj)) { + return timeline.get('data').get(event.obj); + } + }; + + UserTimelineService.prototype._attachExtraInfoToTimelineEntry = function(timeline, event, type) { + var title; + title = this.userTimelineItemTitle.getTitle(timeline, event, type); + timeline = timeline.set('title_html', title); + timeline = timeline.set('obj', this._getTimelineObject(timeline, event)); + if (type.description) { + timeline = timeline.set('description', type.description(timeline)); + } + if (type.member) { + timeline = timeline.set('member', type.member(timeline)); + } + if (timeline.getIn(['data', 'value_diff', 'key']) === 'attachments' && timeline.hasIn(['data', 'value_diff', 'value', 'new'])) { + timeline = timeline.set('attachments', timeline.getIn(['data', 'value_diff', 'value', 'new'])); + } + return timeline; + }; + + UserTimelineService.prototype._parseTimeline = function(response) { + var newdata; + newdata = Immutable.List(); + response.get('data').forEach((function(_this) { + return function(item) { + var data, event, newItem, values_diff; + event = _this._parseEventType(item.get('event_type')); + data = item.get('data'); + values_diff = data.get('values_diff'); + if (values_diff && values_diff.count()) { + if (values_diff.has('is_blocked')) { + values_diff = Immutable.Map({ + 'blocked': values_diff + }); + } + if (values_diff.has('milestone')) { + values_diff = Immutable.Map({ + 'moveInBacklog': values_diff + }); + } else if (event.obj === 'milestone') { + values_diff = Immutable.Map({ + 'milestone': values_diff + }); + } + return values_diff.forEach(function(value, key) { + var newItem, obj; + obj = Immutable.Map({ + key: key, + value: value + }); + newItem = item.setIn(['data', 'value_diff'], obj); + newItem = newItem.deleteIn(['data', 'values_diff']); + return newdata = newdata.push(newItem); + }); + } else { + newItem = item.deleteIn(['data', 'values_diff']); + return newdata = newdata.push(newItem); + } + }; + })(this)); + return response.set('data', newdata); + }; + + UserTimelineService.prototype._addEntyAttributes = function(item) { + var event, type; + event = this._parseEventType(item.get('event_type')); + type = this.userTimelineItemType.getType(item, event); + return this._attachExtraInfoToTimelineEntry(item, event, type); + }; + + UserTimelineService.prototype.getProfileTimeline = function(userId) { var config; config = {}; config.fetch = (function(_this) { return function(page) { - return _this.rs.users.getProfileTimeline(userId, page); + return _this.rs.users.getProfileTimeline(userId, page).then(function(response) { + return _this._parseTimeline(response); + }); + }; + })(this); + config.map = (function(_this) { + return function(obj) { + return _this._addEntyAttributes(obj); }; })(this); config.filter = (function(_this) { @@ -25669,7 +29890,7 @@ }); }; })(this); - return this.userTimelinePaginationSequenceService(config); + return this.userTimelinePaginationSequenceService.generate(config); }; UserTimelineService.prototype.getUserTimeline = function(userId) { @@ -25677,7 +29898,14 @@ config = {}; config.fetch = (function(_this) { return function(page) { - return _this.rs.users.getUserTimeline(userId, page); + return _this.rs.users.getUserTimeline(userId, page).then(function(response) { + return _this._parseTimeline(response); + }); + }; + })(this); + config.map = (function(_this) { + return function(obj) { + return _this._addEntyAttributes(obj); }; })(this); config.filter = (function(_this) { @@ -25687,7 +29915,7 @@ }); }; })(this); - return this.userTimelinePaginationSequenceService(config); + return this.userTimelinePaginationSequenceService.generate(config); }; UserTimelineService.prototype.getProjectTimeline = function(projectId) { @@ -25695,7 +29923,14 @@ config = {}; config.fetch = (function(_this) { return function(page) { - return _this.rs.projects.getTimeline(projectId, page); + return _this.rs.projects.getTimeline(projectId, page).then(function(response) { + return _this._parseTimeline(response); + }); + }; + })(this); + config.map = (function(_this) { + return function(obj) { + return _this._addEntyAttributes(obj); }; })(this); config.filter = (function(_this) { @@ -25705,7 +29940,7 @@ }); }; })(this); - return this.userTimelinePaginationSequenceService(config); + return this.userTimelinePaginationSequenceService.generate(config); }; return UserTimelineService; @@ -25718,24 +29953,24 @@ /* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# + * Copyright (C) 2014-2015 Andrey Antukh + * Copyright (C) 2014-2015 Jesús Espino Garcia + * Copyright (C) 2014-2015 David Barragán Merino + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. -# + * * This program 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 program. If not, see . -# - * File: pluggins/main.coffee + * + * File: modules/backlog.coffee */ (function() { @@ -25745,494 +29980,4 @@ }).call(this); - -/* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. -# - * This program 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 program. If not, see . -# - * File: plugins/humanshtml/humanshtml.coffee - */ - -(function() { - var configure, module, taiga; - - taiga = this.taiga; - - module = angular.module("taigaPlugins"); - - configure = function($routeProvider) { - return $routeProvider.when("/humans.html", { - "templateUrl": "/plugins/humanshtml/templates/humans.html" - }); - }; - - module.config(["$routeProvider", configure]); - -}).call(this); - - -/* - * Copyright (C) 2014 Andrey Antukh - * Copyright (C) 2014 Jesús Espino Garcia - * Copyright (C) 2014 David Barragán Merino -# - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. -# - * This program 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 program. If not, see . -# - * File: plugins/terms/terms.coffee - */ - -(function() { - var TermsNoticeDirective, module, taiga, template; - - taiga = this.taiga; - - module = angular.module("taigaPlugins"); - - template = _.template("

\n By clicking \"Sign up\", you agree to our
\n
\" title=\"See terms of service\" target=\"_blank\"> terms of service\n and\n \" title=\"See privacy policy\" target=\"_blank\"> privacy policy.\n

"); - - TermsNoticeDirective = function($config) { - var privacyPolicyUrl, templateFn, termsOfServiceUrl; - privacyPolicyUrl = $config.get("privacyPolicyUrl"); - termsOfServiceUrl = $config.get("termsOfServiceUrl"); - templateFn = function() { - var ctx; - if (!(privacyPolicyUrl && termsOfServiceUrl)) { - return ""; - } - ctx = { - termsUrl: termsOfServiceUrl, - privacyUrl: privacyPolicyUrl - }; - return template(ctx); - }; - return { - scope: {}, - restrict: "AE", - template: templateFn - }; - }; - - module.directive("tgTermsNotice", ["$tgConfig", TermsNoticeDirective]); - -}).call(this); - -(function() { - var messages; - - messages = { - defaultMessage: "تنسيق الحقل غير صحيح", - type: { - email: "اكتب البريد الإلكتروني بالطريقة المطلوبة", - url: "اكتب الرابط بالطريقة المطلوبة", - urlstrict: "اكتب الرابط بالطريقة المطلوبة", - number: "اكتب أرقام ففط (عدد صحيح)", - digits: "اكتب أرقاما فقط", - dateIso: "اكتب التاريخ بهذه الصيغة (YYYY-MM-DD).", - alphanum: "اكتب حروف وأرقام فقط", - phone: "اكتب رقم هاتف بالطريقة المطلوبة" - }, - notnull: "هذا الحقل مطلوب", - notblank: "هذا الحقل مطلوب", - required: "هذا الحقل مطلوب", - regexp: "تنسيق الحقل غير صحيح", - min: "الرقم يجب أن يكون أكبر من أو يساوي : %s.", - max: "الرقم يجب أن يكون أصغر من أو يساوي : %s.", - range: "الرقم يجب أن يكون بين %s و %s.", - minlength: "الحقل قصير. يجب أن يحتوي على %s حرف/أحرف أو أكثر", - maxlength: "الحقل طويل. يجب أن يحتوي على %s حرف/أحرف أو أقل", - rangelength: "طول الحقل غير مقبول. يجب أن يكون بين %s و %s حرف/أحرف", - mincheck: "يجب أن تختار %s (اختيار) على الأقل", - maxcheck: "يجب أن تختار %s (اختبار) أو أقل", - rangecheck: "يجب أن تختار بين %s و %s (اختبار).", - equalto: "يجب أن يتساوى الحقلان", - minwords: "يجب أن يحتوي الحقل على %s كلمة/كلمات على الأقل", - maxwords: "يجب أن يحتوي الحقل على %s كلمة/كلمات كحد أعلى", - rangewords: "عدد الكلمات المسوح بها مابين %s و %s كلمة/كلمات.", - greaterthan: "يجب أن تكون القيمة أكبر من %s.", - lessthan: "يجب أن تكون القيمة أقل من %s.", - beforedate: "التاريخ يجب أن يكون قبل %s.", - afterdate: "التاريخ يجب أن يكون بعد %s.", - americandate: "اكتب التاريخ بالطريقة المطلوبة (MM/DD/YYYY)." - }; - -}).call(this); - -(function() { - var messages; - - messages = { - defaultMessage: "Aquest valor sembla ser invàlid.", - type: { - email: "Aquest valor ha de ser una adreça de correu electrònic vàlida.", - url: "Aquest valor ha de ser una URL vàlida.", - urlstrict: "Aquest valor ha de ser una URL vàlida.", - number: "Aquest valor ha de ser un nombre vàlid.", - digits: "Aquest valor ha només pot contenir dígits.", - dateIso: "Aquest valor ha de ser una data vàlida (YYYY-MM-DD).", - alphanum: "Aquest valor ha de ser alfanumèric." - }, - notnull: "Aquest valor no pot ser nul.", - notblank: "Aquest valor no pot ser buit.", - required: "Aquest valor és requerit.", - regexp: "Aquest valor és incorrecte.", - min: "Aquest valor no pot ser menor que %s.", - max: "Aquest valor no pot ser major que %s.", - range: "Aquest valor ha d'estar entre %s i %s.", - minlength: "Aquest valor és massa curt. La longitud mínima és de %s caràcters.", - maxlength: "Aquest valor és massa llarg. La longitud màxima és de %s caràcters.", - rangelength: "La longitud d'aquest valor ha de ser d'entre %s i %s caràcters.", - equalto: "Aquest valor ha de ser idèntic.", - mincheck: "Has de marcar un mínim de %s opcions.", - maxcheck: "Has de marcar un màxim de %s opcions.", - rangecheck: "Has de marcar entre %s i %s opcions.", - minwords: "Aquest valor ha de tenir %s paraules com a mínim.", - maxwords: "Aquest valor no pot superar les %s paraules.", - rangewords: "Aquest valor ha de tenir entre %s i %s paraules.", - greaterthan: "Aquest valor no pot ser major que %s.", - lessthan: "Aquest valor no pot ser menor que %s." - }; - - this.checksley.updateMessages("ca", messages); - -}).call(this); - -(function() { - var messages; - - messages = { - defaultMessage: "Tato položka je neplatná.", - type: { - email: "Tato položka musí být e-mailová adresa.", - url: "Tato položka musí být url adresa.", - urlstrict: "Tato položka musí být url adresa.", - number: "Tato položka musí být platné číslo.", - digits: "Tato položka musí být číslice.", - dateIso: "Tato položka musí být datum ve formátu YYYY-MM-DD.", - alphanum: "Tato položka musí být alfanumerická." - }, - notnull: "Tato položka nesmí být null.", - notblank: "Tato položka nesmí být prázdná.", - required: "Tato položka je povinná.", - regexp: "Tato položka je neplatná.", - min: "Tato položka musí být větší než %s.", - max: "Tato položka musí byt menší než %s.", - range: "Tato položka musí být v rozmezí %s a %s.", - minlength: "Tato položka je příliš krátká. Musí mít %s nebo více znaků.", - maxlength: "Tato položka je příliš dlouhá. Musí mít %s nebo méně znaků.", - rangelength: "Tato položka je mimo rozsah. Musí být rozmezí %s a %s znaků.", - equalto: "Tato položka by měla být stejná.", - minwords: "Tato položka musí obsahovat alespoň %s slov.", - maxwords: "Tato položka nesmí přesánout %s slov.", - rangewords: "Tato položka musí obsahovat %s až %s slov.", - greaterthan: "Tato položka musí být větší než %s.", - lessthan: "Tato položka musí být menší než %s." - }; - - this.checksley.updateMessages("cs", messages); - -}).call(this); - -(function() { - var messages; - - messages = { - defaultMessage: "Die Eingabe scheint nicht korrekt zu sein.", - type: { - email: "Die Eingabe muss eine gültige E-Mail-Adresse sein.", - url: "Die Eingabe muss eine gültige URL sein.", - urlstrict: "Die Eingabe muss eine gültige URL sein.", - number: "Die Eingabe muss eine Zahl sein.", - digits: "Die Eingabe darf nur Ziffern enthalten.", - dateIso: "Die Eingabe muss ein gültiges Datum im Format YYYY-MM-DD sein.", - alphanum: "Die Eingabe muss alphanumerisch sein.", - phone: "Die Eingabe muss eine gültige Telefonnummer sein." - }, - notnull: "Die Eingabe darf nicht leer sein.", - notblank: "Die Eingabe darf nicht leer sein.", - required: "Dies ist ein Pflichtfeld.", - regexp: "Die Eingabe scheint ungültig zu sein.", - min: "Die Eingabe muss größer oder gleich %s sein.", - max: "Die Eingabe muss kleiner oder gleich %s sein.", - range: "Die Eingabe muss zwischen %s und %s liegen.", - minlength: "Die Eingabe ist zu kurz. Es müssen mindestens %s Zeichen eingegeben werden.", - maxlength: "Die Eingabe ist zu lang. Es dürfen höchstens %s Zeichen eingegeben werden.", - rangelength: "Die Länge der Eingabe ist ungültig. Es müssen zwischen %s und %s Zeichen eingegeben werden.", - equalto: "Dieses Feld muss dem anderen entsprechen.", - minwords: "Die Eingabe muss mindestens %s Wörter enthalten.", - maxwords: "Die Eingabe darf höchstens %s Wörter enthalten.", - rangewords: "Die Eingabe muss zwischen %s und %s Wörter enthalten.", - greaterthan: "Die Eingabe muss größer als %s sein.", - lessthan: "Die Eingabe muss kleiner als %s sein." - }; - - this.checksley.updateMessages("de", messages); - -}).call(this); - -(function() { - var messages; - - messages = { - defaultMessage: "Este valor parece ser inválido.", - type: { - email: "Este valor debe ser un correo válido.", - url: "Este valor debe ser una URL válida.", - urlstrict: "Este valor debe ser una URL válida.", - number: "Este valor debe ser un número válido.", - digits: "Este valor debe ser un dígito válido.", - dateIso: "Este valor debe ser una fecha válida (YYYY-MM-DD).", - alphanum: "Este valor debe ser alfanumérico." - }, - notnull: "Este valor no debe ser nulo.", - notblank: "Este valor no debe estar en blanco.", - required: "Este valor es requerido.", - regexp: "Este valor es incorrecto.", - min: "Este valor no debe ser menor que %s.", - max: "Este valor no debe ser mayor que %s.", - range: "Este valor debe estar entre %s y %s.", - minlength: "Este valor es muy corto. La longitud mínima es de %s caracteres.", - maxlength: "Este valor es muy largo. La longitud máxima es de %s caracteres.", - rangelength: "La longitud de este valor debe estar entre %s y %s caracteres.", - equalto: "Este valor debe ser idéntico.", - minwords: "Este valor debe tener al menos %s palabras.", - maxwords: "Este valor no debe exceder las %s palabras.", - rangewords: "Este valor debe tener entre %s y %s palabras.", - greaterthan: "Este valor no debe ser mayor que %s.", - lessthan: "Este valor no debe ser menor que %s." - }; - - this.checksley.updateMessages("es", messages); - -}).call(this); - -(function() { - var messages; - - messages = { - defaultMessage: "Cette valeur semble non valide.", - type: { - email: "Cette valeur n'est pas une adresse email valide.", - url: "Cette valeur n'est pas une URL valide.", - urlstrict: "Cette valeur n'est pas une URL valide.", - number: "Cette valeur doit être un nombre.", - digits: "Cette valeur doit être numérique.", - dateIso: "Cette valeur n'est pas une date valide (YYYY-MM-DD).", - alphanum: "Cette valeur doit être alphanumérique." - }, - notnull: "Cette valeur ne peut pas être nulle.", - notblank: "Cette valeur ne peut pas être vide.", - required: "Ce champ est requis.", - regexp: "Cette valeur semble non valide.", - min: "Cette valeur ne doit pas être inféreure à %s.", - max: "Cette valeur ne doit pas excéder %s.", - range: "Cette valeur doit être comprise entre %s et %s.", - minlength: "Cette chaîne est trop courte. Elle doit avoir au minimum %s caractères.", - maxlength: "Cette chaîne est trop longue. Elle doit avoir au maximum %s caractères.", - rangelength: "Cette valeur doit contenir entre %s et %s caractères.", - equalto: "Cette valeur devrait être identique.", - mincheck: "Vous devez sélectionner au moins %s choix.", - maxcheck: "Vous devez sélectionner %s choix maximum.", - rangecheck: "Vous devez sélectionner entre %s et %s choix.", - minwords: "Cette valeur doit contenir plus de %s mots.", - maxwords: "Cette valeur ne peut pas dépasser %s mots.", - rangewords: "Cette valeur doit comprendre %s à %s mots.", - greaterthan: "Cette valeur doit être plus grande que %s.", - lessthan: "Cette valeur doit être plus petite que %s." - }; - - this.checksley.updateMessages("fr", messages); - -}).call(this); - -(function() { - var messages; - - messages = { - defaultMessage: "Questo valore sembra essere non valido.", - type: { - email: "Questo valore deve essere un indirizzo email valido.", - url: "Questo valore deve essere un URL valido.", - urlstrict: "Questo valore deve essere un URL valido.", - number: "Questo valore deve essere un numero valido.", - digits: "Questo valore deve essere di tipo numerico.", - dateIso: "Questo valore deve essere una data valida (YYYY-MM-DD).", - alphanum: "Questo valore deve essere di tipo alfanumerico." - }, - notnull: "Questo valore non deve essere nullo.", - notblank: "Questo valore non deve essere vuoto.", - required: "Questo valore è richiesto.", - regexp: "Questo valore non è corretto.", - min: "Questo valore deve essere maggiore di %s.", - max: "Questo valore deve essere minore di %s.", - range: "Questo valore deve essere compreso tra %s e %s.", - minlength: "Questo valore è troppo corto. La lunghezza minima è di %s caratteri.", - maxlength: "Questo valore è troppo lungo. La lunghezza massima è di %s caratteri.", - rangelength: "La lunghezza di questo valore deve essere compresa fra %s e %s caratteri.", - equalto: "Questo valore deve essere identico.", - minwords: "Questo valore deve contenere almeno %s parole.", - maxwords: "Questo valore non deve superare le %s parole.", - rangewords: "Questo valore deve contenere tra %s e %s parole.", - greaterthan: "Questo valore deve essere maggiore di %s.", - lessthan: "Questo valore deve essere minore di %s.", - beforedate: "Questa data deve essere anteriore al %s.", - afterdate: "Questa data deve essere posteriore al %s.", - luhn: "Questo valore deve superare il test di Luhn." - }; - - this.checksley.updateMessages("it", messages); - -}).call(this); - -(function() { - var messages; - - messages = { - defaultMessage: "Deze waarde lijkt onjuist.", - type: { - email: "Dit lijkt geen geldig e-mail adres te zijn.", - url: "Dit lijkt geen geldige URL te zijn.", - urlstrict: "Dit is geen geldige URL.", - number: "Deze waarde moet een nummer zijn.", - digits: "Deze waarde moet numeriek zijn.", - dateIso: "Deze waarde moet een datum in het volgende formaat zijn: (YYYY-MM-DD).", - alphanum: "Deze waarde moet alfanumeriek zijn.", - phone: "Deze waarde moet een geldig telefoonnummer zijn." - }, - notnull: "Deze waarde mag niet leeg zijn.", - notblank: "Deze waarde mag niet leeg zijn.", - required: "Dit veld is verplicht", - regexp: "Deze waarde lijkt onjuist te zijn.", - min: "Deze waarde mag niet lager zijn dan %s.", - max: "Deze waarde mag niet groter zijn dan %s.", - range: "Deze waarde moet tussen %s en %s liggen.", - minlength: "Deze tekst is te kort. Deze moet uit minimaal %s karakters bestaan.", - maxlength: "Deze waarde is te lang. Deze mag maximaal %s karakters lang zijn.", - mincheck: "Je moet minstens %s opties selecteren.", - maxcheck: "Je moet %s of minder opties selecteren.", - rangecheck: "Je moet tussen de %s en %s opties selecteren.", - rangelength: "Deze waarde moet tussen %s en %s karakters lang zijn.", - equalto: "Deze waardes moeten identiek zijn.", - minwords: "Deze waarde moet minstens %s woorden bevatten.", - maxwords: "Deze waarde mag maximaal %s woorden bevatten.", - rangewords: "Deze waarde moet tussen de %s en %s woorden bevatten.", - greaterthan: "Deze waarde moet groter dan %s zijn.", - lessthan: "Deze waarde moet kleiner dan %s zijn.", - beforedate: "Deze datum moet voor %s liggne.", - afterdate: "Deze datum moet na %s liggen.", - americandate: "Dit moet een geldige datum zijn (MM/DD/YYYY)." - }; - - this.checksley.updateMessages("nl", messages); - -}).call(this); - -(function() { - var messages; - - messages = { - defaultMessage: "Поле заполнено некорректно.", - type: { - email: "Поле должно быть адресом электронной почты.", - url: "Поле должно быть ссылкой на сайт.", - urlstrict: "Поле должно быть ссылкой на сайт.", - number: "Поле должно быть числом.", - digits: "Поле должно содержать только цифры.", - dateIso: "Поле должно быть датой в формате (ГГГГ-ММ-ДД).", - alphanum: "Поле должно содержать только цифры и буквы", - phone: "Поле должно содержать корректный номер телефона" - }, - notnull: "Поле должно быть не нулевым.", - notblank: "Поле не должно быть пустым.", - required: "Поле обязательно для заполнения.", - regexp: "Поле заполнено некорректно.", - min: "Значение поля должно быть больше %s.", - max: "Значение поля должно быть меньше %s.", - range: "Значение поля должно быть между %s и %s.", - minlength: "В поле должно быть минимум %s символов(а).", - maxlength: "В поле должно быть не больше %s символов(а).", - rangelength: "В поле должно быть от %s до %s символов(а).", - mincheck: "Необходимо выбрать не менее %s пунктов(а).", - maxcheck: "Необходимо выбрать не более %s пунктов(а).", - rangecheck: "Необходимо выбрать от %s до %s пунктов.", - equalto: "Значения полей должны быть одинаковыми.", - minwords: "В поле должно быть не менее %s слов.", - maxwords: "В поле должно быть не более %s слов.", - rangewords: "Количество слов в поле должно быть в диапазоне от %s до %s.", - greaterthan: "Значение в поле должно быть более %s.", - lessthan: "Значение в поле должно быть менее %s.", - beforedate: "Дата должна быть до %s.", - afterdate: "Дата должна быть после %s.", - americandate: "В поле должна быть корректная дата в формате MM/DD/YYYY." - }; - - this.checksley.updateMessages("ru", messages); - -}).call(this); - -(function() { - var messages; - - messages = { - defaultMessage: "不正确的值", - type: { - email: "字段值应该是一个正确的电子邮件地址", - url: "字段值应该是一个正确的URL地址", - urlstrict: "字段值应该是一个正确的URL地址", - number: "字段值应该是一个合法的数字", - digits: "字段值应该是一个单独的数字", - dateIso: "字段值应该是一个正确的日期描述(YYYY-MM-DD).", - alphanum: "字段值应该是只包含字母和数字" - }, - notnull: "字段值不可为null", - notblank: "字段值不可为空", - required: "字段值是必填的", - regexp: "字段值不合法", - min: "字段值应该大于 %s", - max: "字段值应该小于 %s.", - range: "字段值应该大于 %s 并小于 %s.", - minlength: "字段值太短了,长度应该大于等于 %s 个字符", - maxlength: "字段值太长了,长度应该小于等于 %s 个字符", - rangelength: "字段值长度错了,长度应该在 %s 和 %s 个字符之间", - mincheck: "你至少要选择 %s 个选项", - maxcheck: "你最多只能选择 %s 个选项", - rangecheck: "你只能选择 %s 到 %s 个选项", - equalto: "字段值应该和给定的值一样", - minwords: "字段值应该至少有 %s 个词", - maxwords: "字段值最多只能有 %s 个词", - rangewords: "字段值应该有 %s 到 %s 个词", - greaterthan: "字段值应该大于 %s", - lessthan: "字段值应该小于 %s", - beforedate: "字段值所表示的日期应该早于 %s.", - afterdate: "字段值所表示的日期应该晚于 %s." - }; - - this.checksley.updateMessages("zh-cn", messages); - -}).call(this); - -//# sourceMappingURL=maps/app.js.map \ No newline at end of file +//# sourceMappingURL=maps/app.js.map diff --git a/dist/js/conf.example.json b/dist/js/conf.example.json index 2a78a5e..d039bb7 100644 --- a/dist/js/conf.example.json +++ b/dist/js/conf.example.json @@ -4,6 +4,8 @@ "debug": true, "debugInfo": false, "defaultLanguage": "en", + "themes": ["taiga"], + "defaultTheme": "taiga", "publicRegisterEnabled": true, "feedbackEnabled": true, "privacyPolicyUrl": null, diff --git a/dist/js/libs.js b/dist/js/libs.js index ed539a4..8609f5f 100644 --- a/dist/js/libs.js +++ b/dist/js/libs.js @@ -1,43 +1,46 @@ -function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length*chrsz))}function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length*chrsz))}function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length*chrsz))}function hex_hmac_sha1(key,data){return binb2hex(core_hmac_sha1(key,data))}function b64_hmac_sha1(key,data){return binb2b64(core_hmac_sha1(key,data))}function str_hmac_sha1(key,data){return binb2str(core_hmac_sha1(key,data))}function sha1_vm_test(){return"a9993e364706816aba3e25717850c26c9cd0d89d"==hex_sha1("abc")}function core_sha1(x,len){x[len>>5]|=128<<24-len%32,x[(len+64>>9<<4)+15]=len;for(var w=Array(80),a=1732584193,b=-271733879,c=-1732584194,d=271733878,e=-1009589776,i=0;ij;j++){w[j]=16>j?x[i+j]:rol(w[j-3]^w[j-8]^w[j-14]^w[j-16],1);var t=safe_add(safe_add(rol(a,5),sha1_ft(j,b,c,d)),safe_add(safe_add(e,w[j]),sha1_kt(j)));e=d,d=c,c=rol(b,30),b=a,a=t}a=safe_add(a,olda),b=safe_add(b,oldb),c=safe_add(c,oldc),d=safe_add(d,oldd),e=safe_add(e,olde)}return Array(a,b,c,d,e)}function sha1_ft(t,b,c,d){return 20>t?b&c|~b&d:40>t?b^c^d:60>t?b&c|b&d|c&d:b^c^d}function sha1_kt(t){return 20>t?1518500249:40>t?1859775393:60>t?-1894007588:-899497514}function core_hmac_sha1(key,data){var bkey=str2binb(key);bkey.length>16&&(bkey=core_sha1(bkey,key.length*chrsz));for(var ipad=Array(16),opad=Array(16),i=0;16>i;i++)ipad[i]=909522486^bkey[i],opad[i]=1549556828^bkey[i];var hash=core_sha1(ipad.concat(str2binb(data)),512+data.length*chrsz);return core_sha1(opad.concat(hash),672)}function safe_add(x,y){var lsw=(65535&x)+(65535&y),msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|65535&lsw}function rol(num,cnt){return num<>>32-cnt}function str2binb(str){for(var bin=Array(),mask=(1<>5]|=(str.charCodeAt(i/chrsz)&mask)<<32-chrsz-i%32;return bin}function binb2str(bin){for(var str="",mask=(1<>5]>>>32-chrsz-i%32&mask);return str}function binb2hex(binarray){for(var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef",str="",i=0;i<4*binarray.length;i++)str+=hex_tab.charAt(binarray[i>>2]>>8*(3-i%4)+4&15)+hex_tab.charAt(binarray[i>>2]>>8*(3-i%4)&15);return str}function binb2b64(binarray){for(var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",str="",i=0;i<4*binarray.length;i+=3)for(var triplet=(binarray[i>>2]>>8*(3-i%4)&255)<<16|(binarray[i+1>>2]>>8*(3-(i+1)%4)&255)<<8|binarray[i+2>>2]>>8*(3-(i+2)%4)&255,j=0;4>j;j++)str+=8*i+6*j>32*binarray.length?b64pad:tab.charAt(triplet>>6*(3-j)&63);return str}!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof _dereq_&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof _dereq_&&_dereq_,o=0;o0},Async.prototype.throwLater=function(fn,arg){1===arguments.length&&(arg=fn,fn=function(){throw arg});var domain=this._getDomain();if(void 0!==domain&&(fn=domain.bind(fn)),"undefined"!=typeof setTimeout)setTimeout(function(){fn(arg)},0);else try{this._schedule(function(){fn(arg)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},Async.prototype._getDomain=function(){};util.hasDevTools?(schedule.isStatic&&(schedule=function(fn){setTimeout(fn,0)}),Async.prototype.invokeLater=function(fn,receiver,arg){this._trampolineEnabled?AsyncInvokeLater.call(this,fn,receiver,arg):this._schedule(function(){setTimeout(function(){fn.call(receiver,arg)},100)})},Async.prototype.invoke=function(fn,receiver,arg){this._trampolineEnabled?AsyncInvoke.call(this,fn,receiver,arg):this._schedule(function(){fn.call(receiver,arg)})},Async.prototype.settlePromises=function(promise){this._trampolineEnabled?AsyncSettlePromises.call(this,promise):this._schedule(function(){promise._settlePromises()})}):(Async.prototype.invokeLater=AsyncInvokeLater,Async.prototype.invoke=AsyncInvoke,Async.prototype.settlePromises=AsyncSettlePromises),Async.prototype.invokeFirst=function(fn,receiver,arg){var domain=this._getDomain();void 0!==domain&&(fn=domain.bind(fn)),this._normalQueue.unshift(fn,receiver,arg),this._queueTick()},Async.prototype._drainQueue=function(queue){for(;queue.length()>0;){var fn=queue.shift();if("function"==typeof fn){var receiver=queue.shift(),arg=queue.shift();fn.call(receiver,arg)}else fn._settlePromises()}},Async.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},Async.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},Async.prototype._reset=function(){this._isTickUsed=!1},module.exports=new Async,module.exports.firstLineError=firstLineError},{"./queue.js":28,"./schedule.js":31,"./util.js":38,events:39}],3:[function(_dereq_,module){"use strict";module.exports=function(Promise,INTERNAL,tryConvertToPromise){var rejectThis=function(_,e){this._reject(e)},targetRejected=function(e,context){context.promiseRejectionQueued=!0,context.bindingPromise._then(rejectThis,rejectThis,null,this,e)},bindingResolved=function(thisArg,context){this._setBoundTo(thisArg),this._isPending()&&this._resolveCallback(context.target)},bindingRejected=function(e,context){context.promiseRejectionQueued||this._reject(e)};Promise.prototype.bind=function(thisArg){var maybePromise=tryConvertToPromise(thisArg),ret=new Promise(INTERNAL);ret._propagateFrom(this,1);var target=this._target();if(maybePromise instanceof Promise){var context={promiseRejectionQueued:!1,promise:ret,target:target,bindingPromise:maybePromise};target._then(INTERNAL,targetRejected,ret._progress,ret,context),maybePromise._then(bindingResolved,bindingRejected,ret._progress,ret,context)}else ret._setBoundTo(thisArg),ret._resolveCallback(target);return ret},Promise.prototype._setBoundTo=function(obj){void 0!==obj?(this._bitField=131072|this._bitField,this._boundTo=obj):this._bitField=-131073&this._bitField},Promise.prototype._isBound=function(){return 131072===(131072&this._bitField)},Promise.bind=function(thisArg,value){var maybePromise=tryConvertToPromise(thisArg),ret=new Promise(INTERNAL);return maybePromise instanceof Promise?maybePromise._then(function(thisArg){ret._setBoundTo(thisArg),ret._resolveCallback(value)},ret._reject,ret._progress,ret,null):(ret._setBoundTo(thisArg),ret._resolveCallback(value)),ret}}},{}],4:[function(_dereq_,module){"use strict";function noConflict(){try{Promise===bluebird&&(Promise=old)}catch(e){}return bluebird}var old;"undefined"!=typeof Promise&&(old=Promise);var bluebird=_dereq_("./promise.js")();bluebird.noConflict=noConflict,module.exports=bluebird},{"./promise.js":23}],5:[function(_dereq_,module){"use strict";var cr=Object.create;if(cr){var callerCache=cr(null),getterCache=cr(null);callerCache[" size"]=getterCache[" size"]=0}module.exports=function(Promise){function ensureMethod(obj,methodName){var fn;if(null!=obj&&(fn=obj[methodName]),"function"!=typeof fn){var message="Object "+util.classString(obj)+" has no method '"+util.toString(methodName)+"'";throw new Promise.TypeError(message)}return fn}function caller(obj){var methodName=this.pop(),fn=ensureMethod(obj,methodName);return fn.apply(obj,this)}function namedGetter(obj){return obj[this]}function indexedGetter(obj){var index=+this;return 0>index&&(index=Math.max(0,index+obj.length)),obj[index]}{var getGetter,util=_dereq_("./util.js"),canEvaluate=util.canEvaluate;util.isIdentifier}Promise.prototype.call=function(methodName){for(var $_len=arguments.length,args=new Array($_len-1),$_i=1;$_len>$_i;++$_i)args[$_i-1]=arguments[$_i];return args.push(methodName),this._then(caller,void 0,void 0,args,void 0)},Promise.prototype.get=function(propertyName){var getter,isIndex="number"==typeof propertyName;if(isIndex)getter=indexedGetter;else if(canEvaluate){var maybeGetter=getGetter(propertyName);getter=null!==maybeGetter?maybeGetter:namedGetter}else getter=namedGetter;return this._then(getter,void 0,void 0,propertyName,void 0)}}},{"./util.js":38}],6:[function(_dereq_,module){"use strict";module.exports=function(Promise){var errors=_dereq_("./errors.js"),async=_dereq_("./async.js"),CancellationError=errors.CancellationError;Promise.prototype._cancel=function(reason){if(!this.isCancellable())return this;for(var parent,promiseToReject=this;void 0!==(parent=promiseToReject._cancellationParent)&&parent.isCancellable();)promiseToReject=parent;this._unsetCancellable(),promiseToReject._target()._rejectCallback(reason,!1,!0)},Promise.prototype.cancel=function(reason){return this.isCancellable()?(void 0===reason&&(reason=new CancellationError),async.invokeLater(this._cancel,this,reason),this):this},Promise.prototype.cancellable=function(){return this._cancellable()?this:(async.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},Promise.prototype.uncancellable=function(){var ret=this.then();return ret._unsetCancellable(),ret},Promise.prototype.fork=function(didFulfill,didReject,didProgress){var ret=this._then(didFulfill,didReject,didProgress,void 0,void 0);return ret._setCancellable(),ret._cancellationParent=void 0,ret}}},{"./async.js":2,"./errors.js":13}],7:[function(_dereq_,module){"use strict";module.exports=function(){function CapturedTrace(parent){this._parent=parent;var length=this._length=1+(void 0===parent?0:parent._length);captureStackTrace(this,CapturedTrace),length>32&&this.uncycle()}function reconstructStack(message,stacks){for(var i=0;i=0;--j)if(prev[j]===currentLastLine){commonRootMeetPoint=j;break}for(var j=commonRootMeetPoint;j>=0;--j){var line=prev[j];if(current[currentLastIndex]!==line)break;current.pop(),currentLastIndex--}current=prev}}function cleanStack(stack){for(var ret=[],i=0;i0&&(stack=stack.slice(i)),stack}function formatNonError(obj){var str;if("function"==typeof obj)str="[function "+(obj.name||"anonymous")+"]";else{str=obj.toString();var ruselessToString=/\[object [a-zA-Z0-9$_]+\]/;if(ruselessToString.test(str))try{var newStr=JSON.stringify(obj);str=newStr}catch(e){}0===str.length&&(str="(empty array)")}return"(<"+snip(str)+">, no stack trace)"}function snip(str){var maxChars=41;return str.lengthlength)){for(var nodes=[],stackToIndex={},i=0,node=this;void 0!==node;++i)nodes.push(node),node=node._parent;length=this._length=i;for(var i=length-1;i>=0;--i){var stack=nodes[i].stack;void 0===stackToIndex[stack]&&(stackToIndex[stack]=i)}for(var i=0;length>i;++i){var currentStack=nodes[i].stack,index=stackToIndex[currentStack];if(void 0!==index&&index!==i){index>0&&(nodes[index-1]._parent=void 0,nodes[index-1]._length=1),nodes[i]._parent=void 0,nodes[i]._length=1;var cycleEdgeNode=i>0?nodes[i-1]:this;length-1>index?(cycleEdgeNode._parent=nodes[index+1],cycleEdgeNode._parent.uncycle(),cycleEdgeNode._length=cycleEdgeNode._parent._length+1):(cycleEdgeNode._parent=void 0,cycleEdgeNode._length=1);for(var currentChildLength=cycleEdgeNode._length+1,j=i-2;j>=0;--j)nodes[j]._length=currentChildLength,currentChildLength++;return}}}},CapturedTrace.prototype.parent=function(){return this._parent},CapturedTrace.prototype.hasParent=function(){return void 0!==this._parent},CapturedTrace.prototype.attachExtraTrace=function(error){if(!error.__stackCleaned__){this.uncycle();for(var parsed=CapturedTrace.parseStackAndMessage(error),message=parsed.message,stacks=[parsed.stack],trace=this;void 0!==trace;)stacks.push(cleanStack(trace.stack.split("\n"))),trace=trace._parent;removeCommonRoots(stacks),removeDuplicateOrEmptyJumps(stacks),util.notEnumerableProp(error,"stack",reconstructStack(message,stacks)),util.notEnumerableProp(error,"__stackCleaned__",!0)}},CapturedTrace.parseStackAndMessage=function(error){var stack=error.stack,message=error.toString();return stack="string"==typeof stack&&stack.length>0?stackFramesAsArray(error):[" (No stack trace)"],{message:message,stack:cleanStack(stack)}},CapturedTrace.formatAndLogError=function(error,title){if("undefined"!=typeof console){var message;if("object"==typeof error||"function"==typeof error){var stack=error.stack;message=title+formatStack(stack,error)}else message=title+String(error);"function"==typeof warn?warn(message):("function"==typeof console.log||"object"==typeof console.log)&&console.log(message)}},CapturedTrace.unhandledRejection=function(reason){CapturedTrace.formatAndLogError(reason,"^--- With additional stack trace: ")},CapturedTrace.isSupported=function(){return"function"==typeof captureStackTrace},CapturedTrace.fireRejectionEvent=function(name,localHandler,reason,promise){var localEventFired=!1;try{"function"==typeof localHandler&&(localEventFired=!0,"rejectionHandled"===name?localHandler(promise):localHandler(reason,promise))}catch(e){async.throwLater(e)}var globalEventFired=!1;try{globalEventFired=fireGlobalEvent(name,reason,promise)}catch(e){globalEventFired=!0,async.throwLater(e)}var domEventFired=!1;if(fireDomEvent)try{domEventFired=fireDomEvent(name.toLowerCase(),{reason:reason,promise:promise})}catch(e){domEventFired=!0,async.throwLater(e)}globalEventFired||localEventFired||domEventFired||"unhandledRejection"!==name||CapturedTrace.formatAndLogError(reason,"Unhandled rejection ")};var shouldIgnore=function(){return!1},parseLineInfoRegex=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;CapturedTrace.setBounds=function(firstLineError,lastLineError){if(CapturedTrace.isSupported()){for(var firstFileName,lastFileName,firstStackLines=firstLineError.stack.split("\n"),lastStackLines=lastLineError.stack.split("\n"),firstIndex=-1,lastIndex=-1,i=0;ifirstIndex||0>lastIndex||!firstFileName||!lastFileName||firstFileName!==lastFileName||firstIndex>=lastIndex||(shouldIgnore=function(line){if(bluebirdFramePattern.test(line))return!0;var info=parseLineInfo(line);return info&&info.fileName===firstFileName&&firstIndex<=info.line&&info.line<=lastIndex?!0:!1})}};var fireDomEvent,captureStackTrace=function(){var v8stackFramePattern=/^\s*at\s*/,v8stackFormatter=function(stack,error){return"string"==typeof stack?stack:void 0!==error.name&&void 0!==error.message?error.toString():formatNonError(error)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,stackFramePattern=v8stackFramePattern,formatStack=v8stackFormatter;var captureStackTrace=Error.captureStackTrace;return shouldIgnore=function(line){return bluebirdFramePattern.test(line)},function(receiver,ignoreUntil){Error.stackTraceLimit=Error.stackTraceLimit+6,captureStackTrace(receiver,ignoreUntil),Error.stackTraceLimit=Error.stackTraceLimit-6}}var err=new Error;if("string"==typeof err.stack&&err.stack.split("\n")[0].indexOf("stackDetection@")>=0)return stackFramePattern=/@/,formatStack=v8stackFormatter,indentStackFrames=!0,function(o){o.stack=(new Error).stack};var hasStackAfterThrow;try{throw new Error}catch(e){hasStackAfterThrow="stack"in e}return"stack"in err||!hasStackAfterThrow?(formatStack=function(stack,error){return"string"==typeof stack?stack:"object"!=typeof error&&"function"!=typeof error||void 0===error.name||void 0===error.message?formatNonError(error):error.toString()},null):(stackFramePattern=v8stackFramePattern,formatStack=v8stackFormatter,function(o){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){o.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),fireGlobalEvent=function(){if(util.isNode)return function(name,reason,promise){return"rejectionHandled"===name?process.emit(name,promise):process.emit(name,reason,promise)};var customEventWorks=!1,anyEventWorks=!0;try{var ev=new self.CustomEvent("test");customEventWorks=ev instanceof CustomEvent}catch(e){}if(!customEventWorks)try{var event=document.createEvent("CustomEvent");event.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(event)}catch(e){anyEventWorks=!1}anyEventWorks&&(fireDomEvent=function(type,detail){var event;return customEventWorks?event=new self.CustomEvent(type,{detail:detail,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(event=document.createEvent("CustomEvent"),event.initCustomEvent(type,!1,!0,detail)),event?!self.dispatchEvent(event):!1});var toWindowMethodNameMap={};return toWindowMethodNameMap.unhandledRejection="onunhandledRejection".toLowerCase(),toWindowMethodNameMap.rejectionHandled="onrejectionHandled".toLowerCase(),function(name,reason,promise){var methodName=toWindowMethodNameMap[name],method=self[methodName];return method?("rejectionHandled"===name?method.call(self,promise):method.call(self,reason,promise),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(warn=function(message){console.warn(message)},util.isNode&&process.stderr.isTTY?warn=function(message){process.stderr.write(""+message+"\n")}:util.isNode||"string"!=typeof(new Error).stack||(warn=function(message){console.warn("%c"+message,"color: red")})),CapturedTrace}},{"./async.js":2,"./util.js":38}],8:[function(_dereq_,module){"use strict";module.exports=function(NEXT_FILTER){function CatchFilter(instances,callback,promise){this._instances=instances,this._callback=callback,this._promise=promise}function safePredicate(predicate,e){var safeObject={},retfilter=tryCatch(predicate).call(safeObject,e);if(retfilter===errorObj)return retfilter;var safeKeys=keys(safeObject);return safeKeys.length?(errorObj.e=new TypeError("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),errorObj):retfilter}var util=_dereq_("./util.js"),errors=_dereq_("./errors.js"),tryCatch=util.tryCatch,errorObj=util.errorObj,keys=_dereq_("./es5.js").keys,TypeError=errors.TypeError;return CatchFilter.prototype.doFilter=function(e){for(var cb=this._callback,promise=this._promise,boundTo=promise._boundTo,i=0,len=this._instances.length;len>i;++i){var item=this._instances[i],itemIsErrorType=item===Error||null!=item&&item.prototype instanceof Error;if(itemIsErrorType&&e instanceof item){var ret=tryCatch(cb).call(boundTo,e);return ret===errorObj?(NEXT_FILTER.e=ret.e,NEXT_FILTER):ret}if("function"==typeof item&&!itemIsErrorType){var shouldHandle=safePredicate(item,e);if(shouldHandle===errorObj){e=errorObj.e;break}if(shouldHandle){var ret=tryCatch(cb).call(boundTo,e);return ret===errorObj?(NEXT_FILTER.e=ret.e,NEXT_FILTER):ret}}}return NEXT_FILTER.e=e,NEXT_FILTER},CatchFilter}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(_dereq_,module){"use strict";module.exports=function(Promise,CapturedTrace,isDebugging){function Context(){this._trace=new CapturedTrace(peekContext())}function createContext(){return isDebugging()?new Context:void 0}function peekContext(){var lastIndex=contextStack.length-1;return lastIndex>=0?contextStack[lastIndex]:void 0}var contextStack=[];return Context.prototype._pushContext=function(){isDebugging()&&void 0!==this._trace&&contextStack.push(this._trace)},Context.prototype._popContext=function(){isDebugging()&&void 0!==this._trace&&contextStack.pop()},Promise.prototype._peekContext=peekContext,Promise.prototype._pushContext=Context.prototype._pushContext,Promise.prototype._popContext=Context.prototype._popContext,createContext}},{}],10:[function(_dereq_,module){"use strict";module.exports=function(Promise,CapturedTrace){var unhandledRejectionHandled,possiblyUnhandledRejection,async=_dereq_("./async.js"),Warning=_dereq_("./errors.js").Warning,util=_dereq_("./util.js"),canAttachTrace=util.canAttachTrace,debugging=!1||util.isNode&&(!!process.env.BLUEBIRD_DEBUG||"development"===process.env.NODE_ENV);return debugging&&async.disableTrampolineIfNecessary(),Promise.prototype._ignoreRejections=function(){this._unsetRejectionIsUnhandled(),this._bitField=16777216|this._bitField},Promise.prototype._ensurePossibleRejectionHandled=function(){0===(16777216&this._bitField)&&(this._setRejectionIsUnhandled(),async.invokeLater(this._notifyUnhandledRejection,this,void 0))},Promise.prototype._notifyUnhandledRejectionIsHandled=function(){CapturedTrace.fireRejectionEvent("rejectionHandled",unhandledRejectionHandled,void 0,this)},Promise.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var reason=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),CapturedTrace.fireRejectionEvent("unhandledRejection",possiblyUnhandledRejection,reason,this)}},Promise.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},Promise.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},Promise.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},Promise.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},Promise.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},Promise.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},Promise.prototype._setCarriedStackTrace=function(capturedTrace){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=capturedTrace},Promise.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},Promise.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},Promise.prototype._captureStackTrace=function(){return debugging&&(this._trace=new CapturedTrace(this._peekContext())),this},Promise.prototype._attachExtraTrace=function(error,ignoreSelf){if(debugging&&canAttachTrace(error)){var trace=this._trace;if(void 0!==trace&&ignoreSelf&&(trace=trace._parent),void 0!==trace)trace.attachExtraTrace(error);else if(!error.__stackCleaned__){var parsed=CapturedTrace.parseStackAndMessage(error);util.notEnumerableProp(error,"stack",parsed.message+"\n"+parsed.stack.join("\n")),util.notEnumerableProp(error,"__stackCleaned__",!0)}}},Promise.prototype._warn=function(message){var warning=new Warning(message),ctx=this._peekContext();if(ctx)ctx.attachExtraTrace(warning);else{var parsed=CapturedTrace.parseStackAndMessage(warning);warning.stack=parsed.message+"\n"+parsed.stack.join("\n")}CapturedTrace.formatAndLogError(warning,"")},Promise.onPossiblyUnhandledRejection=function(fn){possiblyUnhandledRejection="function"==typeof fn?fn:void 0},Promise.onUnhandledRejectionHandled=function(fn){unhandledRejectionHandled="function"==typeof fn?fn:void 0},Promise.longStackTraces=function(){if(async.haveItemsQueued()&&debugging===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");debugging=CapturedTrace.isSupported(),debugging&&async.disableTrampolineIfNecessary()},Promise.hasLongStackTraces=function(){return debugging&&CapturedTrace.isSupported()},CapturedTrace.isSupported()||(Promise.longStackTraces=function(){},debugging=!1),function(){return debugging}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(_dereq_,module){"use strict";var util=_dereq_("./util.js"),isPrimitive=util.isPrimitive,wrapsPrimitiveReceiver=util.wrapsPrimitiveReceiver;module.exports=function(Promise){var returner=function(){return this},thrower=function(){throw this},returnUndefined=function(){},throwUndefined=function(){throw void 0},wrapper=function(value,action){return 1===action?function(){throw value}:2===action?function(){return value}:void 0};Promise.prototype["return"]=Promise.prototype.thenReturn=function(value){return void 0===value?this.then(returnUndefined):wrapsPrimitiveReceiver&&isPrimitive(value)?this._then(wrapper(value,2),void 0,void 0,void 0,void 0):this._then(returner,void 0,void 0,value,void 0)},Promise.prototype["throw"]=Promise.prototype.thenThrow=function(reason){return void 0===reason?this.then(throwUndefined):wrapsPrimitiveReceiver&&isPrimitive(reason)?this._then(wrapper(reason,1),void 0,void 0,void 0,void 0):this._then(thrower,void 0,void 0,reason,void 0)}}},{"./util.js":38}],12:[function(_dereq_,module){"use strict";module.exports=function(Promise,INTERNAL){var PromiseReduce=Promise.reduce;Promise.prototype.each=function(fn){return PromiseReduce(this,fn,null,INTERNAL)},Promise.each=function(promises,fn){return PromiseReduce(promises,fn,null,INTERNAL)}}},{}],13:[function(_dereq_,module){"use strict";function subError(nameProperty,defaultMessage){function SubError(message){return this instanceof SubError?(notEnumerableProp(this,"message","string"==typeof message?message:defaultMessage),notEnumerableProp(this,"name",nameProperty),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new SubError(message)}return inherits(SubError,Error),SubError}function OperationalError(message){return this instanceof OperationalError?(notEnumerableProp(this,"name","OperationalError"),notEnumerableProp(this,"message",message),this.cause=message,this.isOperational=!0,void(message instanceof Error?(notEnumerableProp(this,"message",message.message),notEnumerableProp(this,"stack",message.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new OperationalError(message)}var _TypeError,_RangeError,es5=_dereq_("./es5.js"),Objectfreeze=es5.freeze,util=_dereq_("./util.js"),inherits=util.inherits,notEnumerableProp=util.notEnumerableProp,Warning=subError("Warning","warning"),CancellationError=subError("CancellationError","cancellation error"),TimeoutError=subError("TimeoutError","timeout error"),AggregateError=subError("AggregateError","aggregate error");try{_TypeError=TypeError,_RangeError=RangeError}catch(e){_TypeError=subError("TypeError","type error"),_RangeError=subError("RangeError","range error")}for(var methods="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),i=0;i0&&"function"==typeof arguments[last]){fn=arguments[last];var ret}for(var $_len=arguments.length,args=new Array($_len),$_i=0;$_len>$_i;++$_i)args[$_i]=arguments[$_i];fn&&args.pop();var ret=new PromiseArray(args).promise();return void 0!==fn?ret.spread(fn):ret}}},{"./util.js":38}],19:[function(_dereq_,module){"use strict";module.exports=function(Promise,PromiseArray,apiRejection,tryConvertToPromise,INTERNAL){function MappingPromiseArray(promises,fn,limit,_filter){this.constructor$(promises),this._promise._captureStackTrace(),this._callback=fn,this._preservedValues=_filter===INTERNAL?new Array(this.length()):null,this._limit=limit,this._inFlight=0,this._queue=limit>=1?[]:EMPTY_ARRAY,async.invoke(init,this,void 0)}function init(){this._init$(void 0,-2)}function map(promises,fn,options,_filter){var limit="object"==typeof options&&null!==options?options.concurrency:0;return limit="number"==typeof limit&&isFinite(limit)&&limit>=1?limit:0,new MappingPromiseArray(promises,fn,limit,_filter)}var async=_dereq_("./async.js"),util=_dereq_("./util.js"),tryCatch=util.tryCatch,errorObj=util.errorObj,PENDING={},EMPTY_ARRAY=[];util.inherits(MappingPromiseArray,PromiseArray),MappingPromiseArray.prototype._init=function(){},MappingPromiseArray.prototype._promiseFulfilled=function(value,index){var values=this._values,length=this.length(),preservedValues=this._preservedValues,limit=this._limit;if(values[index]===PENDING){if(values[index]=value,limit>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(limit>=1&&this._inFlight>=limit)return values[index]=value,void this._queue.push(index);null!==preservedValues&&(preservedValues[index]=value);var callback=this._callback,receiver=this._promise._boundTo;this._promise._pushContext();var ret=tryCatch(callback).call(receiver,value,index,length);if(this._promise._popContext(),ret===errorObj)return this._reject(ret.e);var maybePromise=tryConvertToPromise(ret,this._promise);if(maybePromise instanceof Promise){if(maybePromise=maybePromise._target(),maybePromise._isPending())return limit>=1&&this._inFlight++,values[index]=PENDING,maybePromise._proxyPromiseArray(this,index);if(!maybePromise._isFulfilled())return this._reject(maybePromise._reason());ret=maybePromise._value()}values[index]=ret}var totalResolved=++this._totalResolved;totalResolved>=length&&(null!==preservedValues?this._filter(values,preservedValues):this._resolve(values))},MappingPromiseArray.prototype._drainQueue=function(){for(var queue=this._queue,limit=this._limit,values=this._values;queue.length>0&&this._inFlighti;++i)booleans[i]&&(ret[j++]=values[i]);ret.length=j,this._resolve(ret)},MappingPromiseArray.prototype.preservedValues=function(){return this._preservedValues},Promise.prototype.map=function(fn,options){return"function"!=typeof fn?apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n"):map(this,fn,options,null).promise()},Promise.map=function(promises,fn,options,_filter){return"function"!=typeof fn?apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n"):map(promises,fn,options,_filter).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(_dereq_,module){"use strict";module.exports=function(Promise,INTERNAL,tryConvertToPromise,apiRejection){var util=_dereq_("./util.js"),tryCatch=util.tryCatch;Promise.method=function(fn){if("function"!=typeof fn)throw new Promise.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var ret=new Promise(INTERNAL);ret._captureStackTrace(),ret._pushContext();var value=tryCatch(fn).apply(this,arguments);return ret._popContext(),ret._resolveFromSyncValue(value),ret}},Promise.attempt=Promise["try"]=function(fn,args,ctx){if("function"!=typeof fn)return apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n");var ret=new Promise(INTERNAL);ret._captureStackTrace(),ret._pushContext();var value=util.isArray(args)?tryCatch(fn).apply(ctx,args):tryCatch(fn).call(ctx,args);return ret._popContext(),ret._resolveFromSyncValue(value),ret},Promise.prototype._resolveFromSyncValue=function(value){value===util.errorObj?this._rejectCallback(value.e,!1,!0):this._resolveCallback(value,!0)}}},{"./util.js":38}],21:[function(_dereq_,module){"use strict";module.exports=function(Promise){function spreadAdapter(val,nodeback){var promise=this;if(!util.isArray(val))return successAdapter.call(promise,val,nodeback);var ret=tryCatch(nodeback).apply(promise._boundTo,[null].concat(val));ret===errorObj&&async.throwLater(ret.e)}function successAdapter(val,nodeback){var promise=this,receiver=promise._boundTo,ret=void 0===val?tryCatch(nodeback).call(receiver,null):tryCatch(nodeback).call(receiver,null,val);ret===errorObj&&async.throwLater(ret.e)}function errorAdapter(reason,nodeback){var promise=this;if(!reason){var target=promise._target(),newReason=target._getCarriedStackTrace();newReason.cause=reason,reason=newReason}var ret=tryCatch(nodeback).call(promise._boundTo,reason);ret===errorObj&&async.throwLater(ret.e)}var util=_dereq_("./util.js"),async=_dereq_("./async.js"),tryCatch=util.tryCatch,errorObj=util.errorObj;Promise.prototype.asCallback=Promise.prototype.nodeify=function(nodeback,options){if("function"==typeof nodeback){var adapter=successAdapter;void 0!==options&&Object(options).spread&&(adapter=spreadAdapter),this._then(adapter,errorAdapter,void 0,this,nodeback)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(_dereq_,module){"use strict";module.exports=function(Promise,PromiseArray){var util=_dereq_("./util.js"),async=_dereq_("./async.js"),tryCatch=util.tryCatch,errorObj=util.errorObj;Promise.prototype.progressed=function(handler){return this._then(void 0,void 0,handler,void 0,void 0)},Promise.prototype._progress=function(progressValue){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(progressValue)},Promise.prototype._progressHandlerAt=function(index){return 0===index?this._progressHandler0:this[(index<<2)+index-5+2]},Promise.prototype._doProgressWith=function(progression){var progressValue=progression.value,handler=progression.handler,promise=progression.promise,receiver=progression.receiver,ret=tryCatch(handler).call(receiver,progressValue);if(ret===errorObj){if(null!=ret.e&&"StopProgressPropagation"!==ret.e.name){var trace=util.canAttachTrace(ret.e)?ret.e:new Error(util.toString(ret.e));promise._attachExtraTrace(trace),promise._progress(ret.e)}}else ret instanceof Promise?ret._then(promise._progress,null,null,promise,void 0):promise._progress(ret)},Promise.prototype._progressUnchecked=function(progressValue){for(var len=this._length(),progress=this._progress,i=0;len>i;i++){var handler=this._progressHandlerAt(i),promise=this._promiseAt(i);if(promise instanceof Promise)"function"==typeof handler?async.invoke(this._doProgressWith,this,{handler:handler,promise:promise,receiver:this._receiverAt(i),value:progressValue}):async.invoke(progress,promise,progressValue);else{var receiver=this._receiverAt(i);"function"==typeof handler?handler.call(receiver,progressValue,promise):receiver instanceof PromiseArray&&!receiver._isResolved()&&receiver._promiseProgressed(progressValue,promise)}}}}},{"./async.js":2,"./util.js":38}],23:[function(_dereq_,module){"use strict";module.exports=function(){function Promise(resolver){if("function"!=typeof resolver)throw new TypeError("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==Promise)throw new TypeError("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,resolver!==INTERNAL&&this._resolveFromResolver(resolver)}function fillTypes(value){var p=new Promise(INTERNAL);p._fulfillmentHandler0=value,p._rejectionHandler0=value,p._progressHandler0=value,p._promise0=value,p._receiver0=value,p._settledValue=value}var makeSelfResolutionError=function(){return new TypeError("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},reflect=function(){return new Promise.PromiseInspection(this._target())},apiRejection=function(msg){return Promise.reject(new TypeError(msg))},util=_dereq_("./util.js"),async=_dereq_("./async.js"),errors=_dereq_("./errors.js"),TypeError=Promise.TypeError=errors.TypeError;Promise.RangeError=errors.RangeError,Promise.CancellationError=errors.CancellationError,Promise.TimeoutError=errors.TimeoutError,Promise.OperationalError=errors.OperationalError,Promise.RejectionError=errors.OperationalError,Promise.AggregateError=errors.AggregateError;var INTERNAL=function(){},APPLY={},NEXT_FILTER={e:null},tryConvertToPromise=_dereq_("./thenables.js")(Promise,INTERNAL),PromiseArray=_dereq_("./promise_array.js")(Promise,INTERNAL,tryConvertToPromise,apiRejection),CapturedTrace=_dereq_("./captured_trace.js")(),isDebugging=_dereq_("./debuggability.js")(Promise,CapturedTrace),createContext=_dereq_("./context.js")(Promise,CapturedTrace,isDebugging),CatchFilter=_dereq_("./catch_filter.js")(NEXT_FILTER),PromiseResolver=_dereq_("./promise_resolver.js"),nodebackForPromise=PromiseResolver._nodebackForPromise,errorObj=util.errorObj,tryCatch=util.tryCatch;return Promise.prototype.toString=function(){return"[object Promise]"},Promise.prototype.caught=Promise.prototype["catch"]=function(fn){var len=arguments.length;if(len>1){var i,catchInstances=new Array(len-1),j=0;for(i=0;len-1>i;++i){var item=arguments[i];if("function"!=typeof item)return Promise.reject(new TypeError("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));catchInstances[j++]=item}catchInstances.length=j,fn=arguments[i];var catchFilter=new CatchFilter(catchInstances,fn,this);return this._then(void 0,catchFilter.doFilter,void 0,catchFilter,void 0)}return this._then(void 0,fn,void 0,void 0,void 0)},Promise.prototype.reflect=function(){return this._then(reflect,reflect,void 0,this,void 0)},Promise.prototype.then=function(didFulfill,didReject,didProgress){if(isDebugging()&&arguments.length>0&&"function"!=typeof didFulfill&&"function"!=typeof didReject){var msg=".then() only accepts functions but was passed: "+util.classString(didFulfill);arguments.length>1&&(msg+=", "+util.classString(didReject)),this._warn(msg)}return this._then(didFulfill,didReject,didProgress,void 0,void 0)},Promise.prototype.done=function(didFulfill,didReject,didProgress){var promise=this._then(didFulfill,didReject,didProgress,void 0,void 0);promise._setIsFinal()},Promise.prototype.spread=function(didFulfill,didReject){return this.all()._then(didFulfill,didReject,void 0,APPLY,void 0)},Promise.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},Promise.prototype.toJSON=function(){var ret={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(ret.fulfillmentValue=this.value(),ret.isFulfilled=!0):this.isRejected()&&(ret.rejectionReason=this.reason(),ret.isRejected=!0),ret},Promise.prototype.all=function(){return new PromiseArray(this).promise()},Promise.prototype.error=function(fn){return this.caught(util.originatesFromRejection,fn)},Promise.is=function(val){return val instanceof Promise},Promise.fromNode=function(fn){var ret=new Promise(INTERNAL),result=tryCatch(fn)(nodebackForPromise(ret));return result===errorObj&&ret._rejectCallback(result.e,!0,!0),ret},Promise.all=function(promises){return new PromiseArray(promises).promise()},Promise.defer=Promise.pending=function(){var promise=new Promise(INTERNAL);return new PromiseResolver(promise)},Promise.cast=function(obj){var ret=tryConvertToPromise(obj);if(!(ret instanceof Promise)){var val=ret;ret=new Promise(INTERNAL),ret._fulfillUnchecked(val)}return ret},Promise.resolve=Promise.fulfilled=Promise.cast,Promise.reject=Promise.rejected=function(reason){var ret=new Promise(INTERNAL);return ret._captureStackTrace(),ret._rejectCallback(reason,!0),ret},Promise.setScheduler=function(fn){if("function"!=typeof fn)throw new TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");var prev=async._schedule;return async._schedule=fn,prev},Promise.prototype._then=function(didFulfill,didReject,didProgress,receiver,internalData){var haveInternalData=void 0!==internalData,ret=haveInternalData?internalData:new Promise(INTERNAL);haveInternalData||(ret._propagateFrom(this,5),ret._captureStackTrace());var target=this._target();target!==this&&(void 0===receiver&&(receiver=this._boundTo),haveInternalData||ret._setIsMigrated());var callbackIndex=target._addCallbacks(didFulfill,didReject,didProgress,ret,receiver);return target._isResolved()&&!target._isSettlePromisesQueued()&&async.invoke(target._settlePromiseAtPostResolution,target,callbackIndex),ret},Promise.prototype._settlePromiseAtPostResolution=function(index){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(index)},Promise.prototype._length=function(){return 131071&this._bitField},Promise.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},Promise.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},Promise.prototype._setLength=function(len){this._bitField=-131072&this._bitField|131071&len},Promise.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},Promise.prototype._setRejected=function(){this._bitField=134217728|this._bitField},Promise.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},Promise.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},Promise.prototype._isFinal=function(){return(33554432&this._bitField)>0},Promise.prototype._cancellable=function(){return(67108864&this._bitField)>0},Promise.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},Promise.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},Promise.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},Promise.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},Promise.prototype._isMigrated=function(){return(4194304&this._bitField)>0},Promise.prototype._receiverAt=function(index){var ret=0===index?this._receiver0:this[5*index-5+4];return void 0===ret&&this._isBound()?this._boundTo:ret},Promise.prototype._promiseAt=function(index){return 0===index?this._promise0:this[5*index-5+3]},Promise.prototype._fulfillmentHandlerAt=function(index){return 0===index?this._fulfillmentHandler0:this[5*index-5+0]},Promise.prototype._rejectionHandlerAt=function(index){return 0===index?this._rejectionHandler0:this[5*index-5+1]},Promise.prototype._migrateCallbacks=function(follower,index){var fulfill=follower._fulfillmentHandlerAt(index),reject=follower._rejectionHandlerAt(index),progress=follower._progressHandlerAt(index),promise=follower._promiseAt(index),receiver=follower._receiverAt(index);promise instanceof Promise&&promise._setIsMigrated(),this._addCallbacks(fulfill,reject,progress,promise,receiver)},Promise.prototype._addCallbacks=function(fulfill,reject,progress,promise,receiver){var index=this._length();if(index>=131066&&(index=0,this._setLength(0)),0===index)this._promise0=promise,void 0!==receiver&&(this._receiver0=receiver),"function"!=typeof fulfill||this._isCarryingStackTrace()||(this._fulfillmentHandler0=fulfill),"function"==typeof reject&&(this._rejectionHandler0=reject),"function"==typeof progress&&(this._progressHandler0=progress);else{var base=5*index-5;this[base+3]=promise,this[base+4]=receiver,"function"==typeof fulfill&&(this[base+0]=fulfill),"function"==typeof reject&&(this[base+1]=reject),"function"==typeof progress&&(this[base+2]=progress)}return this._setLength(index+1),index},Promise.prototype._setProxyHandlers=function(receiver,promiseSlotValue){var index=this._length();if(index>=131066&&(index=0,this._setLength(0)),0===index)this._promise0=promiseSlotValue,this._receiver0=receiver;else{var base=5*index-5;this[base+3]=promiseSlotValue,this[base+4]=receiver}this._setLength(index+1)},Promise.prototype._proxyPromiseArray=function(promiseArray,index){this._setProxyHandlers(promiseArray,index)},Promise.prototype._resolveCallback=function(value,shouldBind){if(!this._isFollowingOrFulfilledOrRejected()){if(value===this)return this._rejectCallback(makeSelfResolutionError(),!1,!0);var maybePromise=tryConvertToPromise(value,this);if(!(maybePromise instanceof Promise))return this._fulfill(value);var propagationFlags=1|(shouldBind?4:0);this._propagateFrom(maybePromise,propagationFlags);var promise=maybePromise._target();if(promise._isPending()){for(var len=this._length(),i=0;len>i;++i)promise._migrateCallbacks(this,i);this._setFollowing(),this._setLength(0),this._setFollowee(promise)}else promise._isFulfilled()?this._fulfillUnchecked(promise._value()):this._rejectUnchecked(promise._reason(),promise._getCarriedStackTrace())}},Promise.prototype._rejectCallback=function(reason,synchronous,shouldNotMarkOriginatingFromRejection){shouldNotMarkOriginatingFromRejection||util.markAsOriginatingFromRejection(reason);var trace=util.ensureErrorObject(reason),hasStack=trace===reason;this._attachExtraTrace(trace,synchronous?hasStack:!1),this._reject(reason,hasStack?void 0:trace)},Promise.prototype._resolveFromResolver=function(resolver){var promise=this;this._captureStackTrace(),this._pushContext();var synchronous=!0,r=tryCatch(resolver)(function(value){null!==promise&&(promise._resolveCallback(value),promise=null)},function(reason){null!==promise&&(promise._rejectCallback(reason,synchronous),promise=null)});synchronous=!1,this._popContext(),void 0!==r&&r===errorObj&&null!==promise&&(promise._rejectCallback(r.e,!0,!0),promise=null)},Promise.prototype._settlePromiseFromHandler=function(handler,receiver,value,promise){if(!promise._isRejected()){promise._pushContext();var x;if(x=receiver!==APPLY||this._isRejected()?tryCatch(handler).call(receiver,value):tryCatch(handler).apply(this._boundTo,value),promise._popContext(),x===errorObj||x===promise||x===NEXT_FILTER){var err=x===promise?makeSelfResolutionError():x.e;promise._rejectCallback(err,!1,!0)}else promise._resolveCallback(x)}},Promise.prototype._target=function(){for(var ret=this;ret._isFollowing();)ret=ret._followee();return ret},Promise.prototype._followee=function(){return this._rejectionHandler0},Promise.prototype._setFollowee=function(promise){this._rejectionHandler0=promise},Promise.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},Promise.prototype._propagateFrom=function(parent,flags){(1&flags)>0&&parent._cancellable()&&(this._setCancellable(),this._cancellationParent=parent),(4&flags)>0&&parent._isBound()&&this._setBoundTo(parent._boundTo)},Promise.prototype._fulfill=function(value){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(value)},Promise.prototype._reject=function(reason,carriedStackTrace){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(reason,carriedStackTrace)},Promise.prototype._settlePromiseAt=function(index){var promise=this._promiseAt(index),isPromise=promise instanceof Promise;if(isPromise&&promise._isMigrated())return promise._unsetIsMigrated(),async.invoke(this._settlePromiseAt,this,index);var handler=this._isFulfilled()?this._fulfillmentHandlerAt(index):this._rejectionHandlerAt(index),carriedStackTrace=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,value=this._settledValue,receiver=this._receiverAt(index);this._clearCallbackDataAtIndex(index),"function"==typeof handler?isPromise?this._settlePromiseFromHandler(handler,receiver,value,promise):handler.call(receiver,value,promise):receiver instanceof PromiseArray?receiver._isResolved()||(this._isFulfilled()?receiver._promiseFulfilled(value,promise):receiver._promiseRejected(value,promise)):isPromise&&(this._isFulfilled()?promise._fulfill(value):promise._reject(value,carriedStackTrace)),index>=4&&4===(31&index)&&async.invokeLater(this._setLength,this,0)},Promise.prototype._clearCallbackDataAtIndex=function(index){if(0===index)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var base=5*index-5;this[base+3]=this[base+4]=this[base+0]=this[base+1]=this[base+2]=void 0}},Promise.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},Promise.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},Promise.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},Promise.prototype._queueSettlePromises=function(){async.settlePromises(this),this._setSettlePromisesQueued()},Promise.prototype._fulfillUnchecked=function(value){if(value===this){var err=makeSelfResolutionError();return this._attachExtraTrace(err),this._rejectUnchecked(err,void 0)}this._setFulfilled(),this._settledValue=value,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},Promise.prototype._rejectUncheckedCheckError=function(reason){var trace=util.ensureErrorObject(reason);this._rejectUnchecked(reason,trace===reason?void 0:trace)},Promise.prototype._rejectUnchecked=function(reason,trace){if(reason===this){var err=makeSelfResolutionError();return this._attachExtraTrace(err),this._rejectUnchecked(err)}return this._setRejected(),this._settledValue=reason,this._cleanValues(),this._isFinal()?void async.throwLater(function(e){throw"stack"in e&&async.invokeFirst(CapturedTrace.unhandledRejection,void 0,e),e},void 0===trace?reason:trace):(void 0!==trace&&trace!==reason&&this._setCarriedStackTrace(trace),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},Promise.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var len=this._length(),i=0;len>i;i++)this._settlePromiseAt(i)},Promise._makeSelfResolutionError=makeSelfResolutionError,_dereq_("./progress.js")(Promise,PromiseArray),_dereq_("./method.js")(Promise,INTERNAL,tryConvertToPromise,apiRejection),_dereq_("./bind.js")(Promise,INTERNAL,tryConvertToPromise),_dereq_("./finally.js")(Promise,NEXT_FILTER,tryConvertToPromise),_dereq_("./direct_resolve.js")(Promise),_dereq_("./synchronous_inspection.js")(Promise),_dereq_("./join.js")(Promise,PromiseArray,tryConvertToPromise,INTERNAL),Promise.Promise=Promise,_dereq_("./map.js")(Promise,PromiseArray,apiRejection,tryConvertToPromise,INTERNAL),_dereq_("./cancel.js")(Promise),_dereq_("./using.js")(Promise,apiRejection,tryConvertToPromise,createContext),_dereq_("./generators.js")(Promise,apiRejection,INTERNAL,tryConvertToPromise),_dereq_("./nodeify.js")(Promise),_dereq_("./call_get.js")(Promise),_dereq_("./props.js")(Promise,PromiseArray,tryConvertToPromise,apiRejection),_dereq_("./race.js")(Promise,INTERNAL,tryConvertToPromise,apiRejection),_dereq_("./reduce.js")(Promise,PromiseArray,apiRejection,tryConvertToPromise,INTERNAL),_dereq_("./settle.js")(Promise,PromiseArray),_dereq_("./some.js")(Promise,PromiseArray,apiRejection),_dereq_("./promisify.js")(Promise,INTERNAL),_dereq_("./any.js")(Promise),_dereq_("./each.js")(Promise,INTERNAL),_dereq_("./timers.js")(Promise,INTERNAL),_dereq_("./filter.js")(Promise,INTERNAL),util.toFastProperties(Promise),util.toFastProperties(Promise.prototype),fillTypes({a:1}),fillTypes({b:2}),fillTypes({c:3}),fillTypes(1),fillTypes(function(){}),fillTypes(void 0),fillTypes(!1),fillTypes(new Promise(INTERNAL)),CapturedTrace.setBounds(async.firstLineError,util.lastLineError),Promise}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(_dereq_,module){"use strict";module.exports=function(Promise,INTERNAL,tryConvertToPromise,apiRejection){function toResolutionValue(val){switch(val){case-2:return[];case-3:return{}}}function PromiseArray(values){var parent,promise=this._promise=new Promise(INTERNAL);values instanceof Promise&&(parent=values,promise._propagateFrom(parent,5)),this._values=values,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var util=_dereq_("./util.js"),isArray=util.isArray;return PromiseArray.prototype.length=function(){return this._length},PromiseArray.prototype.promise=function(){return this._promise},PromiseArray.prototype._init=function init(_,resolveValueIfEmpty){var values=tryConvertToPromise(this._values,this._promise);if(values instanceof Promise){if(values=values._target(),this._values=values,!values._isFulfilled())return values._isPending()?void values._then(init,this._reject,void 0,this,resolveValueIfEmpty):void this._reject(values._reason());if(values=values._value(),!isArray(values)){var err=new Promise.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n"); -return void this.__hardReject__(err)}}else if(!isArray(values))return void this._promise._reject(apiRejection("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===values.length)return void(-5===resolveValueIfEmpty?this._resolveEmptyArray():this._resolve(toResolutionValue(resolveValueIfEmpty)));var len=this.getActualLength(values.length);this._length=len,this._values=this.shouldCopyValues()?new Array(len):this._values;for(var promise=this._promise,i=0;len>i;++i){var isResolved=this._isResolved(),maybePromise=tryConvertToPromise(values[i],promise);maybePromise instanceof Promise?(maybePromise=maybePromise._target(),isResolved?maybePromise._ignoreRejections():maybePromise._isPending()?maybePromise._proxyPromiseArray(this,i):maybePromise._isFulfilled()?this._promiseFulfilled(maybePromise._value(),i):this._promiseRejected(maybePromise._reason(),i)):isResolved||this._promiseFulfilled(maybePromise,i)}},PromiseArray.prototype._isResolved=function(){return null===this._values},PromiseArray.prototype._resolve=function(value){this._values=null,this._promise._fulfill(value)},PromiseArray.prototype.__hardReject__=PromiseArray.prototype._reject=function(reason){this._values=null,this._promise._rejectCallback(reason,!1,!0)},PromiseArray.prototype._promiseProgressed=function(progressValue,index){this._promise._progress({index:index,value:progressValue})},PromiseArray.prototype._promiseFulfilled=function(value,index){this._values[index]=value;var totalResolved=++this._totalResolved;totalResolved>=this._length&&this._resolve(this._values)},PromiseArray.prototype._promiseRejected=function(reason){this._totalResolved++,this._reject(reason)},PromiseArray.prototype.shouldCopyValues=function(){return!0},PromiseArray.prototype.getActualLength=function(len){return len},PromiseArray}},{"./util.js":38}],25:[function(_dereq_,module){"use strict";function isUntypedError(obj){return obj instanceof Error&&es5.getPrototypeOf(obj)===Error.prototype}function wrapAsOperationalError(obj){var ret;if(isUntypedError(obj)){ret=new OperationalError(obj),ret.name=obj.name,ret.message=obj.message,ret.stack=obj.stack;for(var keys=es5.keys(obj),i=0;i2){for(var $_len=arguments.length,args=new Array($_len-1),$_i=1;$_len>$_i;++$_i)args[$_i-1]=arguments[$_i];promise._fulfill(args)}else promise._fulfill(value);promise=null}}}var PromiseResolver,util=_dereq_("./util.js"),maybeWrapAsError=util.maybeWrapAsError,errors=_dereq_("./errors.js"),TimeoutError=errors.TimeoutError,OperationalError=errors.OperationalError,haveGetters=util.haveGetters,es5=_dereq_("./es5.js"),rErrorKey=/^(?:name|message|stack|cause)$/;if(PromiseResolver=haveGetters?function(promise){this.promise=promise}:function(promise){this.promise=promise,this.asCallback=nodebackForPromise(promise),this.callback=this.asCallback},haveGetters){var prop={get:function(){return nodebackForPromise(this.promise)}};es5.defineProperty(PromiseResolver.prototype,"asCallback",prop),es5.defineProperty(PromiseResolver.prototype,"callback",prop)}PromiseResolver._nodebackForPromise=nodebackForPromise,PromiseResolver.prototype.toString=function(){return"[object PromiseResolver]"},PromiseResolver.prototype.resolve=PromiseResolver.prototype.fulfill=function(value){if(!(this instanceof PromiseResolver))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(value)},PromiseResolver.prototype.reject=function(reason){if(!(this instanceof PromiseResolver))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(reason)},PromiseResolver.prototype.progress=function(value){if(!(this instanceof PromiseResolver))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(value)},PromiseResolver.prototype.cancel=function(err){this.promise.cancel(err)},PromiseResolver.prototype.timeout=function(){this.reject(new TimeoutError("timeout"))},PromiseResolver.prototype.isResolved=function(){return this.promise.isResolved()},PromiseResolver.prototype.toJSON=function(){return this.promise.toJSON()},module.exports=PromiseResolver},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(_dereq_,module){"use strict";module.exports=function(Promise,INTERNAL){function propsFilter(key){return!noCopyPropsPattern.test(key)}function isPromisified(fn){try{return fn.__isPromisified__===!0}catch(e){return!1}}function hasPromisified(obj,key,suffix){var val=util.getDataPropertyOrDefault(obj,key+suffix,defaultPromisified);return val?isPromisified(val):!1}function checkValid(ret,suffix,suffixRegexp){for(var i=0;ii;i+=2){var key=methods[i],fn=methods[i+1],promisifiedKey=key+suffix;obj[promisifiedKey]=promisifier===makeNodePromisified?makeNodePromisified(key,THIS,key,fn,suffix):promisifier(fn,function(){return makeNodePromisified(key,THIS,key,fn,suffix)})}return util.toFastProperties(obj),obj}function promisify(callback,receiver){return makeNodePromisified(callback,receiver,void 0,callback)}var makeNodePromisifiedEval,THIS={},util=_dereq_("./util.js"),nodebackForPromise=_dereq_("./promise_resolver.js")._nodebackForPromise,withAppended=util.withAppended,maybeWrapAsError=util.maybeWrapAsError,canEvaluate=util.canEvaluate,TypeError=_dereq_("./errors").TypeError,defaultSuffix="Async",defaultPromisified={__isPromisified__:!0},noCopyPropsPattern=/^(?:length|name|arguments|caller|callee|prototype|__isPromisified__)$/,defaultFilter=function(name){return util.isIdentifier(name)&&"_"!==name.charAt(0)&&"constructor"!==name},escapeIdentRegex=function(str){return str.replace(/([$])/,"\\$")},makeNodePromisified=canEvaluate?makeNodePromisifiedEval:makeNodePromisifiedClosure;Promise.promisify=function(fn,receiver){if("function"!=typeof fn)throw new TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(isPromisified(fn))return fn;var ret=promisify(fn,arguments.length<2?THIS:receiver);return util.copyDescriptors(fn,ret,propsFilter),ret},Promise.promisifyAll=function(target,options){if("function"!=typeof target&&"object"!=typeof target)throw new TypeError("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");options=Object(options);var suffix=options.suffix;"string"!=typeof suffix&&(suffix=defaultSuffix);var filter=options.filter;"function"!=typeof filter&&(filter=defaultFilter);var promisifier=options.promisifier;if("function"!=typeof promisifier&&(promisifier=makeNodePromisified),!util.isIdentifier(suffix))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var keys=util.inheritedDataKeys(target),i=0;ii;++i){var key=keys[i];values[i]=obj[key],values[i+len]=key}this.constructor$(values)}function props(promises){var ret,castValue=tryConvertToPromise(promises);return isObject(castValue)?(ret=castValue instanceof Promise?castValue._then(Promise.props,void 0,void 0,void 0,void 0):new PropertiesPromiseArray(castValue).promise(),castValue instanceof Promise&&ret._propagateFrom(castValue,4),ret):apiRejection("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var util=_dereq_("./util.js"),isObject=util.isObject,es5=_dereq_("./es5.js");util.inherits(PropertiesPromiseArray,PromiseArray),PropertiesPromiseArray.prototype._init=function(){this._init$(void 0,-3)},PropertiesPromiseArray.prototype._promiseFulfilled=function(value,index){this._values[index]=value;var totalResolved=++this._totalResolved;if(totalResolved>=this._length){for(var val={},keyOffset=this.length(),i=0,len=this.length();len>i;++i)val[this._values[i+keyOffset]]=this._values[i];this._resolve(val)}},PropertiesPromiseArray.prototype._promiseProgressed=function(value,index){this._promise._progress({key:this._values[index+this.length()],value:value})},PropertiesPromiseArray.prototype.shouldCopyValues=function(){return!1},PropertiesPromiseArray.prototype.getActualLength=function(len){return len>>1},Promise.prototype.props=function(){return props(this)},Promise.props=function(promises){return props(promises)}}},{"./es5.js":14,"./util.js":38}],28:[function(_dereq_,module){"use strict";function arrayMove(src,srcIndex,dst,dstIndex,len){for(var j=0;len>j;++j)dst[j+dstIndex]=src[j+srcIndex],src[j+srcIndex]=void 0}function Queue(capacity){this._capacity=capacity,this._length=0,this._front=0}Queue.prototype._willBeOverCapacity=function(size){return this._capacityi;++i){var val=promises[i];(void 0!==val||i in promises)&&Promise.cast(val)._then(fulfill,reject,void 0,ret,null)}return ret}var isArray=_dereq_("./util.js").isArray,raceLater=function(promise){return promise.then(function(array){return race(array,promise)})};Promise.race=function(promises){return race(promises,void 0)},Promise.prototype.race=function(){return race(this,void 0)}}},{"./util.js":38}],30:[function(_dereq_,module){"use strict";module.exports=function(Promise,PromiseArray,apiRejection,tryConvertToPromise,INTERNAL){function ReductionPromiseArray(promises,fn,accum,_each){this.constructor$(promises),this._promise._captureStackTrace(),this._preservedValues=_each===INTERNAL?[]:null,this._zerothIsAccum=void 0===accum,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var maybePromise=tryConvertToPromise(accum,this._promise),rejected=!1,isPromise=maybePromise instanceof Promise;isPromise&&(maybePromise=maybePromise._target(),maybePromise._isPending()?maybePromise._proxyPromiseArray(this,-1):maybePromise._isFulfilled()?(accum=maybePromise._value(),this._gotAccum=!0):(this._reject(maybePromise._reason()),rejected=!0)),isPromise||this._zerothIsAccum||(this._gotAccum=!0),this._callback=fn,this._accum=accum,rejected||async.invoke(init,this,void 0)}function init(){this._init$(void 0,-5)}function reduce(promises,fn,initialValue,_each){if("function"!=typeof fn)return apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n");var array=new ReductionPromiseArray(promises,fn,initialValue,_each);return array.promise()}var async=_dereq_("./async.js"),util=_dereq_("./util.js"),tryCatch=util.tryCatch,errorObj=util.errorObj;util.inherits(ReductionPromiseArray,PromiseArray),ReductionPromiseArray.prototype._init=function(){},ReductionPromiseArray.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},ReductionPromiseArray.prototype._promiseFulfilled=function(value,index){var values=this._values;values[index]=value;var valuesPhaseIndex,length=this.length(),preservedValues=this._preservedValues,isEach=null!==preservedValues,gotAccum=this._gotAccum,valuesPhase=this._valuesPhase;if(!valuesPhase)for(valuesPhase=this._valuesPhase=new Array(length),valuesPhaseIndex=0;length>valuesPhaseIndex;++valuesPhaseIndex)valuesPhase[valuesPhaseIndex]=0;if(valuesPhaseIndex=valuesPhase[index],0===index&&this._zerothIsAccum?(this._accum=value,this._gotAccum=gotAccum=!0,valuesPhase[index]=0===valuesPhaseIndex?1:2):-1===index?(this._accum=value,this._gotAccum=gotAccum=!0):0===valuesPhaseIndex?valuesPhase[index]=1:(valuesPhase[index]=2,this._accum=value),gotAccum){for(var ret,callback=this._callback,receiver=this._promise._boundTo,i=this._reducingIndex;length>i;++i)if(valuesPhaseIndex=valuesPhase[i],2!==valuesPhaseIndex){if(1!==valuesPhaseIndex)return;if(value=values[i],this._promise._pushContext(),isEach?(preservedValues.push(value),ret=tryCatch(callback).call(receiver,value,i,length)):ret=tryCatch(callback).call(receiver,this._accum,value,i,length),this._promise._popContext(),ret===errorObj)return this._reject(ret.e);var maybePromise=tryConvertToPromise(ret,this._promise);if(maybePromise instanceof Promise){if(maybePromise=maybePromise._target(),maybePromise._isPending())return valuesPhase[i]=4,maybePromise._proxyPromiseArray(this,i);if(!maybePromise._isFulfilled())return this._reject(maybePromise._reason());ret=maybePromise._value()}this._reducingIndex=i+1,this._accum=ret}else this._reducingIndex=i+1;this._resolve(isEach?preservedValues:this._accum)}},Promise.prototype.reduce=function(fn,initialValue){return reduce(this,fn,initialValue,null)},Promise.reduce=function(promises,fn,initialValue,_each){return reduce(promises,fn,initialValue,_each)}}},{"./async.js":2,"./util.js":38}],31:[function(_dereq_,module){"use strict";var schedule,util=_dereq_("./util"),noAsyncScheduler=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};if(util.isNode&&"undefined"==typeof MutationObserver){var GlobalSetImmediate=global.setImmediate,ProcessNextTick=process.nextTick;schedule=util.isRecentNode?function(fn){GlobalSetImmediate.call(global,fn)}:function(fn){ProcessNextTick.call(process,fn)}}else"undefined"!=typeof MutationObserver?(schedule=function(fn){var div=document.createElement("div"),observer=new MutationObserver(fn);return observer.observe(div,{attributes:!0}),function(){div.classList.toggle("foo")}},schedule.isStatic=!0):schedule="undefined"!=typeof setImmediate?function(fn){setImmediate(fn)}:"undefined"!=typeof setTimeout?function(fn){setTimeout(fn,0)}:noAsyncScheduler;module.exports=schedule},{"./util":38}],32:[function(_dereq_,module){"use strict";module.exports=function(Promise,PromiseArray){function SettledPromiseArray(values){this.constructor$(values)}var PromiseInspection=Promise.PromiseInspection,util=_dereq_("./util.js");util.inherits(SettledPromiseArray,PromiseArray),SettledPromiseArray.prototype._promiseResolved=function(index,inspection){this._values[index]=inspection;var totalResolved=++this._totalResolved;totalResolved>=this._length&&this._resolve(this._values)},SettledPromiseArray.prototype._promiseFulfilled=function(value,index){var ret=new PromiseInspection;ret._bitField=268435456,ret._settledValue=value,this._promiseResolved(index,ret)},SettledPromiseArray.prototype._promiseRejected=function(reason,index){var ret=new PromiseInspection;ret._bitField=134217728,ret._settledValue=reason,this._promiseResolved(index,ret)},Promise.settle=function(promises){return new SettledPromiseArray(promises).promise()},Promise.prototype.settle=function(){return new SettledPromiseArray(this).promise()}}},{"./util.js":38}],33:[function(_dereq_,module){"use strict";module.exports=function(Promise,PromiseArray,apiRejection){function SomePromiseArray(values){this.constructor$(values),this._howMany=0,this._unwrap=!1,this._initialized=!1}function some(promises,howMany){if((0|howMany)!==howMany||0>howMany)return apiRejection("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var ret=new SomePromiseArray(promises),promise=ret.promise();return ret.setHowMany(howMany),ret.init(),promise}var util=_dereq_("./util.js"),RangeError=_dereq_("./errors.js").RangeError,AggregateError=_dereq_("./errors.js").AggregateError,isArray=util.isArray;util.inherits(SomePromiseArray,PromiseArray),SomePromiseArray.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var isArrayResolved=isArray(this._values);!this._isResolved()&&isArrayResolved&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},SomePromiseArray.prototype.init=function(){this._initialized=!0,this._init()},SomePromiseArray.prototype.setUnwrap=function(){this._unwrap=!0},SomePromiseArray.prototype.howMany=function(){return this._howMany},SomePromiseArray.prototype.setHowMany=function(count){this._howMany=count},SomePromiseArray.prototype._promiseFulfilled=function(value){this._addFulfilled(value),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values))},SomePromiseArray.prototype._promiseRejected=function(reason){if(this._addRejected(reason),this.howMany()>this._canPossiblyFulfill()){for(var e=new AggregateError,i=this.length();i0},PromiseInspection.prototype.isRejected=Promise.prototype._isRejected=function(){return(134217728&this._bitField)>0},PromiseInspection.prototype.isPending=Promise.prototype._isPending=function(){return 0===(402653184&this._bitField)},PromiseInspection.prototype.isResolved=Promise.prototype._isResolved=function(){return(402653184&this._bitField)>0},Promise.prototype.isPending=function(){return this._target()._isPending()},Promise.prototype.isRejected=function(){return this._target()._isRejected()},Promise.prototype.isFulfilled=function(){return this._target()._isFulfilled()},Promise.prototype.isResolved=function(){return this._target()._isResolved()},Promise.prototype._value=function(){return this._settledValue},Promise.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},Promise.prototype.value=function(){var target=this._target();if(!target.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return target._settledValue},Promise.prototype.reason=function(){var target=this._target();if(!target.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return target._unsetRejectionIsUnhandled(),target._settledValue},Promise.PromiseInspection=PromiseInspection}},{}],35:[function(_dereq_,module){"use strict";module.exports=function(Promise,INTERNAL){function tryConvertToPromise(obj,context){if(isObject(obj)){if(obj instanceof Promise)return obj;if(isAnyBluebirdPromise(obj)){var ret=new Promise(INTERNAL);return obj._then(ret._fulfillUnchecked,ret._rejectUncheckedCheckError,ret._progressUnchecked,ret,null),ret}var then=util.tryCatch(getThen)(obj);if(then===errorObj){context&&context._pushContext();var ret=Promise.reject(then.e);return context&&context._popContext(),ret}if("function"==typeof then)return doThenable(obj,then,context)}return obj}function getThen(obj){return obj.then}function isAnyBluebirdPromise(obj){return hasProp.call(obj,"_promise0")}function doThenable(x,then,context){function resolveFromThenable(value){promise&&(x===value?promise._rejectCallback(Promise._makeSelfResolutionError(),!1,!0):promise._resolveCallback(value),promise=null)}function rejectFromThenable(reason){promise&&(promise._rejectCallback(reason,synchronous,!0),promise=null)}function progressFromThenable(value){promise&&"function"==typeof promise._progress&&promise._progress(value)}var promise=new Promise(INTERNAL),ret=promise;context&&context._pushContext(),promise._captureStackTrace(),context&&context._popContext();var synchronous=!0,result=util.tryCatch(then).call(x,resolveFromThenable,rejectFromThenable,progressFromThenable);return synchronous=!1,promise&&result===errorObj&&(promise._rejectCallback(result.e,!0,!0),promise=null),ret}var util=_dereq_("./util.js"),errorObj=util.errorObj,isObject=util.isObject,hasProp={}.hasOwnProperty;return tryConvertToPromise}},{"./util.js":38}],36:[function(_dereq_,module){"use strict";module.exports=function(Promise,INTERNAL){function successClear(value){var handle=this;return handle instanceof Number&&(handle=+handle),clearTimeout(handle),value}function failureClear(reason){var handle=this;throw handle instanceof Number&&(handle=+handle),clearTimeout(handle),reason}var util=_dereq_("./util.js"),TimeoutError=Promise.TimeoutError,afterTimeout=function(promise,message){if(promise.isPending()){"string"!=typeof message&&(message="operation timed out");var err=new TimeoutError(message);util.markAsOriginatingFromRejection(err),promise._attachExtraTrace(err),promise._cancel(err)}},afterValue=function(value){return delay(+this).thenReturn(value)},delay=Promise.delay=function(value,ms){if(void 0===ms){ms=value,value=void 0;var ret=new Promise(INTERNAL);return setTimeout(function(){ret._fulfill()},ms),ret}return ms=+ms,Promise.resolve(value)._then(afterValue,null,null,ms,void 0)};Promise.prototype.delay=function(ms){return delay(this,ms)},Promise.prototype.timeout=function(ms,message){ms=+ms;var ret=this.then().cancellable();ret._cancellationParent=this;var handle=setTimeout(function(){afterTimeout(ret,message)},ms);return ret._then(successClear,failureClear,void 0,handle,void 0)}}},{"./util.js":38}],37:[function(_dereq_,module){"use strict";module.exports=function(Promise,apiRejection,tryConvertToPromise,createContext){function inspectionMapper(inspections){for(var len=inspections.length,i=0;len>i;++i){var inspection=inspections[i];if(inspection.isRejected())return Promise.reject(inspection.error());inspections[i]=inspection._settledValue}return inspections}function thrower(e){setTimeout(function(){throw e},0)}function castPreservingDisposable(thenable){var maybePromise=tryConvertToPromise(thenable);return maybePromise!==thenable&&"function"==typeof thenable._isDisposable&&"function"==typeof thenable._getDisposer&&thenable._isDisposable()&&maybePromise._setDisposable(thenable._getDisposer()),maybePromise}function dispose(resources,inspection){function iterator(){if(i>=len)return ret.resolve();var maybePromise=castPreservingDisposable(resources[i++]);if(maybePromise instanceof Promise&&maybePromise._isDisposable()){try{maybePromise=tryConvertToPromise(maybePromise._getDisposer().tryDispose(inspection),resources.promise)}catch(e){return thrower(e)}if(maybePromise instanceof Promise)return maybePromise._then(iterator,thrower,null,null,null)}iterator()}var i=0,len=resources.length,ret=Promise.defer();return iterator(),ret.promise}function disposerSuccess(value){var inspection=new PromiseInspection;return inspection._settledValue=value,inspection._bitField=268435456,dispose(this,inspection).thenReturn(value)}function disposerFail(reason){var inspection=new PromiseInspection;return inspection._settledValue=reason,inspection._bitField=134217728,dispose(this,inspection).thenThrow(reason)}function Disposer(data,promise,context){this._data=data,this._promise=promise,this._context=context}function FunctionDisposer(fn,promise,context){this.constructor$(fn,promise,context)}function maybeUnwrapDisposer(value){return Disposer.isDisposer(value)?(this.resources[this.index]._setDisposable(value),value.promise()):value}var TypeError=_dereq_("./errors.js").TypeError,inherits=_dereq_("./util.js").inherits,PromiseInspection=Promise.PromiseInspection;Disposer.prototype.data=function(){return this._data},Disposer.prototype.promise=function(){return this._promise},Disposer.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},Disposer.prototype.tryDispose=function(inspection){var resource=this.resource(),context=this._context;void 0!==context&&context._pushContext();var ret=null!==resource?this.doDispose(resource,inspection):null;return void 0!==context&&context._popContext(),this._promise._unsetDisposable(),this._data=null,ret},Disposer.isDisposer=function(d){return null!=d&&"function"==typeof d.resource&&"function"==typeof d.tryDispose},inherits(FunctionDisposer,Disposer),FunctionDisposer.prototype.doDispose=function(resource,inspection){var fn=this.data();return fn.call(resource,resource,inspection)},Promise.using=function(){var len=arguments.length;if(2>len)return apiRejection("you must pass at least 2 arguments to Promise.using");var fn=arguments[len-1];if("function"!=typeof fn)return apiRejection("fn must be a function\n\n See http://goo.gl/916lJJ\n");len--;for(var resources=new Array(len),i=0;len>i;++i){var resource=arguments[i];if(Disposer.isDisposer(resource)){var disposer=resource;resource=resource.promise(),resource._setDisposable(disposer)}else{var maybePromise=tryConvertToPromise(resource);maybePromise instanceof Promise&&(resource=maybePromise._then(maybeUnwrapDisposer,null,null,{resources:resources,index:i},void 0))}resources[i]=resource}var promise=Promise.settle(resources).then(inspectionMapper).then(function(vals){promise._pushContext();var ret;try{ret=fn.apply(void 0,vals)}finally{promise._popContext()}return ret})._then(disposerSuccess,disposerFail,void 0,resources,void 0);return resources.promise=promise,promise},Promise.prototype._setDisposable=function(disposer){this._bitField=262144|this._bitField,this._disposer=disposer},Promise.prototype._isDisposable=function(){return(262144&this._bitField)>0},Promise.prototype._getDisposer=function(){return this._disposer},Promise.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},Promise.prototype.disposer=function(fn){if("function"==typeof fn)return new FunctionDisposer(fn,this,createContext());throw new TypeError}}},{"./errors.js":13,"./util.js":38}],38:[function(_dereq_,module,exports){"use strict";function tryCatcher(){try{return tryCatchTarget.apply(this,arguments)}catch(e){return errorObj.e=e,errorObj}}function tryCatch(fn){return tryCatchTarget=fn,tryCatcher}function isPrimitive(val){return null==val||val===!0||val===!1||"string"==typeof val||"number"==typeof val}function isObject(value){return!isPrimitive(value)}function maybeWrapAsError(maybeError){return isPrimitive(maybeError)?new Error(safeToString(maybeError)):maybeError}function withAppended(target,appendee){var i,len=target.length,ret=new Array(len+1);for(i=0;len>i;++i)ret[i]=target[i];return ret[i]=appendee,ret}function getDataPropertyOrDefault(obj,key,defaultValue){if(!es5.isES5)return{}.hasOwnProperty.call(obj,key)?obj[key]:void 0;var desc=Object.getOwnPropertyDescriptor(obj,key); -return null!=desc?null==desc.get&&null==desc.set?desc.value:defaultValue:void 0}function notEnumerableProp(obj,name,value){if(isPrimitive(obj))return obj;var descriptor={value:value,configurable:!0,enumerable:!1,writable:!0};return es5.defineProperty(obj,name,descriptor),obj}function thrower(r){throw r}function isClass(fn){try{if("function"==typeof fn){var keys=es5.names(fn.prototype);if(es5.isES5&&keys.length>1||keys.length>0&&(1!==keys.length||"constructor"!==keys[0])||thisAssignmentPattern.test(fn+""))return!0}return!1}catch(e){return!1}}function toFastProperties(obj){function f(){}f.prototype=obj;for(var l=8;l--;)new f;return obj}function isIdentifier(str){return rident.test(str)}function filledRange(count,prefix,suffix){for(var ret=new Array(count),i=0;count>i;++i)ret[i]=prefix+i+suffix;return ret}function safeToString(obj){try{return obj+""}catch(e){return"[no string representation]"}}function markAsOriginatingFromRejection(e){try{notEnumerableProp(e,"isOperational",!0)}catch(ignore){}}function originatesFromRejection(e){return null==e?!1:e instanceof Error.__BluebirdErrorTypes__.OperationalError||e.isOperational===!0}function canAttachTrace(obj){return obj instanceof Error&&es5.propertyIsWritable(obj,"stack")}function classString(obj){return{}.toString.call(obj)}function copyDescriptors(from,to,filter){for(var keys=es5.names(from),i=0;i10||version[0]>0}();try{throw new Error}catch(e){ret.lastLineError=e}module.exports=ret},{"./es5.js":14}],39:[function(_dereq_,module){function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(arg){return"function"==typeof arg}function isNumber(arg){return"number"==typeof arg}function isObject(arg){return"object"==typeof arg&&null!==arg}function isUndefined(arg){return void 0===arg}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||0>n||isNaN(n))throw TypeError("n must be a positive number");return this._maxListeners=n,this},EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(this._events||(this._events={}),"error"===type&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if(er=arguments[1],er instanceof Error)throw er;throw TypeError('Uncaught, unspecified "error" event.')}if(handler=this._events[type],isUndefined(handler))return!1;if(isFunction(handler))switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:for(len=arguments.length,args=new Array(len-1),i=1;len>i;i++)args[i-1]=arguments[i];handler.apply(this,args)}else if(isObject(handler)){for(len=arguments.length,args=new Array(len-1),i=1;len>i;i++)args[i-1]=arguments[i];for(listeners=handler.slice(),len=listeners.length,i=0;len>i;i++)listeners[i].apply(this,args)}return!0},EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener),this._events[type]?isObject(this._events[type])?this._events[type].push(listener):this._events[type]=[this._events[type],listener]:this._events[type]=listener,isObject(this._events[type])&&!this._events[type].warned){var m;m=isUndefined(this._maxListeners)?EventEmitter.defaultMaxListeners:this._maxListeners,m&&m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),"function"==typeof console.trace&&console.trace())}return this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(type,listener){function g(){this.removeListener(type,g),fired||(fired=!0,listener.apply(this,arguments))}if(!isFunction(listener))throw TypeError("listener must be a function");var fired=!1;return g.listener=listener,this.on(type,g),this},EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;if(list=this._events[type],length=list.length,position=-1,list===listener||isFunction(list.listener)&&list.listener===listener)delete this._events[type],this._events.removeListener&&this.emit("removeListener",type,listener);else if(isObject(list)){for(i=length;i-->0;)if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}if(0>position)return this;1===list.length?(list.length=0,delete this._events[type]):list.splice(position,1),this._events.removeListener&&this.emit("removeListener",type,listener)}return this},EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[type]&&delete this._events[type],this;if(0===arguments.length){for(key in this._events)"removeListener"!==key&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events={},this}if(listeners=this._events[type],isFunction(listeners))this.removeListener(type,listeners);else for(;listeners.length;)this.removeListener(type,listeners[listeners.length-1]);return delete this._events[type],this},EventEmitter.prototype.listeners=function(type){var ret;return ret=this._events&&this._events[type]?isFunction(this._events[type])?[this._events[type]]:this._events[type].slice():[]},EventEmitter.listenerCount=function(emitter,type){var ret;return ret=emitter._events&&emitter._events[type]?isFunction(emitter._events[type])?1:emitter._events[type].length:0}},{}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise),function(global,factory){"object"==typeof module&&"object"==typeof module.exports?module.exports=global.document?factory(global,!0):function(w){if(!w.document)throw new Error("jQuery requires a window with a document");return factory(w)}:factory(global)}("undefined"!=typeof window?window:this,function(window,noGlobal){function isArraylike(obj){var length="length"in obj&&obj.length,type=jQuery.type(obj);return"function"===type||jQuery.isWindow(obj)?!1:1===obj.nodeType&&length?!0:"array"===type||0===length||"number"==typeof length&&length>0&&length-1 in obj}function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier))return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not});if(qualifier.nodeType)return jQuery.grep(elements,function(elem){return elem===qualifier!==not});if("string"==typeof qualifier){if(risSimple.test(qualifier))return jQuery.filter(qualifier,elements,not);qualifier=jQuery.filter(qualifier,elements)}return jQuery.grep(elements,function(elem){return indexOf.call(qualifier,elem)>=0!==not})}function sibling(cur,dir){for(;(cur=cur[dir])&&1!==cur.nodeType;);return cur}function createOptions(options){var object=optionsCache[options]={};return jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function completed(){document.removeEventListener("DOMContentLoaded",completed,!1),window.removeEventListener("load",completed,!1),jQuery.ready()}function Data(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=jQuery.expando+Data.uid++}function dataAttr(elem,key,data){var name;if(void 0===data&&1===elem.nodeType)if(name="data-"+key.replace(rmultiDash,"-$1").toLowerCase(),data=elem.getAttribute(name),"string"==typeof data){try{data="true"===data?!0:"false"===data?!1:"null"===data?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data}catch(e){}data_user.set(elem,key,data)}else data=void 0;return data}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(err){}}function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(11!==content.nodeType?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody")):elem}function disableScript(elem){return elem.type=(null!==elem.getAttribute("type"))+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function setGlobalEval(elems,refElements){for(var i=0,l=elems.length;l>i;i++)data_priv.set(elems[i],"globalEval",!refElements||data_priv.get(refElements[i],"globalEval"))}function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(1===dest.nodeType){if(data_priv.hasData(src)&&(pdataOld=data_priv.access(src),pdataCur=data_priv.set(dest,pdataOld),events=pdataOld.events)){delete pdataCur.handle,pdataCur.events={};for(type in events)for(i=0,l=events[type].length;l>i;i++)jQuery.event.add(dest,type,events[type][i])}data_user.hasData(src)&&(udataOld=data_user.access(src),udataCur=jQuery.extend({},udataOld),data_user.set(dest,udataCur))}}function getAll(context,tag){var ret=context.getElementsByTagName?context.getElementsByTagName(tag||"*"):context.querySelectorAll?context.querySelectorAll(tag||"*"):[];return void 0===tag||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],ret):ret}function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();"input"===nodeName&&rcheckableType.test(src.type)?dest.checked=src.checked:("input"===nodeName||"textarea"===nodeName)&&(dest.defaultValue=src.defaultValue)}function actualDisplay(name,doc){var style,elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=window.getDefaultComputedStyle&&(style=window.getDefaultComputedStyle(elem[0]))?style.display:jQuery.css(elem[0],"display");return elem.detach(),display}function defaultDisplay(nodeName){var doc=document,display=elemdisplay[nodeName];return display||(display=actualDisplay(nodeName,doc),"none"!==display&&display||(iframe=(iframe||jQuery("'),"after"==options.previewPosition?iFrame.insertAfter(footer):iFrame.insertBefore(header),previewWindow=iFrame[iFrame.length-1].contentWindow||frame[iFrame.length-1]):altKey===!0&&(iFrame?iFrame.remove():previewWindow.close(),previewWindow=iFrame=!1),options.previewAutoRefresh||refreshPreview(),options.previewInWindow&&previewWindow.focus()}function refreshPreview(){renderPreview()}function renderPreview(){if(options.previewHandler&&"function"==typeof options.previewHandler)options.previewHandler($$.val());else if(options.previewParser&&"function"==typeof options.previewParser){var data=options.previewParser($$.val());writeInPreview(localize(data,1))}else""!==options.previewParserPath?$.ajax({type:"POST",dataType:"text",global:!1,url:options.previewParserPath,data:options.previewParserVar+"="+encodeURIComponent($$.val()),success:function(data){writeInPreview(localize(data,1))}}):template||$.ajax({url:options.previewTemplatePath,dataType:"text",global:!1,success:function(data){writeInPreview(localize(data,1).replace(//g,$$.val()))}});return!1}function writeInPreview(data){if(options.previewInElement)$(options.previewInElement).html(data);else if(previewWindow&&previewWindow.document){try{sp=previewWindow.document.documentElement.scrollTop}catch(e){sp=0}previewWindow.document.open(),previewWindow.document.write(data),previewWindow.document.close(),previewWindow.document.documentElement.scrollTop=sp}}function keyPressed(e){if(shiftKey=e.shiftKey,altKey=e.altKey,ctrlKey=e.altKey&&e.ctrlKey?!1:e.ctrlKey||e.metaKey,"keydown"===e.type){if(ctrlKey===!0&&(li=$('a[accesskey="'+(13==e.keyCode?"\\n":String.fromCharCode(e.keyCode))+'"]',header).parent("li"),0!==li.length))return ctrlKey=!1,setTimeout(function(){li.triggerHandler("mouseup")},1),!1;if(13===e.keyCode||10===e.keyCode)return ctrlKey===!0?(ctrlKey=!1,markup(options.onCtrlEnter),options.onCtrlEnter.keepDefault):shiftKey===!0?(shiftKey=!1,markup(options.onShiftEnter),options.onShiftEnter.keepDefault):(markup(options.onEnter),options.onEnter.keepDefault);if(9===e.keyCode)return 1==shiftKey||1==ctrlKey||1==altKey?!1:-1!==caretOffset?(get(),caretOffset=$$.val().length-caretOffset,set(caretOffset,0),caretOffset=-1,!1):(markup(options.onTab),options.onTab.keepDefault)}}function remove(){$$.unbind(".markItUp").removeClass("markItUpEditor"),$$.parent("div").parent("div.markItUp").parent("div").replaceWith($$),$$.data("markItUp",null)}var $$,textarea,levels,scrollPosition,caretPosition,caretOffset,clicked,hash,header,footer,previewWindow,template,iFrame,abort;if($$=$(this),textarea=this,levels=[],abort=!1,scrollPosition=caretPosition=0,caretOffset=-1,options.previewParserPath=localize(options.previewParserPath),options.previewTemplatePath=localize(options.previewTemplatePath),method)switch(method){case"remove":remove();break;case"insert":markup(params);break;default:$.error("Method "+method+" does not exist on jQuery.markItUp")}else init()})},$.fn.markItUpRemove=function(){return this.each(function(){$(this).markItUp("remove")})},$.markItUp=function(settings){var options={target:!1};return $.extend(options,settings),options.target?$(options.target).each(function(){$(this).focus(),$(this).trigger("insertion",[options])}):void $("textarea").trigger("insertion",[options])}}(jQuery),!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),!function(e){"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var o="function"==typeof define&&define.amd,a="undefined"!=typeof module&&module.exports,n="https:"==document.location.protocol?"https:":"http:",i="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js";o||(a?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+n+"//"+i+"%3E%3C/script%3E"))),t()}(function(){var t,o="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",i={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||n,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":p(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),h(t),e(o).each(function(){var o=e(this);if(!o.data(a)){o.data(a,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null});var n=o.data(a),i=n.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),e("#mCSB_"+n.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var n=t||f.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!r.length)return;n.tweenRunning&&V(t),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),S.call(this),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r.children())),n.overflowed=B.call(this),O.call(this),i.autoDraggerLength&&b.call(this),C.call(this),k.call(this);var s=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(n.overflowed[0]?l[0].height()>l[0].parent().height()?T.call(this):(Q(t,s[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(T.call(this),"y"===i.axis?M.call(this):"yx"===i.axis&&n.overflowed[1]&&Q(t,s[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(n.overflowed[1]?l[1].width()>l[1].parent().width()?T.call(this):(Q(t,s[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(T.call(this),"x"===i.axis?M.call(this):"yx"===i.axis&&n.overflowed[0]&&Q(t,s[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&n&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),X.call(this)}})},scrollTo:function(t,o){if("undefined"!=typeof t&&null!=t){var n=f.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=Y.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=j.call(this,c[0],"y"),c[1]=j.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",Q(n,c[0].toString(),s)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",Q(n,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&V(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);o.data(a)&&(o.data(a),X.call(this,"remove"),M.call(this),t&&T.call(this),O.call(this,!0),o.addClass(d[3]))})},destroy:function(){var t=f.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),X.call(this,"remove"),M.call(this),T.call(this),n.removeData(a),Z(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),n.removeClass(o+" _"+a+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},h=function(t){var o=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],a=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],n=["minimal","minimal-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,o)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,a)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,n)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,i)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,r)>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),Z(l,e))},p=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),n=t.data(a),i=n.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["
","
"],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"
":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===n.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===n.langDir?"989999px":i.setLeft,t.addClass(o+" _"+a+"_"+n.idx+f+h).wrapInner("
");var m=e("#mCSB_"+n.idx),p=e("#mCSB_"+n.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p.children())),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){return Math.max.apply(Math,t.map(function(){return e(this).outerWidth(!0)}).get())},_=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx+"_container");n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis&&i.css({position:"absolute",width:"auto"}).wrap("
").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),position:"relative"}).unwrap()},w=function(){var t=e(this),o=t.data(a),n=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=tt(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",l=["","","",""],s=["x"===n.axis?l[2]:l[0],"x"===n.axis?l[3]:l[1],l[2],l[3]];n.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=t.css("max-height")||"none",r=-1!==i.indexOf("%"),l=t.css("box-sizing");if("none"!==i){var s=r?t.parent().height()*parseInt(i)/100:parseInt(i);"border-box"===l&&(s-=t.innerHeight()-t.height()+(t.outerHeight()-t.innerHeight())),n.css("max-height",Math.round(s))}},b=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[n.height()/i.outerHeight(!1),n.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]n.height(),l>n.width()]},T=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(V(t),("x"!==n.axis&&!o.overflowed[0]||"y"===n.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),Q(t,"_resetY")),"y"!==n.axis&&!o.overflowed[1]||"x"===n.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),Q(t,"_resetX")}},k=function(){function t(){r=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(r),W.call(o[0])):t()},100)}var o=e(this),n=o.data(a),i=n.opt;if(!n.bindEvents){if(R.call(this),i.contentTouchScroll&&E.call(this),D.call(this),i.mouseWheel.enable){var r;t()}P.call(this),H.call(this),i.advanced.autoScrollOnFocus&&z.call(this),i.scrollButtons.enable&&U.call(this),i.keyboard.enable&&q.call(this),n.bindEvents=!0}},M=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(e(n.advanced.releaseDraggableSelectors)),o.bindEvents&&(e(document).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),Z(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),Z(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),Z(s[0],"onCompleteTimeout"),o.bindEvents=!1)},O=function(t){var o=e(this),n=o.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(n.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(n.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),n.overflowed[0]||n.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},I=function(e){var t=e.type;switch(t){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return e.target.ownerDocument!==document?[e.originalEvent.screenY,e.originalEvent.screenX,!1]:[e.originalEvent.pageY,e.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var o=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],a=e.originalEvent.touches.length||e.originalEvent.changedTouches.length;return e.target.ownerDocument!==document?[o.screenY,o.screenX,a>1]:[o.pageY,o.pageX,a>1];default:return[e.pageY,e.pageX,!1]}},R=function(){function t(e){var t=m.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}}function o(e,t,o,a){if(m[0].idleTimer=u.scrollInertia<233?250:0,n.attr("id")===h[1])var i="x",r=(n[0].offsetLeft-t+a)*d.scrollRatio.x;else var i="y",r=(n[0].offsetTop-e+o)*d.scrollRatio.y;Q(l,r.toString(),{dir:i,drag:!0})}var n,i,r,l=e(this),d=l.data(a),u=d.opt,f=a+"_"+d.idx,h=["mCSB_"+d.idx+"_dragger_vertical","mCSB_"+d.idx+"_dragger_horizontal"],m=e("#mCSB_"+d.idx+"_container"),p=e("#"+h[0]+",#"+h[1]),g=u.advanced.releaseDraggableSelectors?p.add(e(u.advanced.releaseDraggableSelectors)):p; -p.bind("mousedown."+f+" touchstart."+f+" pointerdown."+f+" MSPointerDown."+f,function(o){if(o.stopImmediatePropagation(),o.preventDefault(),$(o)){c=!0,s&&(document.onselectstart=function(){return!1}),t(!1),V(l),n=e(this);var a=n.offset(),d=I(o)[0]-a.top,f=I(o)[1]-a.left,h=n.height()+a.top,m=n.width()+a.left;h>d&&d>0&&m>f&&f>0&&(i=d,r=f),y(n,"active",u.autoExpandScrollbar)}}).bind("touchmove."+f,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=n.offset(),a=I(e)[0]-t.top,l=I(e)[1]-t.left;o(i,r,a,l)}),e(document).bind("mousemove."+f+" pointermove."+f+" MSPointerMove."+f,function(e){if(n){var t=n.offset(),a=I(e)[0]-t.top,l=I(e)[1]-t.left;if(i===a)return;o(i,r,a,l)}}).add(g).bind("mouseup."+f+" touchend."+f+" pointerup."+f+" MSPointerUp."+f,function(){n&&(y(n,"active",u.autoExpandScrollbar),n=null),c=!1,s&&(document.onselectstart=null),t(!0)})},E=function(){function o(e){if(!et(e)||c||I(e)[2])return void(t=0);t=1,S=0,b=0;var o=M.offset();d=I(e)[0]-o.top,u=I(e)[1]-o.left,A=[I(e)[0],I(e)[1]]}function n(e){if(et(e)&&!c&&!I(e)[2]&&(e.stopImmediatePropagation(),!b||S)){p=J();var t=k.offset(),o=I(e)[0]-t.top,a=I(e)[1]-t.left,n="mcsLinearOut";if(R.push(o),E.push(a),A[2]=Math.abs(I(e)[0]-A[0]),A[3]=Math.abs(I(e)[1]-A[1]),y.overflowed[0])var i=O[0].parent().height()-O[0].height(),r=d-o>0&&o-d>-(i*y.scrollRatio.y)&&(2*A[3]0&&a-u>-(l*y.scrollRatio.x)&&(2*A[2]30)){x=1e3/(g-m);var n="mcsEaseOut",i=2.5>x,r=i?[R[R.length-2],E[E.length-2]]:[0,0];v=i?[o-r[0],a-r[1]]:[o-f,a-h];var d=[Math.abs(v[0]),Math.abs(v[1])];x=i?[Math.abs(v[0]/4),Math.abs(v[1]/4)]:[x,x];var u=[Math.abs(M[0].offsetTop)-v[0]*l(d[0]/x[0],x[0]),Math.abs(M[0].offsetLeft)-v[1]*l(d[1]/x[1],x[1])];_="yx"===B.axis?[u[0],u[1]]:"x"===B.axis?[null,u[1]]:[u[0],null],w=[4*d[0]+B.scrollInertia,4*d[1]+B.scrollInertia];var C=parseInt(B.contentTouchScroll)||0;_[0]=d[0]>C?_[0]:0,_[1]=d[1]>C?_[1]:0,y.overflowed[0]&&s(_[0],w[0],n,"y",W,!1),y.overflowed[1]&&s(_[1],w[1],n,"x",W,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,a,n,i){e&&Q(C,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C=e(this),y=C.data(a),B=y.opt,T=a+"_"+y.idx,k=e("#mCSB_"+y.idx),M=e("#mCSB_"+y.idx+"_container"),O=[e("#mCSB_"+y.idx+"_dragger_vertical"),e("#mCSB_"+y.idx+"_dragger_horizontal")],R=[],E=[],D=0,W="yx"===B.axis?"none":"all",A=[],P=M.find("iframe"),z=["touchstart."+T+" pointerdown."+T+" MSPointerDown."+T,"touchmove."+T+" pointermove."+T+" MSPointerMove."+T,"touchend."+T+" pointerup."+T+" MSPointerUp."+T];M.bind(z[0],function(e){o(e)}).bind(z[1],function(e){n(e)}),k.bind(z[0],function(e){i(e)}).bind(z[2],function(e){r(e)}),P.length&&P.each(function(){e(this).load(function(){L(this)&&e(this.contentDocument||this.contentWindow.document).bind(z[0],function(e){o(e),i(e)}).bind(z[1],function(e){n(e)}).bind(z[2],function(e){r(e)})})})},D=function(){function o(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function n(e,t,o){d.type=o&&i?"stepped":"stepless",d.scrollAmount=10,F(r,e,t,"mcsLinearOut",o?60:null)}var i,r=e(this),l=r.data(a),s=l.opt,d=l.sequential,u=a+"_"+l.idx,f=e("#mCSB_"+l.idx+"_container"),h=f.parent();f.bind("mousedown."+u,function(){t||i||(i=1,c=!0)}).add(document).bind("mousemove."+u,function(e){if(!t&&i&&o()){var a=f.offset(),r=I(e)[0]-a.top+f[0].offsetTop,c=I(e)[1]-a.left+f[0].offsetLeft;r>0&&r0&&cr?n("on",38):r>h.height()&&n("on",40)),"y"!==s.axis&&l.overflowed[1]&&(0>c?n("on",37):c>h.width()&&n("on",39)))}}).bind("mouseup."+u,function(){t||(i&&(i=0,n("off",null)),c=!1)})},W=function(){function t(t,a){if(V(o),!A(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100;if("x"===i.axis||"x"===i.mouseWheel.axis)var d="x",u=[Math.round(r*n.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],f="auto"!==i.mouseWheel.scrollAmount?u[1]:u[0]>=l.width()?.9*l.width():u[0],h=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),m=c[1][0].offsetLeft,p=c[1].parent().width()-c[1].width(),g=t.deltaX||t.deltaY||a;else var d="y",u=[Math.round(r*n.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],f="auto"!==i.mouseWheel.scrollAmount?u[1]:u[0]>=l.height()?.9*l.height():u[0],h=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),m=c[0][0].offsetTop,p=c[0].parent().height()-c[0].height(),g=t.deltaY||a;"y"===d&&!n.overflowed[0]||"x"===d&&!n.overflowed[1]||(i.mouseWheel.invert&&(g=-g),i.mouseWheel.normalizeDelta&&(g=0>g?-1:1),(g>0&&0!==m||0>g&&m!==p||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),Q(o,(h-g*f).toString(),{dir:d}))}}var o=e(this),n=o.data(a),i=n.opt,r=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],d=e("#mCSB_"+n.idx+"_container").find("iframe");n&&(d.length&&d.each(function(){e(this).load(function(){L(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)}))},L=function(e){var t=null;try{var o=e.contentDocument||e.contentWindow.document;t=o.body.innerHTML}catch(a){}return null!==t},A=function(t,o){var n=o.nodeName.toLowerCase(),i=t.data(a).opt.mouseWheel.disableOver,r=["select","textarea"];return e.inArray(n,i)>-1&&!(e.inArray(n,r)>-1&&!e(o).is(":focus"))},P=function(){var t=e(this),o=t.data(a),n=a+"_"+o.idx,i=e("#mCSB_"+o.idx+"_container"),r=i.parent(),l=e(".mCSB_"+o.idx+"_scrollbar ."+d[12]);l.bind("touchstart."+n+" pointerdown."+n+" MSPointerDown."+n,function(){c=!0}).bind("touchend."+n+" pointerup."+n+" MSPointerUp."+n,function(){c=!1}).bind("click."+n,function(a){if(e(a.target).hasClass(d[12])||e(a.target).hasClass("mCSB_draggerRail")){V(t);var n=e(this),l=n.find(".mCSB_dragger");if(n.parent(".mCSB_scrollTools_horizontal").length>0){if(!o.overflowed[1])return;var s="x",c=a.pageX>l.offset().left?-1:1,u=Math.abs(i[0].offsetLeft)-.9*c*r.width()}else{if(!o.overflowed[0])return;var s="y",c=a.pageY>l.offset().top?-1:1,u=Math.abs(i[0].offsetTop)-.9*c*r.height()}Q(t,u.toString(),{dir:s,scrollEasing:"mcsEaseInOut"})}})},z=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(){var o=e(document.activeElement),a=r.find(".mCustomScrollBox").length,i=0;o.is(n.advanced.autoScrollOnFocus)&&(V(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=a?(i+17)*a:0,t[0]._focusTimeout=setTimeout(function(){var e=[ot(o)[0],ot(o)[1]],a=[r[0].offsetTop,r[0].offsetLeft],s=[a[0]+e[0]>=0&&a[0]+e[0]=0&&a[0]+e[1]a");s.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(a){function r(e,o){i.scrollAmount=n.snapAmount||n.scrollButtons.scrollAmount,F(t,e,o)}if(a.preventDefault(),$(a)){var l=e(this).attr("class");switch(i.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.type)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},q=function(){function t(t){function a(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.snapAmount||i.keyboard.scrollAmount,"stepped"===r.type&&n.tweenRunning||F(o,e,t)}switch(t.type){case"blur":n.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),a(s,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){V(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-.9*f*d.width();else var h="y",m=Math.abs(c[0].offsetTop)-.9*f*d.height();Q(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;Q(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),n=o.data(a),i=n.opt,r=n.sequential,l=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).load(function(){L(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},F=function(t,o,n,i,r){function l(e){var o="stepped"!==f.type,a=r?r:e?o?p/1.5:g:1e3/60,n=e?o?7.5:40:2.5,s=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],d=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],u="x"===f.dir[0]?s[1]+f.dir[1]*d[1]*n:s[0]+f.dir[1]*d[0]*n,m="x"===f.dir[0]?s[1]+f.dir[1]*parseInt(f.scrollAmount):s[0]+f.dir[1]*parseInt(f.scrollAmount),v="auto"!==f.scrollAmount?m:u,x=i?i:e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",_=e?!0:!1;return e&&17>a&&(v="x"===f.dir[0]?s[1]:s[0]),Q(t,v.toString(),{dir:f.dir[0],scrollEasing:x,dur:a,onComplete:_}),e?void(f.dir=!1):(clearTimeout(f.step),void(f.step=setTimeout(function(){l()},a)))}function s(){clearTimeout(f.step),Z(f,"step"),V(t)}var c=t.data(a),u=c.opt,f=c.sequential,h=e("#mCSB_"+c.idx+"_container"),m="stepped"===f.type?!0:!1,p=u.scrollInertia<26?26:u.scrollInertia,g=u.scrollInertia<1?17:u.scrollInertia;switch(o){case"on":if(f.dir=[n===d[16]||n===d[15]||39===n||37===n?"x":"y",n===d[13]||n===d[15]||38===n||37===n?-1:1],V(t),tt(n)&&"stepped"===f.type)return;l(m);break;case"off":s(),(m||c.tweenRunning&&f.dir)&&l(!0)}},Y=function(t){var o=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===o.axis?null:t,n[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},j=function(t,o){if(null!=t&&"undefined"!=typeof t){var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1):l.outerHeight(!1),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?ot(m)[1]:ot(m)[0];case"string":case"number":if(tt(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&tt(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?ot(m)[1]:ot(m)[0]}return e(t).length?"x"===o?ot(e(t))[1]:ot(e(t))[0]:(l.css(h,t),void u.update.call(null,n[0]))}}},X=function(t){function o(){clearTimeout(h[0].autoUpdate),h[0].autoUpdate=setTimeout(function(){return f.advanced.updateOnSelectorChange&&(m=r(),m!==w)?(l(3),void(w=m)):(f.advanced.updateOnContentResize&&(p=[h.outerHeight(!1),h.outerWidth(!1),v.height(),v.width(),_()[0],_()[1]],(p[0]!==S[0]||p[1]!==S[1]||p[2]!==S[2]||p[3]!==S[3]||p[4]!==S[4]||p[5]!==S[5])&&(l(p[0]!==S[0]||p[1]!==S[1]),S=p)),f.advanced.updateOnImageLoad&&(g=n(),g!==b&&(h.find("img").each(function(){i(this)}),b=g)),void((f.advanced.updateOnSelectorChange||f.advanced.updateOnContentResize||f.advanced.updateOnImageLoad)&&o()))},60)}function n(){var e=0;return f.advanced.updateOnImageLoad&&(e=h.find("img").length),e}function i(t){function o(e,t){return function(){return t.apply(e,arguments)}}function a(){this.onload=null,e(t).addClass(d[2]),l(2)}if(e(t).hasClass(d[2]))return void l();var n=new Image;n.onload=o(n,a),n.src=t.src}function r(){f.advanced.updateOnSelectorChange===!0&&(f.advanced.updateOnSelectorChange="*");var t=0,o=h.find(f.advanced.updateOnSelectorChange);return f.advanced.updateOnSelectorChange&&o.length>0&&o.each(function(){t+=e(this).height()+e(this).width()}),t}function l(e){clearTimeout(h[0].autoUpdate),u.update.call(null,s[0],e)}var s=e(this),c=s.data(a),f=c.opt,h=e("#mCSB_"+c.idx+"_container");if(t)return clearTimeout(h[0].autoUpdate),void Z(h[0],"autoUpdate");var m,p,g,v=h.parent(),x=[e("#mCSB_"+c.idx+"_scrollbar_vertical"),e("#mCSB_"+c.idx+"_scrollbar_horizontal")],_=function(){return[x[0].is(":visible")?x[0].outerHeight(!0):0,x[1].is(":visible")?x[1].outerWidth(!0):0]},w=r(),S=[h.outerHeight(!1),h.outerWidth(!1),v.height(),v.width(),_()[0],_()[1]],b=n();o()},N=function(e,t,o){return Math.round(e/t)*t-o},V=function(t){var o=t.data(a),n=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");n.each(function(){K.call(this)})},Q=function(t,o,n){function i(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function r(){return[c.callbacks.alwaysTriggerOffsets||_>=w[0]+b,c.callbacks.alwaysTriggerOffsets||-C>=_]}function l(){var e=[h[0].offsetTop,h[0].offsetLeft],o=[v[0].offsetTop,v[0].offsetLeft],a=[h.outerHeight(!1),h.outerWidth(!1)],i=[f.height(),f.width()];t[0].mcs={content:h,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(a[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-i[1])),direction:n.dir}}var s=t.data(a),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(d,n),u=[n.dur,n.drag?0:n.dur],f=e("#mCSB_"+s.idx),h=e("#mCSB_"+s.idx+"_container"),m=h.parent(),p=c.callbacks.onTotalScrollOffset?Y.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?Y.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(s.trigger=n.trigger,(0!==m.scrollTop()||0!==m.scrollLeft())&&(e(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==o||s.contentReset.y||(i("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),s.contentReset.y=1),"_resetX"!==o||s.contentReset.x||(i("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),s.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){switch(!s.contentReset.y&&t[0].mcs||!s.overflowed[0]||(i("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),s.contentReset.x=null),!s.contentReset.x&&t[0].mcs||!s.overflowed[1]||(i("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),s.contentReset.x=null),c.snapAmount&&(o=N(o,c.snapAmount,c.snapOffset)),n.dir){case"x":var v=e("#mCSB_"+s.idx+"_dragger_horizontal"),x="left",_=h[0].offsetLeft,w=[f.width()-h.outerWidth(!1),v.parent().width()-v.width()],S=[o,0===o?0:o/s.scrollRatio.x],b=p[1],C=g[1],B=b>0?b/s.scrollRatio.x:0,T=C>0?C/s.scrollRatio.x:0;break;case"y":var v=e("#mCSB_"+s.idx+"_dragger_vertical"),x="top",_=h[0].offsetTop,w=[f.height()-h.outerHeight(!1),v.parent().height()-v.height()],S=[o,0===o?0:o/s.scrollRatio.y],b=p[0],C=g[0],B=b>0?b/s.scrollRatio.y:0,T=C>0?C/s.scrollRatio.y:0}S[1]<0||0===S[0]&&0===S[1]?S=[0,0]:S[1]>=w[1]?S=[w[0],w[1]]:S[0]=-S[0],t[0].mcs||(l(),i("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(h[0].onCompleteTimeout),(s.tweenRunning||!(0===_&&S[0]>=0||_===w[0]&&S[0]<=w[0]))&&(G(v[0],x,Math.round(S[1]),u[1],n.scrollEasing),G(h[0],x,Math.round(S[0]),u[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!s.tweenRunning&&(i("onScrollStart")&&(l(),c.callbacks.onScrollStart.call(t[0])),s.tweenRunning=!0,y(v),s.cbOffsets=r())},onUpdate:function(){n.callbacks&&n.onUpdate&&i("whileScrolling")&&(l(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var e=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(l(),c.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&S[1]>=w[1]-B&&s.cbOffsets[0]&&(l(),c.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&S[1]<=T&&s.cbOffsets[1]&&(l(),c.callbacks.onTotalScrollBack.call(t[0])),s.tweenRunning=!1,h[0].idleTimer=0,y(v,"hide")},e)}}}))}},G=function(e,t,o,a,n,i,r){function l(){S.stop||(x||m.call(),x=J()-v,s(),x>=S.time&&(S.time=x>S.time?x+f-(x-S.time):x+f-1,S.time0?(S.currVal=u(S.time,_,b,a,n),w[t]=Math.round(S.currVal)+"px"):w[t]=o+"px",p.call()}function c(){f=1e3/60,S.time=x+f,h=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},S.id=h(l)}function d(){null!=S.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(S.id):clearTimeout(S.id),S.id=null)}function u(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=a/2,1>e?o/2*e*e+t:(e--,-o/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=a/2,1>e?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=a/2,1>e?o/2*e*e*e+t:(e-=2,o/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=a,e--,-o*(e*e*e*e-1)+t;case"easeOutStrong":return o*(-Math.pow(2,-10*e/a)+1)+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var f,h,r=r||{},m=r.onStart||function(){},p=r.onUpdate||function(){},g=r.onComplete||function(){},v=J(),x=0,_=e.offsetTop,w=e.style,S=e._mTween[t];"left"===t&&(_=e.offsetLeft);var b=o-_;S.stop=0,"none"!==i&&d(),c()},J=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},K=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o=0&&a[0]+ot(n)[0]=0&&a[1]+ot(n)[1]i;i++)callback.call(null,i,obj[i])}function setAuthQueryString(){authQueryString="?sentry_version=4&sentry_client=raven-js/"+Raven.VERSION+"&sentry_key="+globalKey}function handleStackInfo(stackInfo,options){var frames=[];stackInfo.stack&&stackInfo.stack.length&&each(stackInfo.stack,function(i,stack){var frame=normalizeFrame(stack);frame&&frames.push(frame)}),triggerEvent("handle",{stackInfo:stackInfo,options:options}),processException(stackInfo.name,stackInfo.message,stackInfo.url,stackInfo.lineno,frames,options)}function normalizeFrame(frame){if(frame.url){var i,normalized={filename:frame.url,lineno:frame.line,colno:frame.column,"function":frame.func||"?"},context=extractContextFromFrame(frame);if(context){var keys=["pre_context","context_line","post_context"];for(i=3;i--;)normalized[keys[i]]=context[i]}return normalized.in_app=!(!globalOptions.includePaths.test(normalized.filename)||/(Raven|TraceKit)\./.test(normalized["function"])||/raven\.(min\.)?js$/.test(normalized.filename)),normalized}}function extractContextFromFrame(frame){if(frame.context&&globalOptions.fetchContext){for(var context=frame.context,pivot=~~(context.length/2),i=context.length,isMinified=!1;i--;)if(context[i].length>300){isMinified=!0;break}if(isMinified){if(isUndefined(frame.column))return;return[[],context[pivot].substr(frame.column,50),[]]}return[context.slice(0,pivot),context[pivot],context.slice(pivot+1)]}}function processException(type,message,fileurl,lineno,frames,options){var stacktrace,label;message+="",("Error"!==type||message)&&(globalOptions.ignoreErrors.test(message)||(frames&&frames.length?(fileurl=frames[0].filename||fileurl,frames.reverse(),stacktrace={frames:frames}):fileurl&&(stacktrace={frames:[{filename:fileurl,lineno:lineno,in_app:!0}]}),message=truncate(message,globalOptions.maxMessageLength),globalOptions.ignoreUrls&&globalOptions.ignoreUrls.test(fileurl)||(!globalOptions.whitelistUrls||globalOptions.whitelistUrls.test(fileurl))&&(label=lineno?message+" at "+lineno:message,send(objectMerge({exception:{type:type,value:message},stacktrace:stacktrace,culprit:fileurl,message:label},options)))))}function objectMerge(obj1,obj2){return obj2?(each(obj2,function(key,value){obj1[key]=value}),obj1):obj1}function truncate(str,max){return str.length<=max?str:str.substr(0,max)+"…"}function now(){return+new Date}function getHttpData(){var http={url:document.location.href,headers:{"User-Agent":navigator.userAgent}};return document.referrer&&(http.headers.Referer=document.referrer),http}function send(data){isSetup()&&(data=objectMerge({project:globalProject,logger:globalOptions.logger,platform:"javascript",request:getHttpData()},data),data.tags=objectMerge(objectMerge({},globalOptions.tags),data.tags),data.extra=objectMerge(objectMerge({},globalOptions.extra),data.extra),data.extra=objectMerge({"session:duration":now()-startTime},data.extra),isEmptyObject(data.tags)&&delete data.tags,globalUser&&(data.user=globalUser),globalOptions.release&&(data.release=globalOptions.release),isFunction(globalOptions.dataCallback)&&(data=globalOptions.dataCallback(data)),(!isFunction(globalOptions.shouldSendCallback)||globalOptions.shouldSendCallback(data))&&(lastEventId=data.event_id||(data.event_id=uuid4()),makeRequest(data)))}function makeRequest(data){var img=new Image,src=globalServer+authQueryString+"&sentry_data="+encodeURIComponent(JSON.stringify(data));img.crossOrigin="anonymous",img.onload=function(){triggerEvent("success",{data:data,src:src})},img.onerror=img.onabort=function(){triggerEvent("failure",{data:data,src:src})},img.src=src}function isSetup(){return hasJSON?globalServer?!0:(logDebug("error","Error: Raven has not been configured."),!1):!1}function joinRegExp(patterns){for(var pattern,sources=[],i=0,len=patterns.length;len>i;i++)pattern=patterns[i],isString(pattern)?sources.push(pattern.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):pattern&&pattern.source&&sources.push(pattern.source);return new RegExp(sources.join("|"),"i")}function uuid4(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=16*Math.random()|0,v="x"==c?r:3&r|8;return v.toString(16)})}function logDebug(level,message){window.console&&console[level]&&Raven.debug&&console[level](message)}function afterLoad(){var RavenConfig=window.RavenConfig;RavenConfig&&Raven.config(RavenConfig.dsn,RavenConfig.config).install()}var TraceKit={remoteFetching:!1,collectWindowErrors:!0,linesOfContext:7},_slice=[].slice,UNKNOWN_FUNCTION="?";TraceKit.wrap=function(func){function wrapped(){try{return func.apply(this,arguments)}catch(e){throw TraceKit.report(e),e}}return wrapped},TraceKit.report=function(){function subscribe(handler){installGlobalHandler(),handlers.push(handler)}function unsubscribe(handler){for(var i=handlers.length-1;i>=0;--i)handlers[i]===handler&&handlers.splice(i,1)}function unsubscribeAll(){uninstallGlobalHandler(),handlers=[]}function notifyHandlers(stack,isWindowError){var exception=null;if(!isWindowError||TraceKit.collectWindowErrors){for(var i in handlers)if(hasKey(handlers,i))try{handlers[i].apply(null,[stack].concat(_slice.call(arguments,2)))}catch(inner){exception=inner}if(exception)throw exception}}function traceKitWindowOnError(message,url,lineNo,colNo,ex){var stack=null;if(lastExceptionStack)TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack,url,lineNo,message),processLastException();else if(ex)stack=TraceKit.computeStackTrace(ex),notifyHandlers(stack,!0);else{var location={url:url,line:lineNo,column:colNo};location.func=TraceKit.computeStackTrace.guessFunctionName(location.url,location.line),location.context=TraceKit.computeStackTrace.gatherContext(location.url,location.line),stack={message:message,url:document.location.href,stack:[location]},notifyHandlers(stack,!0)}return _oldOnerrorHandler?_oldOnerrorHandler.apply(this,arguments):!1}function installGlobalHandler(){_onErrorHandlerInstalled||(_oldOnerrorHandler=window.onerror,window.onerror=traceKitWindowOnError,_onErrorHandlerInstalled=!0)}function uninstallGlobalHandler(){_onErrorHandlerInstalled&&(window.onerror=_oldOnerrorHandler,_onErrorHandlerInstalled=!1,_oldOnerrorHandler=undefined)}function processLastException(){var _lastExceptionStack=lastExceptionStack,_lastArgs=lastArgs;lastArgs=null,lastExceptionStack=null,lastException=null,notifyHandlers.apply(null,[_lastExceptionStack,!1].concat(_lastArgs))}function report(ex,rethrow){var args=_slice.call(arguments,1);if(lastExceptionStack){if(lastException===ex)return;processLastException()}var stack=TraceKit.computeStackTrace(ex);if(lastExceptionStack=stack,lastException=ex,lastArgs=args,window.setTimeout(function(){lastException===ex&&processLastException()},stack.incomplete?2e3:0),rethrow!==!1)throw ex}var _oldOnerrorHandler,_onErrorHandlerInstalled,handlers=[],lastArgs=null,lastException=null,lastExceptionStack=null;return report.subscribe=subscribe,report.unsubscribe=unsubscribe,report.uninstall=unsubscribeAll,report}(),TraceKit.computeStackTrace=function(){function loadSource(url){if(!TraceKit.remoteFetching)return"";try{var getXHR=function(){try{return new window.XMLHttpRequest}catch(e){return new window.ActiveXObject("Microsoft.XMLHTTP")}},request=getXHR();return request.open("GET",url,!1),request.send(""),request.responseText}catch(e){return""}}function getSource(url){if(!isString(url))return[];if(!hasKey(sourceCache,url)){var source="";-1!==url.indexOf(document.domain)&&(source=loadSource(url)),sourceCache[url]=source?source.split("\n"):[]}return sourceCache[url]}function guessFunctionName(url,lineNo){var m,reFunctionArgNames=/function ([^(]*)\(([^)]*)\)/,reGuessFunction=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,line="",maxLines=10,source=getSource(url);if(!source.length)return UNKNOWN_FUNCTION;for(var i=0;maxLines>i;++i)if(line=source[lineNo-i]+line,!isUndefined(line)){if(m=reGuessFunction.exec(line))return m[1];if(m=reFunctionArgNames.exec(line))return m[1]}return UNKNOWN_FUNCTION}function gatherContext(url,line){var source=getSource(url);if(!source.length)return null;var context=[],linesBefore=Math.floor(TraceKit.linesOfContext/2),linesAfter=linesBefore+TraceKit.linesOfContext%2,start=Math.max(0,line-linesBefore-1),end=Math.min(source.length,line+linesAfter-1);line-=1;for(var i=start;end>i;++i)isUndefined(source[i])||context.push(source[i]);return context.length>0?context:null}function escapeRegExp(text){return text.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function escapeCodeAsRegExpForMatchingInsideHTML(body){return escapeRegExp(body).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function findSourceInUrls(re,urls){for(var source,m,i=0,j=urls.length;j>i;++i)if((source=getSource(urls[i])).length&&(source=source.join("\n"),m=re.exec(source)))return{url:urls[i],line:source.substring(0,m.index).split("\n").length,column:m.index-source.lastIndexOf("\n",m.index)-1}; -return null}function findSourceInLine(fragment,url,line){var m,source=getSource(url),re=new RegExp("\\b"+escapeRegExp(fragment)+"\\b");return line-=1,source&&source.length>line&&(m=re.exec(source[line]))?m.index:null}function findSourceByFunctionBody(func){for(var body,re,parts,result,urls=[window.location.href],scripts=document.getElementsByTagName("script"),code=""+func,codeRE=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,eventRE=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,i=0;ii;++i){if(parts=gecko.exec(lines[i]))element={url:parts[3],func:parts[1]||UNKNOWN_FUNCTION,args:parts[2]?parts[2].split(","):"",line:+parts[4],column:parts[5]?+parts[5]:null};else{if(!(parts=chrome.exec(lines[i])))continue;element={url:parts[2],func:parts[1]||UNKNOWN_FUNCTION,line:+parts[3],column:parts[4]?+parts[4]:null}}!element.func&&element.line&&(element.func=guessFunctionName(element.url,element.line)),element.line&&(element.context=gatherContext(element.url,element.line)),stack.push(element)}return stack.length?(stack[0].line&&!stack[0].column&&reference?stack[0].column=findSourceInLine(reference[1],stack[0].url,stack[0].line):stack[0].column||isUndefined(ex.columnNumber)||(stack[0].column=ex.columnNumber+1),{name:ex.name,message:ex.message,url:document.location.href,stack:stack}):null}function computeStackTraceFromStacktraceProp(ex){for(var parts,stacktrace=ex.stacktrace,testRE=/ line (\d+), column (\d+) in (?:]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,lines=stacktrace.split("\n"),stack=[],i=0,j=lines.length;j>i;i+=2)if(parts=testRE.exec(lines[i])){var element={line:+parts[1],column:+parts[2],func:parts[3]||parts[4],args:parts[5]?parts[5].split(","):[],url:parts[6]};if(!element.func&&element.line&&(element.func=guessFunctionName(element.url,element.line)),element.line)try{element.context=gatherContext(element.url,element.line)}catch(exc){}element.context||(element.context=[lines[i+1]]),stack.push(element)}return stack.length?{name:ex.name,message:ex.message,url:document.location.href,stack:stack}:null}function computeStackTraceFromOperaMultiLineMessage(ex){var lines=ex.message.split("\n");if(lines.length<4)return null;var parts,i,len,source,lineRE1=/^\s*Line (\d+) of linked script ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i,lineRE2=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i,lineRE3=/^\s*Line (\d+) of function script\s*$/i,stack=[],scripts=document.getElementsByTagName("script"),inlineScriptBlocks=[];for(i in scripts)hasKey(scripts,i)&&!scripts[i].src&&inlineScriptBlocks.push(scripts[i]);for(i=2,len=lines.length;len>i;i+=2){var item=null;if(parts=lineRE1.exec(lines[i]))item={url:parts[2],func:parts[3],line:+parts[1]};else if(parts=lineRE2.exec(lines[i])){item={url:parts[3],func:parts[4]};var relativeLine=+parts[1],script=inlineScriptBlocks[parts[2]-1];if(script&&(source=getSource(item.url))){source=source.join("\n");var pos=source.indexOf(script.innerText);pos>=0&&(item.line=relativeLine+source.substring(0,pos).split("\n").length)}}else if(parts=lineRE3.exec(lines[i])){var url=window.location.href.replace(/#.*$/,""),line=parts[1],re=new RegExp(escapeCodeAsRegExpForMatchingInsideHTML(lines[i+1]));source=findSourceInUrls(re,[url]),item={url:url,line:source?source.line:line,func:""}}if(item){item.func||(item.func=guessFunctionName(item.url,item.line));var context=gatherContext(item.url,item.line),midline=context?context[Math.floor(context.length/2)]:null;item.context=context&&midline.replace(/^\s*/,"")===lines[i+1].replace(/^\s*/,"")?context:[lines[i+1]],stack.push(item)}}return stack.length?{name:ex.name,message:lines[0],url:document.location.href,stack:stack}:null}function augmentStackTraceWithInitialElement(stackInfo,url,lineNo,message){var initial={url:url,line:lineNo};if(initial.url&&initial.line){stackInfo.incomplete=!1,initial.func||(initial.func=guessFunctionName(initial.url,initial.line)),initial.context||(initial.context=gatherContext(initial.url,initial.line));var reference=/ '([^']+)' /.exec(message);if(reference&&(initial.column=findSourceInLine(reference[1],initial.url,initial.line)),stackInfo.stack.length>0&&stackInfo.stack[0].url===initial.url){if(stackInfo.stack[0].line===initial.line)return!1;if(!stackInfo.stack[0].line&&stackInfo.stack[0].func===initial.func)return stackInfo.stack[0].line=initial.line,stackInfo.stack[0].context=initial.context,!1}return stackInfo.stack.unshift(initial),stackInfo.partial=!0,!0}return stackInfo.incomplete=!0,!1}function computeStackTraceByWalkingCallerChain(ex,depth){for(var parts,item,source,functionName=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,stack=[],funcs={},recursion=!1,curr=computeStackTraceByWalkingCallerChain.caller;curr&&!recursion;curr=curr.caller)if(curr!==computeStackTrace&&curr!==TraceKit.report){if(item={url:null,func:UNKNOWN_FUNCTION,line:null,column:null},curr.name?item.func=curr.name:(parts=functionName.exec(curr.toString()))&&(item.func=parts[1]),source=findSourceByFunctionBody(curr)){item.url=source.url,item.line=source.line,item.func===UNKNOWN_FUNCTION&&(item.func=guessFunctionName(item.url,item.line));var reference=/ '([^']+)' /.exec(ex.message||ex.description);reference&&(item.column=findSourceInLine(reference[1],source.url,source.line))}funcs[""+curr]?recursion=!0:funcs[""+curr]=!0,stack.push(item)}depth&&stack.splice(0,depth);var result={name:ex.name,message:ex.message,url:document.location.href,stack:stack};return augmentStackTraceWithInitialElement(result,ex.sourceURL||ex.fileName,ex.line||ex.lineNumber,ex.message||ex.description),result}function computeStackTrace(ex,depth){var stack=null;depth=null==depth?0:+depth;try{if(stack=computeStackTraceFromStacktraceProp(ex))return stack}catch(e){if(debug)throw e}try{if(stack=computeStackTraceFromStackProp(ex))return stack}catch(e){if(debug)throw e}try{if(stack=computeStackTraceFromOperaMultiLineMessage(ex))return stack}catch(e){if(debug)throw e}try{if(stack=computeStackTraceByWalkingCallerChain(ex,depth+1))return stack}catch(e){if(debug)throw e}return{}}var debug=!1,sourceCache={};return computeStackTrace.augmentStackTraceWithInitialElement=augmentStackTraceWithInitialElement,computeStackTrace.computeStackTraceFromStackProp=computeStackTraceFromStackProp,computeStackTrace.guessFunctionName=guessFunctionName,computeStackTrace.gatherContext=gatherContext,computeStackTrace}();var lastCapturedException,lastEventId,globalServer,globalUser,globalKey,globalProject,authQueryString,_Raven=window.Raven,hasJSON=!("object"!=typeof JSON||!JSON.stringify),globalOptions={logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],collectWindowErrors:!0,tags:{},maxMessageLength:100,extra:{}},isRavenInstalled=!1,objectPrototype=Object.prototype,startTime=now(),Raven={VERSION:"1.1.18",debug:!0,noConflict:function(){return window.Raven=_Raven,Raven},config:function(dsn,options){if(globalServer)return logDebug("error","Error: Raven has already been configured"),Raven;if(!dsn)return Raven;var uri=parseDSN(dsn),lastSlash=uri.path.lastIndexOf("/"),path=uri.path.substr(1,lastSlash);return options&&each(options,function(key,value){globalOptions[key]=value}),globalOptions.ignoreErrors.push(/^Script error\.?$/),globalOptions.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/),globalOptions.ignoreErrors=joinRegExp(globalOptions.ignoreErrors),globalOptions.ignoreUrls=globalOptions.ignoreUrls.length?joinRegExp(globalOptions.ignoreUrls):!1,globalOptions.whitelistUrls=globalOptions.whitelistUrls.length?joinRegExp(globalOptions.whitelistUrls):!1,globalOptions.includePaths=joinRegExp(globalOptions.includePaths),globalKey=uri.user,globalProject=uri.path.substr(lastSlash+1),globalServer="//"+uri.host+(uri.port?":"+uri.port:"")+"/"+path+"api/"+globalProject+"/store/",uri.protocol&&(globalServer=uri.protocol+":"+globalServer),globalOptions.fetchContext&&(TraceKit.remoteFetching=!0),globalOptions.linesOfContext&&(TraceKit.linesOfContext=globalOptions.linesOfContext),TraceKit.collectWindowErrors=!!globalOptions.collectWindowErrors,setAuthQueryString(),Raven},install:function(){return isSetup()&&!isRavenInstalled&&(TraceKit.report.subscribe(handleStackInfo),isRavenInstalled=!0),Raven},context:function(options,func,args){return isFunction(options)&&(args=func||[],func=options,options=undefined),Raven.wrap(options,func).apply(this,args)},wrap:function(options,func){function wrapped(){for(var args=[],i=arguments.length,deep=!options||options&&options.deep!==!1;i--;)args[i]=deep?Raven.wrap(options,arguments[i]):arguments[i];try{return func.apply(this,args)}catch(e){throw Raven.captureException(e,options),e}}if(isUndefined(func)&&!isFunction(options))return options;if(isFunction(options)&&(func=options,options=undefined),!isFunction(func))return func;if(func.__raven__)return func;for(var property in func)hasKey(func,property)&&(wrapped[property]=func[property]);return wrapped.__raven__=!0,wrapped.__inner__=func,wrapped},uninstall:function(){return TraceKit.report.uninstall(),isRavenInstalled=!1,Raven},captureException:function(ex,options){if(!isError(ex))return Raven.captureMessage(ex,options);lastCapturedException=ex;try{TraceKit.report(ex,options)}catch(ex1){if(ex!==ex1)throw ex1}return Raven},captureMessage:function(msg,options){return globalOptions.ignoreErrors.test&&globalOptions.ignoreErrors.test(msg)?void 0:(send(objectMerge({message:msg+""},options)),Raven)},setUserContext:function(user){return globalUser=user,Raven},setExtraContext:function(extra){return globalOptions.extra=extra||{},Raven},setTagsContext:function(tags){return globalOptions.tags=tags||{},Raven},setReleaseContext:function(release){return globalOptions.release=release,Raven},lastException:function(){return lastCapturedException},lastEventId:function(){return lastEventId},isSetup:function(){return isSetup()}};Raven.setUser=Raven.setUserContext;var dsnKeys="source protocol user pass host port path".split(" "),dsnPattern=/^(?:(\w+):)?\/\/(\w+)(:\w+)?@([\w\.-]+)(?::(\d+))?(\/.*)/;RavenConfigError.prototype=new Error,RavenConfigError.prototype.constructor=RavenConfigError,afterLoad(),"function"==typeof define&&define.amd?(window.Raven=Raven,define("raven",[],function(){return Raven})):"object"==typeof module?module.exports=Raven:"object"==typeof exports?exports=Raven:window.Raven=Raven}(window),function(window,undefined){var gEval=function(js){(window.execScript||function(js){window.eval.call(window,js)})(js)},isA=function(a,b){return a instanceof(b||Array)},D=document,getElementsByTagName="getElementsByTagName",length="length",readyState="readyState",onreadystatechange="onreadystatechange",scripts=D[getElementsByTagName]("script"),scriptTag=scripts[scripts[length]-1],script=scriptTag.innerHTML.replace(/^\s+|\s+$/g,"");if(!window.ljs){var checkLoaded=scriptTag.src.match(/checkLoaded/)?1:0,header=D[getElementsByTagName]("head")[0]||D.documentElement,urlParse=function(url){var parts={};return parts.u=url.replace(/#(=)?([^#]*)?/g,function(m,a,b){return parts[a?"f":"i"]=b,""}),parts},appendElmt=function(type,attrs,cb){var i,e=D.createElement(type);cb&&(e[readyState]?e[onreadystatechange]=function(){("loaded"===e[readyState]||"complete"===e[readyState])&&(e[onreadystatechange]=null,cb())}:e.onload=cb);for(i in attrs)attrs[i]&&(e[i]=attrs[i]);header.appendChild(e)},load=function(url,cb){if(this.aliases&&this.aliases[url]){var args=this.aliases[url].slice(0);return isA(args)||(args=[args]),cb&&args.push(cb),this.load.apply(this,args)}if(isA(url)){for(var l=url[length];l--;)this.load(url[l]);return cb&&url.push(cb),this.load.apply(this,url)}return url.match(/\.css\b/)?this.loadcss(url,cb):this.loadjs(url,cb)},loaded={},loader={aliases:{},loadjs:function(url,cb){var parts=urlParse(url);return url=parts.u,loaded[url]===!0?(cb&&cb(),this):loaded[url]!==undefined?(cb&&(loaded[url]=function(ocb,cb){return function(){ocb&&ocb(),cb&&cb()}}(loaded[url],cb)),this):(loaded[url]=function(cb){return function(){loaded[url]=!0,cb&&cb()}}(cb),cb=function(){loaded[url]()},appendElmt("script",{type:"text/javascript",src:url,id:parts.i,onerror:function(error){if(parts.f){var c=error.currentTarget;c.parentNode.removeChild(c),appendElmt("script",{type:"text/javascript",src:parts.f,id:parts.i},cb)}}},cb),this)},loadcss:function(url,cb){var parts=urlParse(url);return url=parts.u,loaded[url]||appendElmt("link",{type:"text/css",rel:"stylesheet",href:url,id:parts.i}),loaded[url]=!0,cb&&cb(),this},load:function(){var argv=arguments,argc=argv[length];return 1===argc&&isA(argv[0],Function)?(argv[0](),this):(load.call(this,argv[0],1>=argc?undefined:function(){loader.load.apply(loader,[].slice.call(argv,1))}),this)},addAliases:function(aliases){for(var i in aliases)this.aliases[i]=isA(aliases[i])?aliases[i].slice(0):aliases[i];return this}};if(checkLoaded){var i,l,links,url;for(i=0,l=scripts[length];l>i;i++)(url=scripts[i].getAttribute("src"))&&(loaded[url.replace(/#.*$/,"")]=!0);for(links=D[getElementsByTagName]("link"),i=0,l=links[length];l>i;i++)("stylesheet"===links[i].rel||"text/css"===links[i].type)&&(loaded[links[i].getAttribute("href").replace(/#.*$/,"")]=!0)}window.ljs=loader}script&&gEval(script)}(window),MessageFormat.locale.af=function(n){return 1===n?"one":"other"},MessageFormat.locale.am=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.ar=function(n){return 0===n?"zero":1==n?"one":2==n?"two":n%100>=3&&10>=n%100&&n==Math.floor(n)?"few":n%100>=11&&99>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.bg=function(n){return 1===n?"one":"other"},MessageFormat.locale.bn=function(n){return 1===n?"one":"other"},MessageFormat.locale.br=function(n){return 0===n?"zero":1==n?"one":2==n?"two":3==n?"few":6==n?"many":"other"},MessageFormat.locale.ca=function(n){return 1===n?"one":"other"},MessageFormat.locale.cs=function(n){return 1==n?"one":2==n||3==n||4==n?"few":"other"},MessageFormat.locale.cy=function(n){return 0===n?"zero":1==n?"one":2==n?"two":3==n?"few":6==n?"many":"other"},MessageFormat.locale.da=function(n){return 1===n?"one":"other"},MessageFormat.locale.de=function(n){return 1===n?"one":"other"},MessageFormat.locale.el=function(n){return 1===n?"one":"other"},MessageFormat.locale.en=function(n){return 1===n?"one":"other"},MessageFormat.locale.es=function(n){return 1===n?"one":"other"},MessageFormat.locale.et=function(n){return 1===n?"one":"other"},MessageFormat.locale.eu=function(n){return 1===n?"one":"other"},MessageFormat.locale.fa=function(){return"other"},MessageFormat.locale.fi=function(n){return 1===n?"one":"other"},MessageFormat.locale.fil=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.fr=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.ga=function(n){return 1==n?"one":2==n?"two":"other"},MessageFormat.locale.gl=function(n){return 1===n?"one":"other"},MessageFormat.locale.gsw=function(n){return 1===n?"one":"other"},MessageFormat.locale.gu=function(n){return 1===n?"one":"other"},MessageFormat.locale.he=function(n){return 1===n?"one":"other"},MessageFormat.locale.hi=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.hr=function(n){return n%10==1&&n%100!=11?"one":n%10>=2&&4>=n%10&&(12>n%100||n%100>14)&&n==Math.floor(n)?"few":n%10===0||n%10>=5&&9>=n%10||n%100>=11&&14>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.hu=function(){return"other"},MessageFormat.locale.id=function(){return"other"},MessageFormat.locale["in"]=function(){return"other"},MessageFormat.locale.is=function(n){return 1===n?"one":"other"},MessageFormat.locale.it=function(n){return 1===n?"one":"other"},MessageFormat.locale.iw=function(n){return 1===n?"one":"other"},MessageFormat.locale.ja=function(){return"other"},MessageFormat.locale.kn=function(){return"other"},MessageFormat.locale.ko=function(){return"other"},MessageFormat.locale.lag=function(n){return 0===n?"zero":n>0&&2>n?"one":"other"},MessageFormat.locale.ln=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.lt=function(n){return n%10==1&&(11>n%100||n%100>19)?"one":n%10>=2&&9>=n%10&&(11>n%100||n%100>19)&&n==Math.floor(n)?"few":"other"},MessageFormat.locale.lv=function(n){return 0===n?"zero":n%10==1&&n%100!=11?"one":"other"},MessageFormat.locale.mk=function(n){return n%10==1&&11!=n?"one":"other"},MessageFormat.locale.ml=function(n){return 1===n?"one":"other"},MessageFormat.locale.mo=function(n){return 1==n?"one":0===n||1!=n&&n%100>=1&&19>=n%100&&n==Math.floor(n)?"few":"other"},MessageFormat.locale.mr=function(n){return 1===n?"one":"other"},MessageFormat.locale.ms=function(){return"other"},MessageFormat.locale.mt=function(n){return 1==n?"one":0===n||n%100>=2&&4>=n%100&&n==Math.floor(n)?"few":n%100>=11&&19>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.nl=function(n){return 1===n?"one":"other"},MessageFormat.locale.no=function(n){return 1===n?"one":"other"},MessageFormat.locale.or=function(n){return 1===n?"one":"other"},MessageFormat.locale.pl=function(n){return 1==n?"one":n%10>=2&&4>=n%10&&(12>n%100||n%100>14)&&n==Math.floor(n)?"few":n%10===0||1!=n&&n%10==1||(n%10>=5&&9>=n%10||n%100>=12&&14>=n%100)&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.pt=function(n){return 1===n?"one":"other"},MessageFormat.locale.ro=function(n){return 1==n?"one":0===n||1!=n&&n%100>=1&&19>=n%100&&n==Math.floor(n)?"few":"other"},MessageFormat.locale.ru=function(n){return n%10==1&&n%100!=11?"one":n%10>=2&&4>=n%10&&(12>n%100||n%100>14)&&n==Math.floor(n)?"few":n%10===0||n%10>=5&&9>=n%10||n%100>=11&&14>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.shi=function(n){return n>=0&&1>=n?"one":n>=2&&10>=n&&n==Math.floor(n)?"few":"other"},MessageFormat.locale.sk=function(n){return 1==n?"one":2==n||3==n||4==n?"few":"other"},MessageFormat.locale.sl=function(n){return n%100==1?"one":n%100==2?"two":n%100==3||n%100==4?"few":"other"},MessageFormat.locale.sq=function(n){return 1===n?"one":"other"},MessageFormat.locale.sr=function(n){return n%10==1&&n%100!=11?"one":n%10>=2&&4>=n%10&&(12>n%100||n%100>14)&&n==Math.floor(n)?"few":n%10===0||n%10>=5&&9>=n%10||n%100>=11&&14>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.sv=function(n){return 1===n?"one":"other"},MessageFormat.locale.sw=function(n){return 1===n?"one":"other"},MessageFormat.locale.ta=function(n){return 1===n?"one":"other"},MessageFormat.locale.te=function(n){return 1===n?"one":"other"},MessageFormat.locale.th=function(){return"other"},MessageFormat.locale.tl=function(n){return 0===n||1==n?"one":"other"},MessageFormat.locale.tr=function(){return"other"},MessageFormat.locale.uk=function(n){return n%10==1&&n%100!=11?"one":n%10>=2&&4>=n%10&&(12>n%100||n%100>14)&&n==Math.floor(n)?"few":n%10===0||n%10>=5&&9>=n%10||n%100>=11&&14>=n%100&&n==Math.floor(n)?"many":"other"},MessageFormat.locale.ur=function(n){return 1===n?"one":"other"},MessageFormat.locale.vi=function(){return"other"},MessageFormat.locale.zh=function(){return"other"};var mod;mod=angular.module("infinite-scroll",[]),mod.directive("infiniteScroll",["$rootScope","$window","$timeout",function($rootScope,$window,$timeout){return{link:function(scope,elem,attrs){var checkWhenEnabled,handler,scrollDistance,scrollEnabled;return $window=angular.element($window),scrollDistance=0,null!=attrs.infiniteScrollDistance&&scope.$watch(attrs.infiniteScrollDistance,function(value){return scrollDistance=parseInt(value,10)}),scrollEnabled=!0,checkWhenEnabled=!1,null!=attrs.infiniteScrollDisabled&&scope.$watch(attrs.infiniteScrollDisabled,function(value){return scrollEnabled=!value,scrollEnabled&&checkWhenEnabled?(checkWhenEnabled=!1,handler()):void 0}),handler=function(){var elementBottom,remaining,shouldScroll,windowBottom;return windowBottom=$window.height()+$window.scrollTop(),elementBottom=elem.offset().top+elem.height(),remaining=elementBottom-windowBottom,shouldScroll=remaining<=$window.height()*scrollDistance,shouldScroll&&scrollEnabled?$rootScope.$$phase?scope.$eval(attrs.infiniteScroll):scope.$apply(attrs.infiniteScroll):shouldScroll?checkWhenEnabled=!0:void 0},$window.on("scroll",handler),scope.$on("$destroy",function(){return $window.off("scroll",handler)}),$timeout(function(){return attrs.infiniteScrollImmediateCheck?scope.$eval(attrs.infiniteScrollImmediateCheck)?handler():void 0:handler()},0)}}}]),!function(){function init(){this._events={},this._conf&&configure.call(this,this._conf)}function configure(conf){conf&&(this._conf=conf,conf.delimiter&&(this.delimiter=conf.delimiter),conf.maxListeners&&(this._events.maxListeners=conf.maxListeners),conf.wildcard&&(this.wildcard=conf.wildcard),conf.newListener&&(this.newListener=conf.newListener),this.wildcard&&(this.listenerTree={}))}function EventEmitter(conf){this._events={},this.newListener=!1,configure.call(this,conf)}function searchListenerTree(handlers,type,tree,i){if(!tree)return[];var leaf,len,branch,xTree,xxTree,isolatedBranch,endReached,listeners=[],typeLength=type.length,currentType=type[i],nextType=type[i+1];if(i===typeLength&&tree._listeners){if("function"==typeof tree._listeners)return handlers&&handlers.push(tree._listeners),[tree];for(leaf=0,len=tree._listeners.length;len>leaf;leaf++)handlers&&handlers.push(tree._listeners[leaf]);return[tree]}if("*"===currentType||"**"===currentType||tree[currentType]){if("*"===currentType){for(branch in tree)"_listeners"!==branch&&tree.hasOwnProperty(branch)&&(listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],i+1)));return listeners}if("**"===currentType){endReached=i+1===typeLength||i+2===typeLength&&"*"===nextType,endReached&&tree._listeners&&(listeners=listeners.concat(searchListenerTree(handlers,type,tree,typeLength)));for(branch in tree)"_listeners"!==branch&&tree.hasOwnProperty(branch)&&("*"===branch||"**"===branch?(tree[branch]._listeners&&!endReached&&(listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],typeLength))),listeners=listeners.concat(searchListenerTree(handlers,type,tree[branch],i))):listeners=listeners.concat(branch===nextType?searchListenerTree(handlers,type,tree[branch],i+2):searchListenerTree(handlers,type,tree[branch],i)));return listeners}listeners=listeners.concat(searchListenerTree(handlers,type,tree[currentType],i+1))}if(xTree=tree["*"],xTree&&searchListenerTree(handlers,type,xTree,i+1),xxTree=tree["**"])if(typeLength>i){xxTree._listeners&&searchListenerTree(handlers,type,xxTree,typeLength);for(branch in xxTree)"_listeners"!==branch&&xxTree.hasOwnProperty(branch)&&(branch===nextType?searchListenerTree(handlers,type,xxTree[branch],i+2):branch===currentType?searchListenerTree(handlers,type,xxTree[branch],i+1):(isolatedBranch={},isolatedBranch[branch]=xxTree[branch],searchListenerTree(handlers,type,{"**":isolatedBranch},i+1)))}else xxTree._listeners?searchListenerTree(handlers,type,xxTree,typeLength):xxTree["*"]&&xxTree["*"]._listeners&&searchListenerTree(handlers,type,xxTree["*"],typeLength);return listeners}function growListenerTree(type,listener){type="string"==typeof type?type.split(this.delimiter):type.slice();for(var i=0,len=type.length;len>i+1;i++)if("**"===type[i]&&"**"===type[i+1])return;for(var tree=this.listenerTree,name=type.shift();name;){if(tree[name]||(tree[name]={}),tree=tree[name],0===type.length){if(tree._listeners){if("function"==typeof tree._listeners)tree._listeners=[tree._listeners,listener];else if(isArray(tree._listeners)&&(tree._listeners.push(listener),!tree._listeners.warned)){var m=defaultMaxListeners;"undefined"!=typeof this._events.maxListeners&&(m=this._events.maxListeners),m>0&&tree._listeners.length>m&&(tree._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",tree._listeners.length),console.trace())}}else tree._listeners=listener;return!0}name=type.shift()}return!0}var isArray=Array.isArray?Array.isArray:function(obj){return"[object Array]"===Object.prototype.toString.call(obj)},defaultMaxListeners=10;EventEmitter.prototype.delimiter=".",EventEmitter.prototype.setMaxListeners=function(n){this._events||init.call(this),this._events.maxListeners=n,this._conf||(this._conf={}),this._conf.maxListeners=n},EventEmitter.prototype.event="",EventEmitter.prototype.once=function(event,fn){return this.many(event,1,fn),this},EventEmitter.prototype.many=function(event,ttl,fn){function listener(){0===--ttl&&self.off(event,listener),fn.apply(this,arguments)}var self=this;if("function"!=typeof fn)throw new Error("many only accepts instances of Function");return listener._origin=fn,this.on(event,listener),self},EventEmitter.prototype.emit=function(){this._events||init.call(this);var type=arguments[0];if("newListener"===type&&!this.newListener&&!this._events.newListener)return!1;if(this._all){for(var l=arguments.length,args=new Array(l-1),i=1;l>i;i++)args[i-1]=arguments[i];for(i=0,l=this._all.length;l>i;i++)this.event=type,this._all[i].apply(this,args)}if("error"===type&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");var handler;if(this.wildcard){handler=[];var ns="string"==typeof type?type.split(this.delimiter):type.slice();searchListenerTree.call(this,handler,ns,this.listenerTree,0)}else handler=this._events[type];if("function"==typeof handler){if(this.event=type,1===arguments.length)handler.call(this);else if(arguments.length>1)switch(arguments.length){case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:for(var l=arguments.length,args=new Array(l-1),i=1;l>i;i++)args[i-1]=arguments[i];handler.apply(this,args)}return!0}if(handler){for(var l=arguments.length,args=new Array(l-1),i=1;l>i;i++)args[i-1]=arguments[i];for(var listeners=handler.slice(),i=0,l=listeners.length;l>i;i++)this.event=type,listeners[i].apply(this,args);return listeners.length>0||!!this._all}return!!this._all},EventEmitter.prototype.on=function(type,listener){if("function"==typeof type)return this.onAny(type),this;if("function"!=typeof listener)throw new Error("on only accepts instances of Function");if(this._events||init.call(this),this.emit("newListener",type,listener),this.wildcard)return growListenerTree.call(this,type,listener),this;if(this._events[type]){if("function"==typeof this._events[type])this._events[type]=[this._events[type],listener];else if(isArray(this._events[type])&&(this._events[type].push(listener),!this._events[type].warned)){var m=defaultMaxListeners;"undefined"!=typeof this._events.maxListeners&&(m=this._events.maxListeners),m>0&&this._events[type].length>m&&(this._events[type].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[type].length),console.trace())}}else this._events[type]=listener;return this},EventEmitter.prototype.onAny=function(fn){if("function"!=typeof fn)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),this._all.push(fn),this},EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prototype.off=function(type,listener){if("function"!=typeof listener)throw new Error("removeListener only takes instances of Function");var handlers,leafs=[];if(this.wildcard){var ns="string"==typeof type?type.split(this.delimiter):type.slice();leafs=searchListenerTree.call(this,null,ns,this.listenerTree,0)}else{if(!this._events[type])return this;handlers=this._events[type],leafs.push({_listeners:handlers})}for(var iLeaf=0;iLeafi;i++)if(handlers[i]===listener||handlers[i].listener&&handlers[i].listener===listener||handlers[i]._origin&&handlers[i]._origin===listener){position=i;break}if(0>position)continue;return this.wildcard?leaf._listeners.splice(position,1):this._events[type].splice(position,1),0===handlers.length&&(this.wildcard?delete leaf._listeners:delete this._events[type]),this}(handlers===listener||handlers.listener&&handlers.listener===listener||handlers._origin&&handlers._origin===listener)&&(this.wildcard?delete leaf._listeners:delete this._events[type])}return this},EventEmitter.prototype.offAny=function(fn){var fns,i=0,l=0;if(fn&&this._all&&this._all.length>0){for(fns=this._all,i=0,l=fns.length;l>i;i++)if(fn===fns[i])return fns.splice(i,1),this}else this._all=[];return this},EventEmitter.prototype.removeListener=EventEmitter.prototype.off,EventEmitter.prototype.removeAllListeners=function(type){if(0===arguments.length)return!this._events||init.call(this),this;if(this.wildcard)for(var ns="string"==typeof type?type.split(this.delimiter):type.slice(),leafs=searchListenerTree.call(this,null,ns,this.listenerTree,0),iLeaf=0;iLeafii;ii++)newArr[ii]=arr[ii+offset];return newArr}function ensureSize(iter){return void 0===iter.size&&(iter.size=iter.__iterate(returnTrue)),iter.size}function wrapIndex(iter,index){return index>=0?+index:ensureSize(iter)+ +index}function returnTrue(){return!0}function wholeSlice(begin,end,size){return(0===begin||void 0!==size&&-size>=begin)&&(void 0===end||void 0!==size&&end>=size)}function resolveBegin(begin,size){return resolveIndex(begin,size,0)}function resolveEnd(end,size){return resolveIndex(end,size,size)}function resolveIndex(index,size,defaultIndex){return void 0===index?defaultIndex:0>index?Math.max(0,size+index):void 0===size?index:Math.min(size,index) -}function Iterable(value){return isIterable(value)?value:Seq(value)}function KeyedIterable(value){return isKeyed(value)?value:KeyedSeq(value)}function IndexedIterable(value){return isIndexed(value)?value:IndexedSeq(value)}function SetIterable(value){return isIterable(value)&&!isAssociative(value)?value:SetSeq(value)}function isIterable(maybeIterable){return!(!maybeIterable||!maybeIterable[IS_ITERABLE_SENTINEL])}function isKeyed(maybeKeyed){return!(!maybeKeyed||!maybeKeyed[IS_KEYED_SENTINEL])}function isIndexed(maybeIndexed){return!(!maybeIndexed||!maybeIndexed[IS_INDEXED_SENTINEL])}function isAssociative(maybeAssociative){return isKeyed(maybeAssociative)||isIndexed(maybeAssociative)}function isOrdered(maybeOrdered){return!(!maybeOrdered||!maybeOrdered[IS_ORDERED_SENTINEL])}function src_Iterator__Iterator(next){this.next=next}function iteratorValue(type,k,v,iteratorResult){var value=0===type?k:1===type?v:[k,v];return iteratorResult?iteratorResult.value=value:iteratorResult={value:value,done:!1},iteratorResult}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(maybeIterable){return!!getIteratorFn(maybeIterable)}function isIterator(maybeIterator){return maybeIterator&&"function"==typeof maybeIterator.next}function getIterator(iterable){var iteratorFn=getIteratorFn(iterable);return iteratorFn&&iteratorFn.call(iterable)}function getIteratorFn(iterable){var iteratorFn=iterable&&(REAL_ITERATOR_SYMBOL&&iterable[REAL_ITERATOR_SYMBOL]||iterable[FAUX_ITERATOR_SYMBOL]);return"function"==typeof iteratorFn?iteratorFn:void 0}function isArrayLike(value){return value&&"number"==typeof value.length}function Seq(value){return null===value||void 0===value?emptySequence():isIterable(value)?value.toSeq():seqFromValue(value)}function KeyedSeq(value){return null===value||void 0===value?emptySequence().toKeyedSeq():isIterable(value)?isKeyed(value)?value.toSeq():value.fromEntrySeq():keyedSeqFromValue(value)}function IndexedSeq(value){return null===value||void 0===value?emptySequence():isIterable(value)?isKeyed(value)?value.entrySeq():value.toIndexedSeq():indexedSeqFromValue(value)}function SetSeq(value){return(null===value||void 0===value?emptySequence():isIterable(value)?isKeyed(value)?value.entrySeq():value:indexedSeqFromValue(value)).toSetSeq()}function ArraySeq(array){this._array=array,this.size=array.length}function ObjectSeq(object){var keys=Object.keys(object);this._object=object,this._keys=keys,this.size=keys.length}function IterableSeq(iterable){this._iterable=iterable,this.size=iterable.length||iterable.size}function IteratorSeq(iterator){this._iterator=iterator,this._iteratorCache=[]}function isSeq(maybeSeq){return!(!maybeSeq||!maybeSeq[IS_SEQ_SENTINEL])}function emptySequence(){return EMPTY_SEQ||(EMPTY_SEQ=new ArraySeq([]))}function keyedSeqFromValue(value){var seq=Array.isArray(value)?new ArraySeq(value).fromEntrySeq():isIterator(value)?new IteratorSeq(value).fromEntrySeq():hasIterator(value)?new IterableSeq(value).fromEntrySeq():"object"==typeof value?new ObjectSeq(value):void 0;if(!seq)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+value);return seq}function indexedSeqFromValue(value){var seq=maybeIndexedSeqFromValue(value);if(!seq)throw new TypeError("Expected Array or iterable object of values: "+value);return seq}function seqFromValue(value){var seq=maybeIndexedSeqFromValue(value)||"object"==typeof value&&new ObjectSeq(value);if(!seq)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+value);return seq}function maybeIndexedSeqFromValue(value){return isArrayLike(value)?new ArraySeq(value):isIterator(value)?new IteratorSeq(value):hasIterator(value)?new IterableSeq(value):void 0}function seqIterate(seq,fn,reverse,useKeys){var cache=seq._cache;if(cache){for(var maxIndex=cache.length-1,ii=0;maxIndex>=ii;ii++){var entry=cache[reverse?maxIndex-ii:ii];if(fn(entry[1],useKeys?entry[0]:ii,seq)===!1)return ii+1}return ii}return seq.__iterateUncached(fn,reverse)}function seqIterator(seq,type,reverse,useKeys){var cache=seq._cache;if(cache){var maxIndex=cache.length-1,ii=0;return new src_Iterator__Iterator(function(){var entry=cache[reverse?maxIndex-ii:ii];return ii++>maxIndex?iteratorDone():iteratorValue(type,useKeys?entry[0]:ii-1,entry[1])})}return seq.__iteratorUncached(type,reverse)}function Collection(){throw TypeError("Abstract")}function KeyedCollection(){}function IndexedCollection(){}function SetCollection(){}function is(valueA,valueB){if(valueA===valueB||valueA!==valueA&&valueB!==valueB)return!0;if(!valueA||!valueB)return!1;if("function"==typeof valueA.valueOf&&"function"==typeof valueB.valueOf){if(valueA=valueA.valueOf(),valueB=valueB.valueOf(),valueA===valueB||valueA!==valueA&&valueB!==valueB)return!0;if(!valueA||!valueB)return!1}return"function"==typeof valueA.equals&&"function"==typeof valueB.equals&&valueA.equals(valueB)?!0:!1}function fromJS(json,converter){return converter?fromJSWith(converter,json,"",{"":json}):fromJSDefault(json)}function fromJSWith(converter,json,key,parentJSON){return Array.isArray(json)?converter.call(parentJSON,key,IndexedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json)})):isPlainObj(json)?converter.call(parentJSON,key,KeyedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json)})):json}function fromJSDefault(json){return Array.isArray(json)?IndexedSeq(json).map(fromJSDefault).toList():isPlainObj(json)?KeyedSeq(json).map(fromJSDefault).toMap():json}function isPlainObj(value){return value&&(value.constructor===Object||void 0===value.constructor)}function smi(i32){return i32>>>1&1073741824|3221225471&i32}function hash(o){if(o===!1||null===o||void 0===o)return 0;if("function"==typeof o.valueOf&&(o=o.valueOf(),o===!1||null===o||void 0===o))return 0;if(o===!0)return 1;var type=typeof o;if("number"===type){var h=0|o;for(h!==o&&(h^=4294967295*o);o>4294967295;)o/=4294967295,h^=o;return smi(h)}return"string"===type?o.length>STRING_HASH_CACHE_MIN_STRLEN?cachedHashString(o):hashString(o):"function"==typeof o.hashCode?o.hashCode():hashJSObj(o)}function cachedHashString(string){var hash=stringHashCache[string];return void 0===hash&&(hash=hashString(string),STRING_HASH_CACHE_SIZE===STRING_HASH_CACHE_MAX_SIZE&&(STRING_HASH_CACHE_SIZE=0,stringHashCache={}),STRING_HASH_CACHE_SIZE++,stringHashCache[string]=hash),hash}function hashString(string){for(var hash=0,ii=0;ii0)switch(node.nodeType){case 1:return node.uniqueID;case 9:return node.documentElement&&node.documentElement.uniqueID}}function invariant(condition,error){if(!condition)throw new Error(error)}function assertNotInfinite(size){invariant(1/0!==size,"Cannot perform this action with an infinite size.")}function ToKeyedSequence(indexed,useKeys){this._iter=indexed,this._useKeys=useKeys,this.size=indexed.size}function ToIndexedSequence(iter){this._iter=iter,this.size=iter.size}function ToSetSequence(iter){this._iter=iter,this.size=iter.size}function FromEntriesSequence(entries){this._iter=entries,this.size=entries.size}function flipFactory(iterable){var flipSequence=makeSequence(iterable);return flipSequence._iter=iterable,flipSequence.size=iterable.size,flipSequence.flip=function(){return iterable},flipSequence.reverse=function(){var reversedSequence=iterable.reverse.apply(this);return reversedSequence.flip=function(){return iterable.reverse()},reversedSequence},flipSequence.has=function(key){return iterable.includes(key)},flipSequence.includes=function(key){return iterable.has(key)},flipSequence.cacheResult=cacheResultThrough,flipSequence.__iterateUncached=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k){return fn(k,v,this$0)!==!1},reverse)},flipSequence.__iteratorUncached=function(type,reverse){if(type===ITERATE_ENTRIES){var iterator=iterable.__iterator(type,reverse);return new src_Iterator__Iterator(function(){var step=iterator.next();if(!step.done){var k=step.value[0];step.value[0]=step.value[1],step.value[1]=k}return step})}return iterable.__iterator(type===ITERATE_VALUES?ITERATE_KEYS:ITERATE_VALUES,reverse)},flipSequence}function mapFactory(iterable,mapper,context){var mappedSequence=makeSequence(iterable);return mappedSequence.size=iterable.size,mappedSequence.has=function(key){return iterable.has(key)},mappedSequence.get=function(key,notSetValue){var v=iterable.get(key,NOT_SET);return v===NOT_SET?notSetValue:mapper.call(context,v,key,iterable)},mappedSequence.__iterateUncached=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k,c){return fn(mapper.call(context,v,k,c),k,this$0)!==!1},reverse)},mappedSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse);return new src_Iterator__Iterator(function(){var step=iterator.next();if(step.done)return step;var entry=step.value,key=entry[0];return iteratorValue(type,key,mapper.call(context,entry[1],key,iterable),step)})},mappedSequence}function reverseFactory(iterable,useKeys){var reversedSequence=makeSequence(iterable);return reversedSequence._iter=iterable,reversedSequence.size=iterable.size,reversedSequence.reverse=function(){return iterable},iterable.flip&&(reversedSequence.flip=function(){var flipSequence=flipFactory(iterable);return flipSequence.reverse=function(){return iterable.flip()},flipSequence}),reversedSequence.get=function(key,notSetValue){return iterable.get(useKeys?key:-1-key,notSetValue)},reversedSequence.has=function(key){return iterable.has(useKeys?key:-1-key)},reversedSequence.includes=function(value){return iterable.includes(value)},reversedSequence.cacheResult=cacheResultThrough,reversedSequence.__iterate=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k){return fn(v,k,this$0)},!reverse)},reversedSequence.__iterator=function(type,reverse){return iterable.__iterator(type,!reverse)},reversedSequence}function filterFactory(iterable,predicate,context,useKeys){var filterSequence=makeSequence(iterable);return useKeys&&(filterSequence.has=function(key){var v=iterable.get(key,NOT_SET);return v!==NOT_SET&&!!predicate.call(context,v,key,iterable)},filterSequence.get=function(key,notSetValue){var v=iterable.get(key,NOT_SET);return v!==NOT_SET&&predicate.call(context,v,key,iterable)?v:notSetValue}),filterSequence.__iterateUncached=function(fn,reverse){var this$0=this,iterations=0;return iterable.__iterate(function(v,k,c){return predicate.call(context,v,k,c)?(iterations++,fn(v,useKeys?k:iterations-1,this$0)):void 0},reverse),iterations},filterSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse),iterations=0;return new src_Iterator__Iterator(function(){for(;;){var step=iterator.next();if(step.done)return step;var entry=step.value,key=entry[0],value=entry[1];if(predicate.call(context,value,key,iterable))return iteratorValue(type,useKeys?key:iterations++,value,step)}})},filterSequence}function countByFactory(iterable,grouper,context){var groups=src_Map__Map().asMutable();return iterable.__iterate(function(v,k){groups.update(grouper.call(context,v,k,iterable),0,function(a){return a+1})}),groups.asImmutable()}function groupByFactory(iterable,grouper,context){var isKeyedIter=isKeyed(iterable),groups=(isOrdered(iterable)?OrderedMap():src_Map__Map()).asMutable();iterable.__iterate(function(v,k){groups.update(grouper.call(context,v,k,iterable),function(a){return a=a||[],a.push(isKeyedIter?[k,v]:v),a})});var coerce=iterableClass(iterable);return groups.map(function(arr){return reify(iterable,coerce(arr))})}function sliceFactory(iterable,begin,end,useKeys){var originalSize=iterable.size;if(wholeSlice(begin,end,originalSize))return iterable;var resolvedBegin=resolveBegin(begin,originalSize),resolvedEnd=resolveEnd(end,originalSize);if(resolvedBegin!==resolvedBegin||resolvedEnd!==resolvedEnd)return sliceFactory(iterable.toSeq().cacheResult(),begin,end,useKeys);var sliceSize,resolvedSize=resolvedEnd-resolvedBegin;resolvedSize===resolvedSize&&(sliceSize=0>resolvedSize?0:resolvedSize);var sliceSeq=makeSequence(iterable);return sliceSeq.size=sliceSize,!useKeys&&isSeq(iterable)&&sliceSize>=0&&(sliceSeq.get=function(index,notSetValue){return index=wrapIndex(this,index),index>=0&&sliceSize>index?iterable.get(index+resolvedBegin,notSetValue):notSetValue}),sliceSeq.__iterateUncached=function(fn,reverse){var this$0=this;if(0===sliceSize)return 0;if(reverse)return this.cacheResult().__iterate(fn,reverse);var skipped=0,isSkipping=!0,iterations=0;return iterable.__iterate(function(v,k){return isSkipping&&(isSkipping=skipped++sliceSize)return iteratorDone();var step=iterator.next();return useKeys||type===ITERATE_VALUES?step:type===ITERATE_KEYS?iteratorValue(type,iterations-1,void 0,step):iteratorValue(type,iterations-1,step.value[1],step)})},sliceSeq}function takeWhileFactory(iterable,predicate,context){var takeSequence=makeSequence(iterable);return takeSequence.__iterateUncached=function(fn,reverse){var this$0=this;if(reverse)return this.cacheResult().__iterate(fn,reverse);var iterations=0;return iterable.__iterate(function(v,k,c){return predicate.call(context,v,k,c)&&++iterations&&fn(v,k,this$0)}),iterations},takeSequence.__iteratorUncached=function(type,reverse){var this$0=this;if(reverse)return this.cacheResult().__iterator(type,reverse);var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse),iterating=!0;return new src_Iterator__Iterator(function(){if(!iterating)return iteratorDone();var step=iterator.next();if(step.done)return step;var entry=step.value,k=entry[0],v=entry[1];return predicate.call(context,v,k,this$0)?type===ITERATE_ENTRIES?step:iteratorValue(type,k,v,step):(iterating=!1,iteratorDone())})},takeSequence}function skipWhileFactory(iterable,predicate,context,useKeys){var skipSequence=makeSequence(iterable);return skipSequence.__iterateUncached=function(fn,reverse){var this$0=this;if(reverse)return this.cacheResult().__iterate(fn,reverse);var isSkipping=!0,iterations=0;return iterable.__iterate(function(v,k,c){return isSkipping&&(isSkipping=predicate.call(context,v,k,c))?void 0:(iterations++,fn(v,useKeys?k:iterations-1,this$0))}),iterations},skipSequence.__iteratorUncached=function(type,reverse){var this$0=this;if(reverse)return this.cacheResult().__iterator(type,reverse);var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse),skipping=!0,iterations=0;return new src_Iterator__Iterator(function(){var step,k,v;do{if(step=iterator.next(),step.done)return useKeys||type===ITERATE_VALUES?step:type===ITERATE_KEYS?iteratorValue(type,iterations++,void 0,step):iteratorValue(type,iterations++,step.value[1],step);var entry=step.value;k=entry[0],v=entry[1],skipping&&(skipping=predicate.call(context,v,k,this$0))}while(skipping);return type===ITERATE_ENTRIES?step:iteratorValue(type,k,v,step)})},skipSequence}function concatFactory(iterable,values){var isKeyedIterable=isKeyed(iterable),iters=[iterable].concat(values).map(function(v){return isIterable(v)?isKeyedIterable&&(v=KeyedIterable(v)):v=isKeyedIterable?keyedSeqFromValue(v):indexedSeqFromValue(Array.isArray(v)?v:[v]),v}).filter(function(v){return 0!==v.size});if(0===iters.length)return iterable;if(1===iters.length){var singleton=iters[0];if(singleton===iterable||isKeyedIterable&&isKeyed(singleton)||isIndexed(iterable)&&isIndexed(singleton))return singleton}var concatSeq=new ArraySeq(iters);return isKeyedIterable?concatSeq=concatSeq.toKeyedSeq():isIndexed(iterable)||(concatSeq=concatSeq.toSetSeq()),concatSeq=concatSeq.flatten(!0),concatSeq.size=iters.reduce(function(sum,seq){if(void 0!==sum){var size=seq.size;if(void 0!==size)return sum+size}},0),concatSeq}function flattenFactory(iterable,depth,useKeys){var flatSequence=makeSequence(iterable);return flatSequence.__iterateUncached=function(fn,reverse){function flatDeep(iter,currentDepth){var this$0=this;iter.__iterate(function(v,k){return(!depth||depth>currentDepth)&&isIterable(v)?flatDeep(v,currentDepth+1):fn(v,useKeys?k:iterations++,this$0)===!1&&(stopped=!0),!stopped},reverse)}var iterations=0,stopped=!1;return flatDeep(iterable,0),iterations},flatSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(type,reverse),stack=[],iterations=0;return new src_Iterator__Iterator(function(){for(;iterator;){var step=iterator.next();if(step.done===!1){var v=step.value;if(type===ITERATE_ENTRIES&&(v=v[1]),depth&&!(stack.length0}function zipWithFactory(keyIter,zipper,iters){var zipSequence=makeSequence(keyIter);return zipSequence.size=new ArraySeq(iters).map(function(i){return i.size}).min(),zipSequence.__iterate=function(fn,reverse){for(var step,iterator=this.__iterator(ITERATE_VALUES,reverse),iterations=0;!(step=iterator.next()).done&&fn(step.value,iterations++,this)!==!1;);return iterations},zipSequence.__iteratorUncached=function(type,reverse){var iterators=iters.map(function(i){return i=Iterable(i),getIterator(reverse?i.reverse():i)}),iterations=0,isDone=!1;return new src_Iterator__Iterator(function(){var steps;return isDone||(steps=iterators.map(function(i){return i.next()}),isDone=steps.some(function(s){return s.done})),isDone?iteratorDone():iteratorValue(type,iterations++,zipper.apply(null,steps.map(function(s){return s.value})))})},zipSequence}function reify(iter,seq){return isSeq(iter)?seq:iter.constructor(seq)}function validateEntry(entry){if(entry!==Object(entry))throw new TypeError("Expected [K, V] tuple: "+entry)}function resolveSize(iter){return assertNotInfinite(iter.size),ensureSize(iter)}function iterableClass(iterable){return isKeyed(iterable)?KeyedIterable:isIndexed(iterable)?IndexedIterable:SetIterable}function makeSequence(iterable){return Object.create((isKeyed(iterable)?KeyedSeq:isIndexed(iterable)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Seq.prototype.cacheResult.call(this)}function defaultComparator(a,b){return a>b?1:b>a?-1:0}function forceIterator(keyPath){var iter=getIterator(keyPath);if(!iter){if(!isArrayLike(keyPath))throw new TypeError("Expected iterable or array-like: "+keyPath);iter=getIterator(Iterable(keyPath))}return iter}function src_Map__Map(value){return null===value||void 0===value?emptyMap():isMap(value)?value:emptyMap().withMutations(function(map){var iter=KeyedIterable(value);assertNotInfinite(iter.size),iter.forEach(function(v,k){return map.set(k,v)})})}function isMap(maybeMap){return!(!maybeMap||!maybeMap[IS_MAP_SENTINEL])}function ArrayMapNode(ownerID,entries){this.ownerID=ownerID,this.entries=entries}function BitmapIndexedNode(ownerID,bitmap,nodes){this.ownerID=ownerID,this.bitmap=bitmap,this.nodes=nodes}function HashArrayMapNode(ownerID,count,nodes){this.ownerID=ownerID,this.count=count,this.nodes=nodes}function HashCollisionNode(ownerID,keyHash,entries){this.ownerID=ownerID,this.keyHash=keyHash,this.entries=entries}function ValueNode(ownerID,keyHash,entry){this.ownerID=ownerID,this.keyHash=keyHash,this.entry=entry}function MapIterator(map,type,reverse){this._type=type,this._reverse=reverse,this._stack=map._root&&mapIteratorFrame(map._root)}function mapIteratorValue(type,entry){return iteratorValue(type,entry[0],entry[1])}function mapIteratorFrame(node,prev){return{node:node,index:0,__prev:prev}}function makeMap(size,root,ownerID,hash){var map=Object.create(MapPrototype);return map.size=size,map._root=root,map.__ownerID=ownerID,map.__hash=hash,map.__altered=!1,map}function emptyMap(){return EMPTY_MAP||(EMPTY_MAP=makeMap(0))}function updateMap(map,k,v){var newRoot,newSize;if(map._root){var didChangeSize=MakeRef(CHANGE_LENGTH),didAlter=MakeRef(DID_ALTER);if(newRoot=updateNode(map._root,map.__ownerID,0,void 0,k,v,didChangeSize,didAlter),!didAlter.value)return map;newSize=map.size+(didChangeSize.value?v===NOT_SET?-1:1:0)}else{if(v===NOT_SET)return map;newSize=1,newRoot=new ArrayMapNode(map.__ownerID,[[k,v]])}return map.__ownerID?(map.size=newSize,map._root=newRoot,map.__hash=void 0,map.__altered=!0,map):newRoot?makeMap(newSize,newRoot):emptyMap()}function updateNode(node,ownerID,shift,keyHash,key,value,didChangeSize,didAlter){return node?node.update(ownerID,shift,keyHash,key,value,didChangeSize,didAlter):value===NOT_SET?node:(SetRef(didAlter),SetRef(didChangeSize),new ValueNode(ownerID,keyHash,[key,value]))}function isLeafNode(node){return node.constructor===ValueNode||node.constructor===HashCollisionNode}function mergeIntoNode(node,ownerID,shift,keyHash,entry){if(node.keyHash===keyHash)return new HashCollisionNode(ownerID,keyHash,[node.entry,entry]);var newNode,idx1=(0===shift?node.keyHash:node.keyHash>>>shift)&MASK,idx2=(0===shift?keyHash:keyHash>>>shift)&MASK,nodes=idx1===idx2?[mergeIntoNode(node,ownerID,shift+SHIFT,keyHash,entry)]:(newNode=new ValueNode(ownerID,keyHash,entry),idx2>idx1?[node,newNode]:[newNode,node]);return new BitmapIndexedNode(ownerID,1<ii;ii++,bit<<=1){var node=nodes[ii];void 0!==node&&ii!==excluding&&(bitmap|=bit,packedNodes[packedII++]=node)}return new BitmapIndexedNode(ownerID,bitmap,packedNodes)}function expandNodes(ownerID,nodes,bitmap,including,node){for(var count=0,expandedNodes=new Array(SIZE),ii=0;0!==bitmap;ii++,bitmap>>>=1)expandedNodes[ii]=1&bitmap?nodes[count++]:void 0;return expandedNodes[including]=node,new HashArrayMapNode(ownerID,count+1,expandedNodes)}function mergeIntoMapWith(map,merger,iterables){for(var iters=[],ii=0;ii>1&1431655765,x=(858993459&x)+(x>>2&858993459),x=x+(x>>4)&252645135,x+=x>>8,x+=x>>16,127&x}function setIn(array,idx,val,canEdit){var newArray=canEdit?array:arrCopy(array);return newArray[idx]=val,newArray}function spliceIn(array,idx,val,canEdit){var newLen=array.length+1;if(canEdit&&idx+1===newLen)return array[idx]=val,array;for(var newArray=new Array(newLen),after=0,ii=0;newLen>ii;ii++)ii===idx?(newArray[ii]=val,after=-1):newArray[ii]=array[ii+after];return newArray}function spliceOut(array,idx,canEdit){var newLen=array.length-1;if(canEdit&&idx===newLen)return array.pop(),array;for(var newArray=new Array(newLen),after=0,ii=0;newLen>ii;ii++)ii===idx&&(after=1),newArray[ii]=array[ii+after];return newArray}function List(value){var empty=emptyList();if(null===value||void 0===value)return empty;if(isList(value))return value;var iter=IndexedIterable(value),size=iter.size;return 0===size?empty:(assertNotInfinite(size),size>0&&SIZE>size?makeList(0,size,SHIFT,null,new VNode(iter.toArray())):empty.withMutations(function(list){list.setSize(size),iter.forEach(function(v,i){return list.set(i,v)})}))}function isList(maybeList){return!(!maybeList||!maybeList[IS_LIST_SENTINEL])}function VNode(array,ownerID){this.array=array,this.ownerID=ownerID}function iterateList(list,reverse){function iterateNodeOrLeaf(node,level,offset){return 0===level?iterateLeaf(node,offset):iterateNode(node,level,offset)}function iterateLeaf(node,offset){var array=offset===tailPos?tail&&tail.array:node&&node.array,from=offset>left?0:left-offset,to=right-offset;return to>SIZE&&(to=SIZE),function(){if(from===to)return DONE;var idx=reverse?--to:from++;return array&&array[idx]}}function iterateNode(node,level,offset){var values,array=node&&node.array,from=offset>left?0:left-offset>>level,to=(right-offset>>level)+1;return to>SIZE&&(to=SIZE),function(){for(;;){if(values){var value=values();if(value!==DONE)return value;values=null}if(from===to)return DONE;var idx=reverse?--to:from++;values=iterateNodeOrLeaf(array&&array[idx],level-SHIFT,offset+(idx<=list.size||0>index)return list.withMutations(function(list){0>index?setListBounds(list,index).set(0,value):setListBounds(list,0,index+1).set(index,value)});index+=list._origin;var newTail=list._tail,newRoot=list._root,didAlter=MakeRef(DID_ALTER);return index>=getTailOffset(list._capacity)?newTail=updateVNode(newTail,list.__ownerID,0,index,value,didAlter):newRoot=updateVNode(newRoot,list.__ownerID,list._level,index,value,didAlter),didAlter.value?list.__ownerID?(list._root=newRoot,list._tail=newTail,list.__hash=void 0,list.__altered=!0,list):makeList(list._origin,list._capacity,list._level,newRoot,newTail):list}function updateVNode(node,ownerID,level,index,value,didAlter){var idx=index>>>level&MASK,nodeHas=node&&idx0){var lowerNode=node&&node.array[idx],newLowerNode=updateVNode(lowerNode,ownerID,level-SHIFT,index,value,didAlter);return newLowerNode===lowerNode?node:(newNode=editableVNode(node,ownerID),newNode.array[idx]=newLowerNode,newNode)}return nodeHas&&node.array[idx]===value?node:(SetRef(didAlter),newNode=editableVNode(node,ownerID),void 0===value&&idx===newNode.array.length-1?newNode.array.pop():newNode.array[idx]=value,newNode)}function editableVNode(node,ownerID){return ownerID&&node&&ownerID===node.ownerID?node:new VNode(node?node.array.slice():[],ownerID)}function listNodeFor(list,rawIndex){if(rawIndex>=getTailOffset(list._capacity))return list._tail;if(rawIndex<1<0;)node=node.array[rawIndex>>>level&MASK],level-=SHIFT;return node}}function setListBounds(list,begin,end){var owner=list.__ownerID||new OwnerID,oldOrigin=list._origin,oldCapacity=list._capacity,newOrigin=oldOrigin+begin,newCapacity=void 0===end?oldCapacity:0>end?oldCapacity+end:oldOrigin+end;if(newOrigin===oldOrigin&&newCapacity===oldCapacity)return list;if(newOrigin>=newCapacity)return list.clear();for(var newLevel=list._level,newRoot=list._root,offsetShift=0;0>newOrigin+offsetShift;)newRoot=new VNode(newRoot&&newRoot.array.length?[void 0,newRoot]:[],owner),newLevel+=SHIFT,offsetShift+=1<=1<newTailOffset?listNodeFor(list,newCapacity-1):newTailOffset>oldTailOffset?new VNode([],owner):oldTail;if(oldTail&&newTailOffset>oldTailOffset&&oldCapacity>newOrigin&&oldTail.array.length){newRoot=editableVNode(newRoot,owner);for(var node=newRoot,level=newLevel;level>SHIFT;level-=SHIFT){var idx=oldTailOffset>>>level&MASK;node=node.array[idx]=editableVNode(node.array[idx],owner)}node.array[oldTailOffset>>>SHIFT&MASK]=oldTail}if(oldCapacity>newCapacity&&(newTail=newTail&&newTail.removeAfter(owner,0,newCapacity)),newOrigin>=newTailOffset)newOrigin-=newTailOffset,newCapacity-=newTailOffset,newLevel=SHIFT,newRoot=null,newTail=newTail&&newTail.removeBefore(owner,0,newOrigin);else if(newOrigin>oldOrigin||oldTailOffset>newTailOffset){for(offsetShift=0;newRoot;){var beginIndex=newOrigin>>>newLevel&MASK;if(beginIndex!==newTailOffset>>>newLevel&MASK)break;beginIndex&&(offsetShift+=(1<oldOrigin&&(newRoot=newRoot.removeBefore(owner,newLevel,newOrigin-offsetShift)),newRoot&&oldTailOffset>newTailOffset&&(newRoot=newRoot.removeAfter(owner,newLevel,newTailOffset-offsetShift)),offsetShift&&(newOrigin-=offsetShift,newCapacity-=offsetShift)}return list.__ownerID?(list.size=newCapacity-newOrigin,list._origin=newOrigin,list._capacity=newCapacity,list._level=newLevel,list._root=newRoot,list._tail=newTail,list.__hash=void 0,list.__altered=!0,list):makeList(newOrigin,newCapacity,newLevel,newRoot,newTail)}function mergeIntoListWith(list,merger,iterables){for(var iters=[],maxSize=0,ii=0;iimaxSize&&(maxSize=iter.size),isIterable(value)||(iter=iter.map(function(v){return fromJS(v)})),iters.push(iter)}return maxSize>list.size&&(list=list.setSize(maxSize)),mergeIntoCollectionWith(list,merger,iters)}function getTailOffset(size){return SIZE>size?0:size-1>>>SHIFT<=SIZE&&list.size>=2*map.size?(newList=list.filter(function(entry,idx){return void 0!==entry&&i!==idx}),newMap=newList.toKeyedSeq().map(function(entry){return entry[0]}).flip().toMap(),omap.__ownerID&&(newMap.__ownerID=newList.__ownerID=omap.__ownerID)):(newMap=map.remove(k),newList=i===list.size-1?list.pop():list.set(i,void 0))}else if(has){if(v===list.get(i)[1])return omap;newMap=map,newList=list.set(i,[k,v])}else newMap=map.set(k,list.size),newList=list.set(list.size,[k,v]);return omap.__ownerID?(omap.size=newMap.size,omap._map=newMap,omap._list=newList,omap.__hash=void 0,omap):makeOrderedMap(newMap,newList)}function Stack(value){return null===value||void 0===value?emptyStack():isStack(value)?value:emptyStack().unshiftAll(value)}function isStack(maybeStack){return!(!maybeStack||!maybeStack[IS_STACK_SENTINEL])}function makeStack(size,head,ownerID,hash){var map=Object.create(StackPrototype);return map.size=size,map._head=head,map.__ownerID=ownerID,map.__hash=hash,map.__altered=!1,map}function emptyStack(){return EMPTY_STACK||(EMPTY_STACK=makeStack(0))}function src_Set__Set(value){return null===value||void 0===value?emptySet():isSet(value)?value:emptySet().withMutations(function(set){var iter=SetIterable(value);assertNotInfinite(iter.size),iter.forEach(function(v){return set.add(v)})})}function isSet(maybeSet){return!(!maybeSet||!maybeSet[IS_SET_SENTINEL])}function updateSet(set,newMap){return set.__ownerID?(set.size=newMap.size,set._map=newMap,set):newMap===set._map?set:0===newMap.size?set.__empty():set.__make(newMap)}function makeSet(map,ownerID){var set=Object.create(SetPrototype);return set.size=map?map.size:0,set._map=map,set.__ownerID=ownerID,set}function emptySet(){return EMPTY_SET||(EMPTY_SET=makeSet(emptyMap()))}function OrderedSet(value){return null===value||void 0===value?emptyOrderedSet():isOrderedSet(value)?value:emptyOrderedSet().withMutations(function(set){var iter=SetIterable(value);assertNotInfinite(iter.size),iter.forEach(function(v){return set.add(v)})})}function isOrderedSet(maybeOrderedSet){return isSet(maybeOrderedSet)&&isOrdered(maybeOrderedSet)}function makeOrderedSet(map,ownerID){var set=Object.create(OrderedSetPrototype);return set.size=map?map.size:0,set._map=map,set.__ownerID=ownerID,set}function emptyOrderedSet(){return EMPTY_ORDERED_SET||(EMPTY_ORDERED_SET=makeOrderedSet(emptyOrderedMap()))}function Record(defaultValues,name){var hasInitialized,RecordType=function(values){if(values instanceof RecordType)return values;if(!(this instanceof RecordType))return new RecordType(values);if(!hasInitialized){hasInitialized=!0;var keys=Object.keys(defaultValues);setProps(RecordTypePrototype,keys),RecordTypePrototype.size=keys.length,RecordTypePrototype._name=name,RecordTypePrototype._keys=keys,RecordTypePrototype._defaultValues=defaultValues}this._map=src_Map__Map(values)},RecordTypePrototype=RecordType.prototype=Object.create(RecordPrototype);return RecordTypePrototype.constructor=RecordType,RecordType}function makeRecord(likeRecord,map,ownerID){var record=Object.create(Object.getPrototypeOf(likeRecord));return record._map=map,record.__ownerID=ownerID,record}function recordName(record){return record._name||record.constructor.name||"Record"}function setProps(prototype,names){try{names.forEach(setProp.bind(void 0,prototype))}catch(error){}}function setProp(prototype,name){Object.defineProperty(prototype,name,{get:function(){return this.get(name)},set:function(value){invariant(this.__ownerID,"Cannot set on an immutable record."),this.set(name,value)}})}function deepEqual(a,b){if(a===b)return!0;if(!isIterable(b)||void 0!==a.size&&void 0!==b.size&&a.size!==b.size||void 0!==a.__hash&&void 0!==b.__hash&&a.__hash!==b.__hash||isKeyed(a)!==isKeyed(b)||isIndexed(a)!==isIndexed(b)||isOrdered(a)!==isOrdered(b))return!1;if(0===a.size&&0===b.size)return!0;var notAssociative=!isAssociative(a);if(isOrdered(a)){var entries=a.entries();return b.every(function(v,k){var entry=entries.next().value;return entry&&is(entry[1],v)&&(notAssociative||is(entry[0],k))})&&entries.next().done}var flipped=!1;if(void 0===a.size)if(void 0===b.size)"function"==typeof a.cacheResult&&a.cacheResult();else{flipped=!0;var _=a;a=b,b=_}var allEqual=!0,bSize=b.__iterate(function(v,k){return(notAssociative?a.has(v):flipped?is(v,a.get(k,NOT_SET)):is(a.get(k,NOT_SET),v))?void 0:(allEqual=!1,!1)});return allEqual&&a.size===bSize}function Range(start,end,step){if(!(this instanceof Range))return new Range(start,end,step);if(invariant(0!==step,"Cannot step a Range by 0"),start=start||0,void 0===end&&(end=1/0),step=void 0===step?1:Math.abs(step),start>end&&(step=-step),this._start=start,this._end=end,this._step=step,this.size=Math.max(0,Math.ceil((end-start)/step-1)+1),0===this.size){if(EMPTY_RANGE)return EMPTY_RANGE;EMPTY_RANGE=this}}function Repeat(value,times){if(!(this instanceof Repeat))return new Repeat(value,times);if(this._value=value,this.size=void 0===times?1/0:Math.max(0,times),0===this.size){if(EMPTY_REPEAT)return EMPTY_REPEAT;EMPTY_REPEAT=this}}function mixin(ctor,methods){var keyCopier=function(key){ctor.prototype[key]=methods[key]};return Object.keys(methods).forEach(keyCopier),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(methods).forEach(keyCopier),ctor}function keyMapper(v,k){return k}function entryMapper(v,k){return[k,v]}function not(predicate){return function(){return!predicate.apply(this,arguments)}}function neg(predicate){return function(){return-predicate.apply(this,arguments)}}function quoteString(value){return"string"==typeof value?JSON.stringify(value):value}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(a,b){return b>a?1:a>b?-1:0}function hashIterable(iterable){if(1/0===iterable.size)return 0;var ordered=isOrdered(iterable),keyed=isKeyed(iterable),h=ordered?1:0,size=iterable.__iterate(keyed?ordered?function(v,k){h=31*h+hashMerge(hash(v),hash(k))|0}:function(v,k){h=h+hashMerge(hash(v),hash(k))|0}:ordered?function(v){h=31*h+hash(v)|0}:function(v){h=h+hash(v)|0});return murmurHashOfSize(size,h)}function murmurHashOfSize(size,h){return h=src_Math__imul(h,3432918353),h=src_Math__imul(h<<15|h>>>-15,461845907),h=src_Math__imul(h<<13|h>>>-13,5),h=(h+3864292196|0)^size,h=src_Math__imul(h^h>>>16,2246822507),h=src_Math__imul(h^h>>>13,3266489909),h=smi(h^h>>>16)}function hashMerge(a,b){return a^b+2654435769+(a<<6)+(a>>2)|0}var SLICE$0=Array.prototype.slice,DELETE="delete",SHIFT=5,SIZE=1<=ii;ii++)if(fn(array[reverse?maxIndex-ii:ii],ii,this)===!1)return ii+1;return ii},ArraySeq.prototype.__iterator=function(type,reverse){var array=this._array,maxIndex=array.length-1,ii=0;return new src_Iterator__Iterator(function(){return ii>maxIndex?iteratorDone():iteratorValue(type,ii,array[reverse?maxIndex-ii++:ii++])})},createClass(ObjectSeq,KeyedSeq),ObjectSeq.prototype.get=function(key,notSetValue){return void 0===notSetValue||this.has(key)?this._object[key]:notSetValue},ObjectSeq.prototype.has=function(key){return this._object.hasOwnProperty(key)},ObjectSeq.prototype.__iterate=function(fn,reverse){for(var object=this._object,keys=this._keys,maxIndex=keys.length-1,ii=0;maxIndex>=ii;ii++){var key=keys[reverse?maxIndex-ii:ii];if(fn(object[key],key,this)===!1)return ii+1}return ii},ObjectSeq.prototype.__iterator=function(type,reverse){var object=this._object,keys=this._keys,maxIndex=keys.length-1,ii=0;return new src_Iterator__Iterator(function(){var key=keys[reverse?maxIndex-ii:ii];return ii++>maxIndex?iteratorDone():iteratorValue(type,key,object[key])})},ObjectSeq.prototype[IS_ORDERED_SENTINEL]=!0,createClass(IterableSeq,IndexedSeq),IterableSeq.prototype.__iterateUncached=function(fn,reverse){if(reverse)return this.cacheResult().__iterate(fn,reverse);var iterable=this._iterable,iterator=getIterator(iterable),iterations=0;if(isIterator(iterator))for(var step;!(step=iterator.next()).done&&fn(step.value,iterations++,this)!==!1;);return iterations},IterableSeq.prototype.__iteratorUncached=function(type,reverse){if(reverse)return this.cacheResult().__iterator(type,reverse);var iterable=this._iterable,iterator=getIterator(iterable);if(!isIterator(iterator))return new src_Iterator__Iterator(iteratorDone);var iterations=0;return new src_Iterator__Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,iterations++,step.value)})},createClass(IteratorSeq,IndexedSeq),IteratorSeq.prototype.__iterateUncached=function(fn,reverse){if(reverse)return this.cacheResult().__iterate(fn,reverse);for(var iterator=this._iterator,cache=this._iteratorCache,iterations=0;iterations=cache.length){var step=iterator.next();if(step.done)return step;cache[iterations]=step.value}return iteratorValue(type,iterations,cache[iterations++])})};var EMPTY_SEQ;createClass(Collection,Iterable),createClass(KeyedCollection,Collection),createClass(IndexedCollection,Collection),createClass(SetCollection,Collection),Collection.Keyed=KeyedCollection,Collection.Indexed=IndexedCollection,Collection.Set=SetCollection;var weakMap,src_Math__imul="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(a,b){a=0|a,b=0|b;var c=65535&a,d=65535&b;return c*d+((a>>>16)*d+c*(b>>>16)<<16>>>0)|0},isExtensible=Object.isExtensible,canDefineProperty=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),usingWeakMap="function"==typeof WeakMap;usingWeakMap&&(weakMap=new WeakMap);var objHashUID=0,UID_HASH_KEY="__immutablehash__";"function"==typeof Symbol&&(UID_HASH_KEY=Symbol(UID_HASH_KEY));var STRING_HASH_CACHE_MIN_STRLEN=16,STRING_HASH_CACHE_MAX_SIZE=255,STRING_HASH_CACHE_SIZE=0,stringHashCache={};createClass(ToKeyedSequence,KeyedSeq),ToKeyedSequence.prototype.get=function(key,notSetValue){return this._iter.get(key,notSetValue)},ToKeyedSequence.prototype.has=function(key){return this._iter.has(key)},ToKeyedSequence.prototype.valueSeq=function(){return this._iter.valueSeq()},ToKeyedSequence.prototype.reverse=function(){var this$0=this,reversedSequence=reverseFactory(this,!0);return this._useKeys||(reversedSequence.valueSeq=function(){return this$0._iter.toSeq().reverse()}),reversedSequence},ToKeyedSequence.prototype.map=function(mapper,context){var this$0=this,mappedSequence=mapFactory(this,mapper,context);return this._useKeys||(mappedSequence.valueSeq=function(){return this$0._iter.toSeq().map(mapper,context)}),mappedSequence},ToKeyedSequence.prototype.__iterate=function(fn,reverse){var ii,this$0=this;return this._iter.__iterate(this._useKeys?function(v,k){return fn(v,k,this$0)}:(ii=reverse?resolveSize(this):0,function(v){return fn(v,reverse?--ii:ii++,this$0)}),reverse)},ToKeyedSequence.prototype.__iterator=function(type,reverse){if(this._useKeys)return this._iter.__iterator(type,reverse);var iterator=this._iter.__iterator(ITERATE_VALUES,reverse),ii=reverse?resolveSize(this):0;return new src_Iterator__Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,reverse?--ii:ii++,step.value,step)})},ToKeyedSequence.prototype[IS_ORDERED_SENTINEL]=!0,createClass(ToIndexedSequence,IndexedSeq),ToIndexedSequence.prototype.includes=function(value){return this._iter.includes(value)},ToIndexedSequence.prototype.__iterate=function(fn,reverse){var this$0=this,iterations=0;return this._iter.__iterate(function(v){return fn(v,iterations++,this$0)},reverse)},ToIndexedSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse),iterations=0;return new src_Iterator__Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,iterations++,step.value,step)})},createClass(ToSetSequence,SetSeq),ToSetSequence.prototype.has=function(key){return this._iter.includes(key)},ToSetSequence.prototype.__iterate=function(fn,reverse){var this$0=this;return this._iter.__iterate(function(v){return fn(v,v,this$0)},reverse)},ToSetSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);return new src_Iterator__Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,step.value,step.value,step)})},createClass(FromEntriesSequence,KeyedSeq),FromEntriesSequence.prototype.entrySeq=function(){return this._iter.toSeq()},FromEntriesSequence.prototype.__iterate=function(fn,reverse){var this$0=this;return this._iter.__iterate(function(entry){if(entry){validateEntry(entry);var indexedIterable=isIterable(entry);return fn(indexedIterable?entry.get(1):entry[1],indexedIterable?entry.get(0):entry[0],this$0)}},reverse)},FromEntriesSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);return new src_Iterator__Iterator(function(){for(;;){var step=iterator.next();if(step.done)return step;var entry=step.value;if(entry){validateEntry(entry);var indexedIterable=isIterable(entry);return iteratorValue(type,indexedIterable?entry.get(0):entry[0],indexedIterable?entry.get(1):entry[1],step)}}})},ToIndexedSequence.prototype.cacheResult=ToKeyedSequence.prototype.cacheResult=ToSetSequence.prototype.cacheResult=FromEntriesSequence.prototype.cacheResult=cacheResultThrough,createClass(src_Map__Map,KeyedCollection),src_Map__Map.prototype.toString=function(){return this.__toString("Map {","}")},src_Map__Map.prototype.get=function(k,notSetValue){return this._root?this._root.get(0,void 0,k,notSetValue):notSetValue},src_Map__Map.prototype.set=function(k,v){return updateMap(this,k,v)},src_Map__Map.prototype.setIn=function(keyPath,v){return this.updateIn(keyPath,NOT_SET,function(){return v})},src_Map__Map.prototype.remove=function(k){return updateMap(this,k,NOT_SET)},src_Map__Map.prototype.deleteIn=function(keyPath){return this.updateIn(keyPath,function(){return NOT_SET})},src_Map__Map.prototype.update=function(k,notSetValue,updater){return 1===arguments.length?k(this):this.updateIn([k],notSetValue,updater)},src_Map__Map.prototype.updateIn=function(keyPath,notSetValue,updater){updater||(updater=notSetValue,notSetValue=void 0);var updatedValue=updateInDeepMap(this,forceIterator(keyPath),notSetValue,updater);return updatedValue===NOT_SET?void 0:updatedValue},src_Map__Map.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):emptyMap()},src_Map__Map.prototype.merge=function(){return mergeIntoMapWith(this,void 0,arguments)},src_Map__Map.prototype.mergeWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoMapWith(this,merger,iters)},src_Map__Map.prototype.mergeIn=function(keyPath){var iters=SLICE$0.call(arguments,1);return this.updateIn(keyPath,emptyMap(),function(m){return"function"==typeof m.merge?m.merge.apply(m,iters):iters[iters.length-1]})},src_Map__Map.prototype.mergeDeep=function(){return mergeIntoMapWith(this,deepMerger(void 0),arguments)},src_Map__Map.prototype.mergeDeepWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoMapWith(this,deepMerger(merger),iters)},src_Map__Map.prototype.mergeDeepIn=function(keyPath){var iters=SLICE$0.call(arguments,1);return this.updateIn(keyPath,emptyMap(),function(m){return"function"==typeof m.mergeDeep?m.mergeDeep.apply(m,iters):iters[iters.length-1]})},src_Map__Map.prototype.sort=function(comparator){return OrderedMap(sortFactory(this,comparator))},src_Map__Map.prototype.sortBy=function(mapper,comparator){return OrderedMap(sortFactory(this,comparator,mapper))},src_Map__Map.prototype.withMutations=function(fn){var mutable=this.asMutable();return fn(mutable),mutable.wasAltered()?mutable.__ensureOwner(this.__ownerID):this},src_Map__Map.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)},src_Map__Map.prototype.asImmutable=function(){return this.__ensureOwner()},src_Map__Map.prototype.wasAltered=function(){return this.__altered},src_Map__Map.prototype.__iterator=function(type,reverse){return new MapIterator(this,type,reverse)},src_Map__Map.prototype.__iterate=function(fn,reverse){var this$0=this,iterations=0;return this._root&&this._root.iterate(function(entry){return iterations++,fn(entry[1],entry[0],this$0)},reverse),iterations},src_Map__Map.prototype.__ensureOwner=function(ownerID){return ownerID===this.__ownerID?this:ownerID?makeMap(this.size,this._root,ownerID,this.__hash):(this.__ownerID=ownerID,this.__altered=!1,this)},src_Map__Map.isMap=isMap;var IS_MAP_SENTINEL="@@__IMMUTABLE_MAP__@@",MapPrototype=src_Map__Map.prototype;MapPrototype[IS_MAP_SENTINEL]=!0,MapPrototype[DELETE]=MapPrototype.remove,MapPrototype.removeIn=MapPrototype.deleteIn,ArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){for(var entries=this.entries,ii=0,len=entries.length;len>ii;ii++)if(is(key,entries[ii][0]))return entries[ii][1];return notSetValue},ArrayMapNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){for(var removed=value===NOT_SET,entries=this.entries,idx=0,len=entries.length;len>idx&&!is(key,entries[idx][0]);idx++);var exists=len>idx;if(exists?entries[idx][1]===value:removed)return this;if(SetRef(didAlter),(removed||!exists)&&SetRef(didChangeSize),!removed||1!==entries.length){if(!exists&&!removed&&entries.length>=MAX_ARRAY_MAP_SIZE)return createNodes(ownerID,entries,key,value);var isEditable=ownerID&&ownerID===this.ownerID,newEntries=isEditable?entries:arrCopy(entries);return exists?removed?idx===len-1?newEntries.pop():newEntries[idx]=newEntries.pop():newEntries[idx]=[key,value]:newEntries.push([key,value]),isEditable?(this.entries=newEntries,this):new ArrayMapNode(ownerID,newEntries)}},BitmapIndexedNode.prototype.get=function(shift,keyHash,key,notSetValue){void 0===keyHash&&(keyHash=hash(key));var bit=1<<((0===shift?keyHash:keyHash>>>shift)&MASK),bitmap=this.bitmap;return 0===(bitmap&bit)?notSetValue:this.nodes[popCount(bitmap&bit-1)].get(shift+SHIFT,keyHash,key,notSetValue)},BitmapIndexedNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){void 0===keyHash&&(keyHash=hash(key));var keyHashFrag=(0===shift?keyHash:keyHash>>>shift)&MASK,bit=1<=MAX_BITMAP_INDEXED_SIZE)return expandNodes(ownerID,nodes,bitmap,keyHashFrag,newNode);if(exists&&!newNode&&2===nodes.length&&isLeafNode(nodes[1^idx]))return nodes[1^idx];if(exists&&newNode&&1===nodes.length&&isLeafNode(newNode))return newNode;var isEditable=ownerID&&ownerID===this.ownerID,newBitmap=exists?newNode?bitmap:bitmap^bit:bitmap|bit,newNodes=exists?newNode?setIn(nodes,idx,newNode,isEditable):spliceOut(nodes,idx,isEditable):spliceIn(nodes,idx,newNode,isEditable);return isEditable?(this.bitmap=newBitmap,this.nodes=newNodes,this):new BitmapIndexedNode(ownerID,newBitmap,newNodes)},HashArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){void 0===keyHash&&(keyHash=hash(key));var idx=(0===shift?keyHash:keyHash>>>shift)&MASK,node=this.nodes[idx];return node?node.get(shift+SHIFT,keyHash,key,notSetValue):notSetValue},HashArrayMapNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){void 0===keyHash&&(keyHash=hash(key));var idx=(0===shift?keyHash:keyHash>>>shift)&MASK,removed=value===NOT_SET,nodes=this.nodes,node=nodes[idx];if(removed&&!node)return this;var newNode=updateNode(node,ownerID,shift+SHIFT,keyHash,key,value,didChangeSize,didAlter);if(newNode===node)return this;var newCount=this.count;if(node){if(!newNode&&(newCount--,MIN_HASH_ARRAY_MAP_SIZE>newCount))return packNodes(ownerID,nodes,newCount,idx)}else newCount++;var isEditable=ownerID&&ownerID===this.ownerID,newNodes=setIn(nodes,idx,newNode,isEditable);return isEditable?(this.count=newCount,this.nodes=newNodes,this):new HashArrayMapNode(ownerID,newCount,newNodes)},HashCollisionNode.prototype.get=function(shift,keyHash,key,notSetValue){for(var entries=this.entries,ii=0,len=entries.length;len>ii;ii++)if(is(key,entries[ii][0]))return entries[ii][1];return notSetValue},HashCollisionNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){void 0===keyHash&&(keyHash=hash(key));var removed=value===NOT_SET;if(keyHash!==this.keyHash)return removed?this:(SetRef(didAlter),SetRef(didChangeSize),mergeIntoNode(this,ownerID,shift,keyHash,[key,value]));for(var entries=this.entries,idx=0,len=entries.length;len>idx&&!is(key,entries[idx][0]);idx++);var exists=len>idx;if(exists?entries[idx][1]===value:removed)return this;if(SetRef(didAlter),(removed||!exists)&&SetRef(didChangeSize),removed&&2===len)return new ValueNode(ownerID,this.keyHash,entries[1^idx]);var isEditable=ownerID&&ownerID===this.ownerID,newEntries=isEditable?entries:arrCopy(entries);return exists?removed?idx===len-1?newEntries.pop():newEntries[idx]=newEntries.pop():newEntries[idx]=[key,value]:newEntries.push([key,value]),isEditable?(this.entries=newEntries,this):new HashCollisionNode(ownerID,this.keyHash,newEntries)},ValueNode.prototype.get=function(shift,keyHash,key,notSetValue){return is(key,this.entry[0])?this.entry[1]:notSetValue},ValueNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){var removed=value===NOT_SET,keyMatch=is(key,this.entry[0]);return(keyMatch?value===this.entry[1]:removed)?this:(SetRef(didAlter),removed?void SetRef(didChangeSize):keyMatch?ownerID&&ownerID===this.ownerID?(this.entry[1]=value,this):new ValueNode(ownerID,this.keyHash,[key,value]):(SetRef(didChangeSize),mergeIntoNode(this,ownerID,shift,hash(key),[key,value])))},ArrayMapNode.prototype.iterate=HashCollisionNode.prototype.iterate=function(fn,reverse){for(var entries=this.entries,ii=0,maxIndex=entries.length-1;maxIndex>=ii;ii++)if(fn(entries[reverse?maxIndex-ii:ii])===!1)return!1},BitmapIndexedNode.prototype.iterate=HashArrayMapNode.prototype.iterate=function(fn,reverse){for(var nodes=this.nodes,ii=0,maxIndex=nodes.length-1;maxIndex>=ii;ii++){var node=nodes[reverse?maxIndex-ii:ii];if(node&&node.iterate(fn,reverse)===!1)return!1}},ValueNode.prototype.iterate=function(fn){return fn(this.entry)},createClass(MapIterator,src_Iterator__Iterator),MapIterator.prototype.next=function(){for(var type=this._type,stack=this._stack;stack;){var maxIndex,node=stack.node,index=stack.index++;if(node.entry){if(0===index)return mapIteratorValue(type,node.entry)}else if(node.entries){if(maxIndex=node.entries.length-1,maxIndex>=index)return mapIteratorValue(type,node.entries[this._reverse?maxIndex-index:index])}else if(maxIndex=node.nodes.length-1,maxIndex>=index){var subNode=node.nodes[this._reverse?maxIndex-index:index];if(subNode){if(subNode.entry)return mapIteratorValue(type,subNode.entry);stack=this._stack=mapIteratorFrame(subNode,stack)}continue}stack=this._stack=this._stack.__prev}return iteratorDone()};var EMPTY_MAP,MAX_ARRAY_MAP_SIZE=SIZE/4,MAX_BITMAP_INDEXED_SIZE=SIZE/2,MIN_HASH_ARRAY_MAP_SIZE=SIZE/4;createClass(List,IndexedCollection),List.of=function(){return this(arguments)},List.prototype.toString=function(){return this.__toString("List [","]")},List.prototype.get=function(index,notSetValue){if(index=wrapIndex(this,index),0>index||index>=this.size)return notSetValue;index+=this._origin;var node=listNodeFor(this,index);return node&&node.array[index&MASK]},List.prototype.set=function(index,value){return updateList(this,index,value)},List.prototype.remove=function(index){return this.has(index)?0===index?this.shift():index===this.size-1?this.pop():this.splice(index,1):this},List.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=SHIFT,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):emptyList()},List.prototype.push=function(){var values=arguments,oldSize=this.size;return this.withMutations(function(list){setListBounds(list,0,oldSize+values.length);for(var ii=0;ii>>level&MASK;if(originIndex>=this.array.length)return new VNode([],ownerID);var newChild,removingFirst=0===originIndex;if(level>0){var oldChild=this.array[originIndex];if(newChild=oldChild&&oldChild.removeBefore(ownerID,level-SHIFT,index),newChild===oldChild&&removingFirst)return this}if(removingFirst&&!newChild)return this;var editable=editableVNode(this,ownerID);if(!removingFirst)for(var ii=0;originIndex>ii;ii++)editable.array[ii]=void 0;return newChild&&(editable.array[originIndex]=newChild),editable},VNode.prototype.removeAfter=function(ownerID,level,index){if(index===level?1<>>level&MASK;if(sizeIndex>=this.array.length)return this;var newChild,removingLast=sizeIndex===this.array.length-1;if(level>0){var oldChild=this.array[sizeIndex];if(newChild=oldChild&&oldChild.removeAfter(ownerID,level-SHIFT,index),newChild===oldChild&&removingLast)return this}if(removingLast&&!newChild)return this;var editable=editableVNode(this,ownerID);return removingLast||editable.array.pop(),newChild&&(editable.array[sizeIndex]=newChild),editable};var EMPTY_LIST,DONE={};createClass(OrderedMap,src_Map__Map),OrderedMap.of=function(){return this(arguments)},OrderedMap.prototype.toString=function(){return this.__toString("OrderedMap {","}")},OrderedMap.prototype.get=function(k,notSetValue){var index=this._map.get(k);return void 0!==index?this._list.get(index)[1]:notSetValue},OrderedMap.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):emptyOrderedMap()},OrderedMap.prototype.set=function(k,v){return updateOrderedMap(this,k,v)},OrderedMap.prototype.remove=function(k){return updateOrderedMap(this,k,NOT_SET)},OrderedMap.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},OrderedMap.prototype.__iterate=function(fn,reverse){var this$0=this;return this._list.__iterate(function(entry){return entry&&fn(entry[1],entry[0],this$0)},reverse)},OrderedMap.prototype.__iterator=function(type,reverse){return this._list.fromEntrySeq().__iterator(type,reverse)},OrderedMap.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID)return this;var newMap=this._map.__ensureOwner(ownerID),newList=this._list.__ensureOwner(ownerID);return ownerID?makeOrderedMap(newMap,newList,ownerID,this.__hash):(this.__ownerID=ownerID,this._map=newMap,this._list=newList,this)},OrderedMap.isOrderedMap=isOrderedMap,OrderedMap.prototype[IS_ORDERED_SENTINEL]=!0,OrderedMap.prototype[DELETE]=OrderedMap.prototype.remove;var EMPTY_ORDERED_MAP;createClass(Stack,IndexedCollection),Stack.of=function(){return this(arguments)},Stack.prototype.toString=function(){return this.__toString("Stack [","]")},Stack.prototype.get=function(index,notSetValue){var head=this._head;for(index=wrapIndex(this,index);head&&index--;)head=head.next;return head?head.value:notSetValue},Stack.prototype.peek=function(){return this._head&&this._head.value},Stack.prototype.push=function(){if(0===arguments.length)return this;for(var newSize=this.size+arguments.length,head=this._head,ii=arguments.length-1;ii>=0;ii--)head={value:arguments[ii],next:head};return this.__ownerID?(this.size=newSize,this._head=head,this.__hash=void 0,this.__altered=!0,this):makeStack(newSize,head)},Stack.prototype.pushAll=function(iter){if(iter=IndexedIterable(iter),0===iter.size)return this;assertNotInfinite(iter.size);var newSize=this.size,head=this._head;return iter.reverse().forEach(function(value){newSize++,head={value:value,next:head}}),this.__ownerID?(this.size=newSize,this._head=head,this.__hash=void 0,this.__altered=!0,this):makeStack(newSize,head)},Stack.prototype.pop=function(){return this.slice(1)},Stack.prototype.unshift=function(){return this.push.apply(this,arguments)},Stack.prototype.unshiftAll=function(iter){return this.pushAll(iter)},Stack.prototype.shift=function(){return this.pop.apply(this,arguments)},Stack.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):emptyStack()},Stack.prototype.slice=function(begin,end){if(wholeSlice(begin,end,this.size))return this;var resolvedBegin=resolveBegin(begin,this.size),resolvedEnd=resolveEnd(end,this.size);if(resolvedEnd!==this.size)return IndexedCollection.prototype.slice.call(this,begin,end);for(var newSize=this.size-resolvedBegin,head=this._head;resolvedBegin--;)head=head.next;return this.__ownerID?(this.size=newSize,this._head=head,this.__hash=void 0,this.__altered=!0,this):makeStack(newSize,head)},Stack.prototype.__ensureOwner=function(ownerID){return ownerID===this.__ownerID?this:ownerID?makeStack(this.size,this._head,ownerID,this.__hash):(this.__ownerID=ownerID,this.__altered=!1,this)},Stack.prototype.__iterate=function(fn,reverse){if(reverse)return this.reverse().__iterate(fn);for(var iterations=0,node=this._head;node&&fn(node.value,iterations++,this)!==!1;)node=node.next;return iterations},Stack.prototype.__iterator=function(type,reverse){if(reverse)return this.reverse().__iterator(type);var iterations=0,node=this._head;return new src_Iterator__Iterator(function(){if(node){var value=node.value;return node=node.next,iteratorValue(type,iterations++,value)}return iteratorDone()})},Stack.isStack=isStack;var IS_STACK_SENTINEL="@@__IMMUTABLE_STACK__@@",StackPrototype=Stack.prototype;StackPrototype[IS_STACK_SENTINEL]=!0,StackPrototype.withMutations=MapPrototype.withMutations,StackPrototype.asMutable=MapPrototype.asMutable,StackPrototype.asImmutable=MapPrototype.asImmutable,StackPrototype.wasAltered=MapPrototype.wasAltered;var EMPTY_STACK;createClass(src_Set__Set,SetCollection),src_Set__Set.of=function(){return this(arguments)},src_Set__Set.fromKeys=function(value){return this(KeyedIterable(value).keySeq())},src_Set__Set.prototype.toString=function(){return this.__toString("Set {","}")},src_Set__Set.prototype.has=function(value){return this._map.has(value)},src_Set__Set.prototype.add=function(value){return updateSet(this,this._map.set(value,!0))},src_Set__Set.prototype.remove=function(value){return updateSet(this,this._map.remove(value))},src_Set__Set.prototype.clear=function(){return updateSet(this,this._map.clear())},src_Set__Set.prototype.union=function(){var iters=SLICE$0.call(arguments,0);return iters=iters.filter(function(x){return 0!==x.size}),0===iters.length?this:0!==this.size||this.__ownerID||1!==iters.length?this.withMutations(function(set){for(var ii=0;ii1?" by "+this._step:"")+" ]"},Range.prototype.get=function(index,notSetValue){return this.has(index)?this._start+wrapIndex(this,index)*this._step:notSetValue},Range.prototype.includes=function(searchValue){var possibleIndex=(searchValue-this._start)/this._step;return possibleIndex>=0&&possibleIndex=end?new Range(0,0):new Range(this.get(begin,this._end),this.get(end,this._end),this._step))},Range.prototype.indexOf=function(searchValue){var offsetValue=searchValue-this._start;if(offsetValue%this._step===0){var index=offsetValue/this._step;if(index>=0&&index=ii;ii++){if(fn(value,ii,this)===!1)return ii+1;value+=reverse?-step:step}return ii},Range.prototype.__iterator=function(type,reverse){var maxIndex=this.size-1,step=this._step,value=reverse?this._start+maxIndex*step:this._start,ii=0;return new src_Iterator__Iterator(function(){var v=value;return value+=reverse?-step:step,ii>maxIndex?iteratorDone():iteratorValue(type,ii++,v)})},Range.prototype.equals=function(other){return other instanceof Range?this._start===other._start&&this._end===other._end&&this._step===other._step:deepEqual(this,other)};var EMPTY_RANGE;createClass(Repeat,IndexedSeq),Repeat.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Repeat.prototype.get=function(index,notSetValue){return this.has(index)?this._value:notSetValue},Repeat.prototype.includes=function(searchValue){return is(this._value,searchValue)},Repeat.prototype.slice=function(begin,end){var size=this.size;return wholeSlice(begin,end,size)?this:new Repeat(this._value,resolveEnd(end,size)-resolveBegin(begin,size))},Repeat.prototype.reverse=function(){return this},Repeat.prototype.indexOf=function(searchValue){return is(this._value,searchValue)?0:-1},Repeat.prototype.lastIndexOf=function(searchValue){return is(this._value,searchValue)?this.size:-1},Repeat.prototype.__iterate=function(fn){for(var ii=0;iiindex||1/0===this.size||void 0!==this.size&&index>this.size?notSetValue:this.find(function(_,key){return key===index},void 0,notSetValue)},has:function(index){return index=wrapIndex(this,index),index>=0&&(void 0!==this.size?1/0===this.size||index=0)&&focusable(element,!isTabIndexNaN)}}),$("").outerWidth(1).jquery||$.each(["Width","Height"],function(i,name){function reduce(elem,size,border,margin){return $.each(side,function(){size-=parseFloat($.css(elem,"padding"+this))||0,border&&(size-=parseFloat($.css(elem,"border"+this+"Width"))||0),margin&&(size-=parseFloat($.css(elem,"margin"+this))||0)}),size}var side="Width"===name?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};$.fn["inner"+name]=function(size){return void 0===size?orig["inner"+name].call(this):this.each(function(){$(this).css(type,reduce(this,size)+"px")})},$.fn["outer"+name]=function(size,margin){return"number"!=typeof size?orig["outer"+name].call(this,size):this.each(function(){$(this).css(type,reduce(this,size,!0,margin)+"px")})}}),$.fn.addBack||($.fn.addBack=function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}),$("").data("a-b","a").removeData("a-b").data("a-b")&&($.fn.removeData=function(removeData){return function(key){return arguments.length?removeData.call(this,$.camelCase(key)):removeData.call(this)}}($.fn.removeData)),$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),$.fn.extend({focus:function(orig){return function(delay,fn){return"number"==typeof delay?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus(),fn&&fn.call(elem)},delay)}):orig.apply(this,arguments)}}($.fn.focus),disableSelection:function(){var eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(eventType+".ui-disableSelection",function(event){event.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(zIndex){if(void 0!==zIndex)return this.css("zIndex",zIndex);if(this.length)for(var position,value,elem=$(this[0]);elem.length&&elem[0]!==document;){if(position=elem.css("position"),("absolute"===position||"relative"===position||"fixed"===position)&&(value=parseInt(elem.css("zIndex"),10),!isNaN(value)&&0!==value))return value;elem=elem.parent()}return 0}}),$.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set)proto.plugins[i]=proto.plugins[i]||[],proto.plugins[i].push([option,set[i]])},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name]; -if(set&&(allowDisconnected||instance.element[0].parentNode&&11!==instance.element[0].parentNode.nodeType))for(i=0;iinputIndex;inputIndex++)for(key in input[inputIndex])value=input[inputIndex][key],input[inputIndex].hasOwnProperty(key)&&void 0!==value&&(target[key]=$.isPlainObject(value)?$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value):value);return target},$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall="string"==typeof options,args=widget_slice.call(arguments,1),returnValue=this;return isMethodCall?this.each(function(){var methodValue,instance=$.data(this,fullName);return"instance"===options?(returnValue=instance,!1):instance?$.isFunction(instance[options])&&"_"!==options.charAt(0)?(methodValue=instance[options].apply(instance,args),methodValue!==instance&&void 0!==methodValue?(returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue,!1):void 0):$.error("no such method '"+options+"' for "+name+" widget instance"):$.error("cannot call methods on "+name+" prior to initialization; attempted to call method '"+options+"'")}):(args.length&&(options=$.widget.extend.apply(null,[options].concat(args))),this.each(function(){var instance=$.data(this,fullName);instance?(instance.option(options||{}),instance._init&&instance._init()):$.data(this,fullName,new object(options,this))})),returnValue}},$.Widget=function(){},$.Widget._childConstructors=[],$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0],this.element=$(element),this.uuid=widget_uuid++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=$(),this.hoverable=$(),this.focusable=$(),element!==this&&($.data(element,this.widgetFullName,this),this._on(!0,this.element,{remove:function(event){event.target===element&&this.destroy()}}),this.document=$(element.style?element.ownerDocument:element.document||element),this.window=$(this.document[0].defaultView||this.document[0].parentWindow)),this.options=$.widget.extend({},this.options,this._getCreateOptions(),options),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:$.noop,widget:function(){return this.element},option:function(key,value){var parts,curOption,i,options=key;if(0===arguments.length)return $.widget.extend({},this.options);if("string"==typeof key)if(options={},parts=key.split("."),key=parts.shift(),parts.length){for(curOption=options[key]=$.widget.extend({},this.options[key]),i=0;i=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});!function(){function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)]}function parseCss(element,property){return parseInt($.css(element,property),10)||0}function getDimensions(elem){var raw=elem[0];return 9===raw.nodeType?{width:elem.width(),height:elem.height(),offset:{top:0,left:0}}:$.isWindow(raw)?{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}}:raw.preventDefault?{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}}:{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()}}$.ui=$.ui||{};var cachedScrollbarWidth,supportsOffsetFractions,max=Math.max,abs=Math.abs,round=Math.round,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;$.position={scrollbarWidth:function(){if(void 0!==cachedScrollbarWidth)return cachedScrollbarWidth;var w1,w2,div=$("
"),innerDiv=div.children()[0];return $("body").append(div),w1=innerDiv.offsetWidth,div.css("overflow","scroll"),w2=innerDiv.offsetWidth,w1===w2&&(w2=div[0].clientWidth),div.remove(),cachedScrollbarWidth=w1-w2},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),hasOverflowX="scroll"===overflowX||"auto"===overflowX&&within.widthright?"left":left>0?"right":"center",vertical:0>bottom?"top":top>0?"bottom":"middle"};elemWidth>targetWidth&&abs(left+right)targetHeight&&abs(top+bottom)max(abs(top),abs(bottom))?"horizontal":"vertical",options.using.call(this,props,feedback)}),elem.offset($.extend(position,{using:using}))})},$.ui.position={fit:{left:function(position,data){var newOverRight,within=data.within,withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=withinOffset-collisionPosLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset;data.collisionWidth>outerWidth?overLeft>0&&0>=overRight?(newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-withinOffset,position.left+=overLeft-newOverRight):position.left=overRight>0&&0>=overLeft?withinOffset:overLeft>overRight?withinOffset+outerWidth-data.collisionWidth:withinOffset:overLeft>0?position.left+=overLeft:overRight>0?position.left-=overRight:position.left=max(position.left-collisionPosLeft,position.left)},top:function(position,data){var newOverBottom,within=data.within,withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset;data.collisionHeight>outerHeight?overTop>0&&0>=overBottom?(newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-withinOffset,position.top+=overTop-newOverBottom):position.top=overBottom>0&&0>=overTop?withinOffset:overTop>overBottom?withinOffset+outerHeight-data.collisionHeight:withinOffset:overTop>0?position.top+=overTop:overBottom>0?position.top-=overBottom:position.top=max(position.top-collisionPosTop,position.top)}},flip:{left:function(position,data){var newOverRight,newOverLeft,within=data.within,withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=collisionPosLeft-offsetLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset="left"===data.my[0]?-data.elemWidth:"right"===data.my[0]?data.elemWidth:0,atOffset="left"===data.at[0]?data.targetWidth:"right"===data.at[0]?-data.targetWidth:0,offset=-2*data.offset[0];0>overLeft?(newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-outerWidth-withinOffset,(0>newOverRight||newOverRight0&&(newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+atOffset+offset-offsetLeft,(newOverLeft>0||abs(newOverLeft)overTop?(newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-outerHeight-withinOffset,(0>newOverBottom||newOverBottom0&&(newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+offset-offsetTop,(newOverTop>0||abs(newOverTop)10&&11>offsetLeft,testElement.innerHTML="",testElementParent.removeChild(testElement)}()}();$.ui.position;$.widget("ui.draggable",$.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(key,value){this._super(key,value),"handle"===key&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(event){var o=this.options;return this._blurActiveElement(event),this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(event),this.handle?(this._blockFrames(o.iframeFix===!0?"iframe":o.iframeFix),!0):!1)},_blockFrames:function(selector){this.iframeBlocks=this.document.find(selector).map(function(){var iframe=$(this);return $("
").css("position","absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(event){var document=this.document[0];if(this.handleElement.is(event.target))try{document.activeElement&&"body"!==document.activeElement.nodeName.toLowerCase()&&$(document.activeElement).blur()}catch(error){}},_mouseStart:function(event){var o=this.options;return this.helper=this._createHelper(event),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),$.ui.ddmanager&&($.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===$(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(event),this.originalPosition=this.position=this._generatePosition(event,!1),this.originalPageX=event.pageX,this.originalPageY=event.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this._setContainment(),this._trigger("start",event)===!1?(this._clear(),!1):(this._cacheHelperProportions(),$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event),this._normalizeRightBottom(),this._mouseDrag(event,!0),$.ui.ddmanager&&$.ui.ddmanager.dragStart(this,event),!0)},_refreshOffsets:function(event){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:event.pageX-this.offset.left,top:event.pageY-this.offset.top}},_mouseDrag:function(event,noPropagation){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(event,!0),this.positionAbs=this._convertPositionTo("absolute"),!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===!1)return this._mouseUp({}),!1;this.position=ui.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",$.ui.ddmanager&&$.ui.ddmanager.drag(this,event),!1},_mouseStop:function(event){var that=this,dropped=!1;return $.ui.ddmanager&&!this.options.dropBehaviour&&(dropped=$.ui.ddmanager.drop(this,event)),this.dropped&&(dropped=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!dropped||"valid"===this.options.revert&&dropped||this.options.revert===!0||$.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped)?$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){that._trigger("stop",event)!==!1&&that._clear()}):this._trigger("stop",event)!==!1&&this._clear(),!1},_mouseUp:function(event){return this._unblockFrames(),$.ui.ddmanager&&$.ui.ddmanager.dragStop(this,event),this.handleElement.is(event.target)&&this.element.focus(),$.ui.mouse.prototype._mouseUp.call(this,event)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(event){return this.options.handle?!!$(event.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(event){var o=this.options,helperIsFunction=$.isFunction(o.helper),helper=helperIsFunction?$(o.helper.apply(this.element[0],[event])):"clone"===o.helper?this.element.clone().removeAttr("id"):this.element;return helper.parents("body").length||helper.appendTo("parent"===o.appendTo?this.element[0].parentNode:o.appendTo),helperIsFunction&&helper[0]===this.element[0]&&this._setPositionRelative(),helper[0]===this.element[0]||/(fixed|absolute)/.test(helper.css("position"))||helper.css("position","absolute"),helper},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(obj){"string"==typeof obj&&(obj=obj.split(" ")),$.isArray(obj)&&(obj={left:+obj[0],top:+obj[1]||0}),"left"in obj&&(this.offset.click.left=obj.left+this.margins.left),"right"in obj&&(this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left),"top"in obj&&(this.offset.click.top=obj.top+this.margins.top),"bottom"in obj&&(this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top)},_isRootNode:function(element){return/(html|body)/i.test(element.tagName)||element===this.document[0]},_getParentOffset:function(){var po=this.offsetParent.offset(),document=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])&&(po.left+=this.scrollParent.scrollLeft(),po.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(po={top:0,left:0}),{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var p=this.element.position(),scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+(scrollIsRootNode?0:this.scrollParent.scrollTop()),left:p.left-(parseInt(this.helper.css("left"),10)||0)+(scrollIsRootNode?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var isUserScrollable,c,ce,o=this.options,document=this.document[0];return this.relativeContainer=null,o.containment?"window"===o.containment?void(this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()-this.helperProportions.width-this.margins.left,$(window).scrollTop()+($(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===o.containment?void(this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):o.containment.constructor===Array?void(this.containment=o.containment):("parent"===o.containment&&(o.containment=this.helper[0].parentNode),c=$(o.containment),ce=c[0],void(ce&&(isUserScrollable=/(scroll|auto)/.test(c.css("overflow")),this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(isUserScrollable?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(isUserScrollable?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=c))):void(this.containment=null) -},_convertPositionTo:function(d,pos){pos||(pos=this.position);var mod="absolute"===d?1:-1,scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-("fixed"===this.cssPosition?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top)*mod,left:pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-("fixed"===this.cssPosition?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)*mod}},_generatePosition:function(event,constrainPosition){var containment,co,top,left,o=this.options,scrollIsRootNode=this._isRootNode(this.scrollParent[0]),pageX=event.pageX,pageY=event.pageY;return scrollIsRootNode&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),constrainPosition&&(this.containment&&(this.relativeContainer?(co=this.relativeContainer.offset(),containment=[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top]):containment=this.containment,event.pageX-this.offset.click.leftcontainment[2]&&(pageX=containment[2]+this.offset.click.left),event.pageY-this.offset.click.top>containment[3]&&(pageY=containment[3]+this.offset.click.top)),o.grid&&(top=o.grid[1]?this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,pageY=containment?top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3]?top:top-this.offset.click.top>=containment[1]?top-o.grid[1]:top+o.grid[1]:top,left=o.grid[0]?this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,pageX=containment?left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2]?left:left-this.offset.click.left>=containment[0]?left-o.grid[0]:left+o.grid[0]:left),"y"===o.axis&&(pageX=this.originalPageX),"x"===o.axis&&(pageY=this.originalPageY)),{top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top),left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(type,event,ui){return ui=ui||this._uiHash(),$.ui.plugin.call(this,type,[event,ui,this],!0),/^(drag|start|stop)/.test(type)&&(this.positionAbs=this._convertPositionTo("absolute"),ui.offset=this.positionAbs),$.Widget.prototype._trigger.call(this,type,event,ui)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.sortables=[],$(draggable.options.connectToSortable).each(function(){var sortable=$(this).sortable("instance");sortable&&!sortable.options.disabled&&(draggable.sortables.push(sortable),sortable.refreshPositions(),sortable._trigger("activate",event,uiSortable))})},stop:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.cancelHelperRemoval=!1,$.each(draggable.sortables,function(){var sortable=this;sortable.isOver?(sortable.isOver=0,draggable.cancelHelperRemoval=!0,sortable.cancelHelperRemoval=!1,sortable._storedCSS={position:sortable.placeholder.css("position"),top:sortable.placeholder.css("top"),left:sortable.placeholder.css("left")},sortable._mouseStop(event),sortable.options.helper=sortable.options._helper):(sortable.cancelHelperRemoval=!0,sortable._trigger("deactivate",event,uiSortable))})},drag:function(event,ui,draggable){$.each(draggable.sortables,function(){var innermostIntersecting=!1,sortable=this;sortable.positionAbs=draggable.positionAbs,sortable.helperProportions=draggable.helperProportions,sortable.offset.click=draggable.offset.click,sortable._intersectsWith(sortable.containerCache)&&(innermostIntersecting=!0,$.each(draggable.sortables,function(){return this.positionAbs=draggable.positionAbs,this.helperProportions=draggable.helperProportions,this.offset.click=draggable.offset.click,this!==sortable&&this._intersectsWith(this.containerCache)&&$.contains(sortable.element[0],this.element[0])&&(innermostIntersecting=!1),innermostIntersecting})),innermostIntersecting?(sortable.isOver||(sortable.isOver=1,draggable._parent=ui.helper.parent(),sortable.currentItem=ui.helper.appendTo(sortable.element).data("ui-sortable-item",!0),sortable.options._helper=sortable.options.helper,sortable.options.helper=function(){return ui.helper[0]},event.target=sortable.currentItem[0],sortable._mouseCapture(event,!0),sortable._mouseStart(event,!0,!0),sortable.offset.click.top=draggable.offset.click.top,sortable.offset.click.left=draggable.offset.click.left,sortable.offset.parent.left-=draggable.offset.parent.left-sortable.offset.parent.left,sortable.offset.parent.top-=draggable.offset.parent.top-sortable.offset.parent.top,draggable._trigger("toSortable",event),draggable.dropped=sortable.element,$.each(draggable.sortables,function(){this.refreshPositions()}),draggable.currentItem=draggable.element,sortable.fromOutside=draggable),sortable.currentItem&&(sortable._mouseDrag(event),ui.position=sortable.position)):sortable.isOver&&(sortable.isOver=0,sortable.cancelHelperRemoval=!0,sortable.options._revert=sortable.options.revert,sortable.options.revert=!1,sortable._trigger("out",event,sortable._uiHash(sortable)),sortable._mouseStop(event,!0),sortable.options.revert=sortable.options._revert,sortable.options.helper=sortable.options._helper,sortable.placeholder&&sortable.placeholder.remove(),ui.helper.appendTo(draggable._parent),draggable._refreshOffsets(event),ui.position=draggable._generatePosition(event,!0),draggable._trigger("fromSortable",event),draggable.dropped=!1,$.each(draggable.sortables,function(){this.refreshPositions()}))})}}),$.ui.plugin.add("draggable","cursor",{start:function(event,ui,instance){var t=$("body"),o=instance.options;t.css("cursor")&&(o._cursor=t.css("cursor")),t.css("cursor",o.cursor)},stop:function(event,ui,instance){var o=instance.options;o._cursor&&$("body").css("cursor",o._cursor)}}),$.ui.plugin.add("draggable","opacity",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;t.css("opacity")&&(o._opacity=t.css("opacity")),t.css("opacity",o.opacity)},stop:function(event,ui,instance){var o=instance.options;o._opacity&&$(ui.helper).css("opacity",o._opacity)}}),$.ui.plugin.add("draggable","scroll",{start:function(event,ui,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(event,ui,i){var o=i.options,scrolled=!1,scrollParent=i.scrollParentNotHidden[0],document=i.document[0];scrollParent!==document&&"HTML"!==scrollParent.tagName?(o.axis&&"x"===o.axis||(i.overflowOffset.top+scrollParent.offsetHeight-event.pageY=0;i--)l=inst.snapElements[i].left-inst.margins.left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top-inst.margins.top,b=t+inst.snapElements[i].height,l-d>x2||x1>r+d||t-d>y2||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)?(inst.snapElements[i].snapping&&inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})),inst.snapElements[i].snapping=!1):("inner"!==o.snapMode&&(ts=Math.abs(t-y2)<=d,bs=Math.abs(b-y1)<=d,ls=Math.abs(l-x2)<=d,rs=Math.abs(r-x1)<=d,ts&&(ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top),bs&&(ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top),ls&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left),rs&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left)),first=ts||bs||ls||rs,"outer"!==o.snapMode&&(ts=Math.abs(t-y1)<=d,bs=Math.abs(b-y2)<=d,ls=Math.abs(l-x1)<=d,rs=Math.abs(r-x2)<=d,ts&&(ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top),bs&&(ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top),ls&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left),rs&&(ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left)),!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)&&inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})),inst.snapElements[i].snapping=ts||bs||ls||rs||first)}}),$.ui.plugin.add("draggable","stack",{start:function(event,ui,instance){var min,o=instance.options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0)});group.length&&(min=parseInt($(group[0]).css("zIndex"),10)||0,$(group).each(function(i){$(this).css("zIndex",min+i)}),this.css("zIndex",min+group.length))}}),$.ui.plugin.add("draggable","zIndex",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;t.css("zIndex")&&(o._zIndex=t.css("zIndex")),t.css("zIndex",o.zIndex)},stop:function(event,ui,instance){var o=instance.options;o._zIndex&&$(ui.helper).css("zIndex",o._zIndex)}});$.ui.draggable;$.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var proportions,o=this.options,accept=o.accept;this.isover=!1,this.isout=!0,this.accept=$.isFunction(accept)?accept:function(d){return d.is(accept)},this.proportions=function(){return arguments.length?void(proportions=arguments[0]):proportions?proportions:proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(o.scope),o.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(scope){$.ui.ddmanager.droppables[scope]=$.ui.ddmanager.droppables[scope]||[],$.ui.ddmanager.droppables[scope].push(this)},_splice:function(drop){for(var i=0;i=reference&&reference+size>x}return function(draggable,droppable,toleranceMode,event){if(!droppable.offset)return!1;var x1=(draggable.positionAbs||draggable.position.absolute).left+draggable.margins.left,y1=(draggable.positionAbs||draggable.position.absolute).top+draggable.margins.top,x2=x1+draggable.helperProportions.width,y2=y1+draggable.helperProportions.height,l=droppable.offset.left,t=droppable.offset.top,r=l+droppable.proportions().width,b=t+droppable.proportions().height;switch(toleranceMode){case"fit":return x1>=l&&r>=x2&&y1>=t&&b>=y2;case"intersect":return l=t&&b>=y1||y2>=t&&b>=y2||t>y1&&y2>b)&&(x1>=l&&r>=x1||x2>=l&&r>=x2||l>x1&&x2>r);default:return!1}}}(),$.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(i=0;i0?!0:(el[scroll]=1,has=el[scroll]>0,el[scroll]=0,has)},_create:function(){var n,i,handle,axis,hname,that=this,o=this.options;if(this.element.addClass("ui-resizable"),$.extend(this,{_aspectRatio:!!o.aspectRatio,aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap($("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=o.handles||($(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=$(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),n=this.handles.split(","),this.handles={},i=0;i
"),axis.css({zIndex:o.zIndex}),"se"===handle&&axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[handle]=".ui-resizable-"+handle,this.element.append(axis);this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=$(this.handles[i]),this._on(this.handles[i],{mousedown:that._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(axis=$(this.handles[i],this.element),padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth(),padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),target.css(padPos,padWrapper),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){that.resizing||(this.className&&(axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),that.axis=axis&&axis[1]?axis[1]:"se")}),o.autoHide&&(this._handles.hide(),$(this.element).addClass("ui-resizable-autohide").mouseenter(function(){o.disabled||($(this).removeClass("ui-resizable-autohide"),that._handles.show())}).mouseleave(function(){o.disabled||that.resizing||($(this).addClass("ui-resizable-autohide"),that._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var wrapper,_destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(_destroy(this.element),wrapper=this.element,this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper),wrapper.remove()),this.originalElement.css("resize",this.originalResizeStyle),_destroy(this.originalElement),this},_mouseCapture:function(event){var i,handle,capture=!1;for(i in this.handles)handle=$(this.handles[i])[0],(handle===event.target||$.contains(handle,event.target))&&(capture=!0);return!this.options.disabled&&capture},_mouseStart:function(event){var curleft,curtop,cursor,o=this.options,el=this.element;return this.resizing=!0,this._renderProxy(),curleft=this._num(this.helper.css("left")),curtop=this._num(this.helper.css("top")),o.containment&&(curleft+=$(o.containment).scrollLeft()||0,curtop+=$(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:curleft,top:curtop},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()},this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()},this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()},this.originalPosition={left:curleft,top:curtop},this.originalMousePosition={left:event.pageX,top:event.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,cursor=$(".ui-resizable-"+this.axis).css("cursor"),$("body").css("cursor","auto"===cursor?this.axis+"-resize":cursor),el.addClass("ui-resizable-resizing"),this._propagate("start",event),!0},_mouseDrag:function(event){var data,props,smp=this.originalMousePosition,a=this.axis,dx=event.pageX-smp.left||0,dy=event.pageY-smp.top||0,trigger=this._change[a];return this._updatePrevProperties(),trigger?(data=trigger.apply(this,[event,dx,dy]),this._updateVirtualBoundaries(event.shiftKey),(this._aspectRatio||event.shiftKey)&&(data=this._updateRatio(data,event)),data=this._respectSize(data,event),this._updateCache(data),this._propagate("resize",event),props=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),$.isEmptyObject(props)||(this._updatePrevProperties(),this._trigger("resize",event,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(event){this.resizing=!1;var pr,ista,soffseth,soffsetw,s,left,top,o=this.options,that=this;return this._helper&&(pr=this._proportionallyResizeElements,ista=pr.length&&/textarea/i.test(pr[0].nodeName),soffseth=ista&&this._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,s={width:that.helper.width()-soffsetw,height:that.helper.height()-soffseth},left=parseInt(that.element.css("left"),10)+(that.position.left-that.originalPosition.left)||null,top=parseInt(that.element.css("top"),10)+(that.position.top-that.originalPosition.top)||null,o.animate||this.element.css($.extend(s,{top:top,left:left})),that.helper.height(that.size.height),that.helper.width(that.size.width),this._helper&&!o.animate&&this._proportionallyResize()),$("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",event),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var props={};return this.position.top!==this.prevPosition.top&&(props.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(props.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(props.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(props.height=this.size.height+"px"),this.helper.css(props),props},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight,pMaxHeight,b,o=this.options;b={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||forceAspectRatio)&&(pMinWidth=b.minHeight*this.aspectRatio,pMinHeight=b.minWidth/this.aspectRatio,pMaxWidth=b.maxHeight*this.aspectRatio,pMaxHeight=b.maxWidth/this.aspectRatio,pMinWidth>b.minWidth&&(b.minWidth=pMinWidth),pMinHeight>b.minHeight&&(b.minHeight=pMinHeight),pMaxWidthdata.width,isminh=this._isNumber(data.height)&&o.minHeight&&o.minHeight>data.height,dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);return isminw&&(data.width=o.minWidth),isminh&&(data.height=o.minHeight),ismaxw&&(data.width=o.maxWidth),ismaxh&&(data.height=o.maxHeight),isminw&&cw&&(data.left=dw-o.minWidth),ismaxw&&cw&&(data.left=dw-o.maxWidth),isminh&&ch&&(data.top=dh-o.minHeight),ismaxh&&ch&&(data.top=dh-o.maxHeight),data.width||data.height||data.left||!data.top?data.width||data.height||data.top||!data.left||(data.left=null):data.top=null,data},_getPaddingPlusBorderDimensions:function(element){for(var i=0,widths=[],borders=[element.css("borderTopWidth"),element.css("borderRightWidth"),element.css("borderBottomWidth"),element.css("borderLeftWidth")],paddings=[element.css("paddingTop"),element.css("paddingRight"),element.css("paddingBottom"),element.css("paddingLeft")];4>i;i++)widths[i]=parseInt(borders[i],10)||0,widths[i]+=parseInt(paddings[i],10)||0;return{height:widths[0]+widths[2],width:widths[1]+widths[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var prel,i=0,element=this.helper||this.element;i
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++o.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(event,dx){return{width:this.originalSize.width+dx}},w:function(event,dx){var cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx}},n:function(event,dx,dy){var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy}},s:function(event,dx,dy){return{height:this.originalSize.height+dy}},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy])) -},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]),"resize"!==n&&this._trigger(n,event,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).resizable("instance"),o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&/textarea/i.test(pr[0].nodeName),soffseth=ista&&that._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,style={width:that.size.width-soffsetw,height:that.size.height-soffseth},left=parseInt(that.element.css("left"),10)+(that.position.left-that.originalPosition.left)||null,top=parseInt(that.element.css("top"),10)+(that.position.top-that.originalPosition.top)||null;that.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseInt(that.element.css("width"),10),height:parseInt(that.element.css("height"),10),top:parseInt(that.element.css("top"),10),left:parseInt(that.element.css("left"),10)};pr&&pr.length&&$(pr[0]).css({width:data.width,height:data.height}),that._updateCache(data),that._propagate("resize",event)}})}}),$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,ch,cw,width,height,that=$(this).resizable("instance"),o=that.options,el=that.element,oc=o.containment,ce=oc instanceof $?oc.get(0):/parent/.test(oc)?el.parent().get(0):oc;ce&&(that.containerElement=$(ce),/document/.test(oc)||oc===document?(that.containerOffset={left:0,top:0},that.containerPosition={left:0,top:0},that.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight}):(element=$(ce),p=[],$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=that._num(element.css("padding"+name))}),that.containerOffset=element.offset(),that.containerPosition=element.position(),that.containerSize={height:element.innerHeight()-p[3],width:element.innerWidth()-p[1]},co=that.containerOffset,ch=that.containerSize.height,cw=that.containerSize.width,width=that._hasScroll(ce,"left")?ce.scrollWidth:cw,height=that._hasScroll(ce)?ce.scrollHeight:ch,that.parentData={element:ce,left:co.left,top:co.top,width:width,height:height}))},resize:function(event){var woset,hoset,isParent,isOffsetRelative,that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cp=that.position,pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement,continueResize=!0;ce[0]!==document&&/static/.test(ce.css("position"))&&(cop=co),cp.left<(that._helper?co.left:0)&&(that.size.width=that.size.width+(that._helper?that.position.left-co.left:that.position.left-cop.left),pRatio&&(that.size.height=that.size.width/that.aspectRatio,continueResize=!1),that.position.left=o.helper?co.left:0),cp.top<(that._helper?co.top:0)&&(that.size.height=that.size.height+(that._helper?that.position.top-co.top:that.position.top),pRatio&&(that.size.width=that.size.height*that.aspectRatio,continueResize=!1),that.position.top=that._helper?co.top:0),isParent=that.containerElement.get(0)===that.element.parent().get(0),isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position")),isParent&&isOffsetRelative?(that.offset.left=that.parentData.left+that.position.left,that.offset.top=that.parentData.top+that.position.top):(that.offset.left=that.element.offset().left,that.offset.top=that.element.offset().top),woset=Math.abs(that.sizeDiff.width+(that._helper?that.offset.left-cop.left:that.offset.left-co.left)),hoset=Math.abs(that.sizeDiff.height+(that._helper?that.offset.top-cop.top:that.offset.top-co.top)),woset+that.size.width>=that.parentData.width&&(that.size.width=that.parentData.width-woset,pRatio&&(that.size.height=that.size.width/that.aspectRatio,continueResize=!1)),hoset+that.size.height>=that.parentData.height&&(that.size.height=that.parentData.height-hoset,pRatio&&(that.size.width=that.size.height*that.aspectRatio,continueResize=!1)),continueResize||(that.position.left=that.prevPosition.left,that.position.top=that.prevPosition.top,that.size.width=that.prevSize.width,that.size.height=that.prevSize.height)},stop:function(){var that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;that._helper&&!o.animate&&/relative/.test(ce.css("position"))&&$(this).css({left:ho.left-cop.left-co.left,width:w,height:h}),that._helper&&!o.animate&&/static/.test(ce.css("position"))&&$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}}),$.ui.plugin.add("resizable","alsoResize",{start:function(){var that=$(this).resizable("instance"),o=that.options;$(o.alsoResize).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseInt(el.width(),10),height:parseInt(el.height(),10),left:parseInt(el.css("left"),10),top:parseInt(el.css("top"),10)})})},resize:function(event,ui){var that=$(this).resizable("instance"),o=that.options,os=that.originalSize,op=that.originalPosition,delta={height:that.size.height-os.height||0,width:that.size.width-os.width||0,top:that.position.top-op.top||0,left:that.position.left-op.left||0};$(o.alsoResize).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),style={},css=el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);sum&&sum>=0&&(style[prop]=sum||null)}),el.css(style)})},stop:function(){$(this).removeData("resizable-alsoresize")}}),$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).resizable("instance"),o=that.options,cs=that.size;that.ghost=that.originalElement.clone(),that.ghost.css({opacity:.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof o.ghost?o.ghost:""),that.ghost.appendTo(that.helper)},resize:function(){var that=$(this).resizable("instance");that.ghost&&that.ghost.css({position:"relative",height:that.size.height,width:that.size.width})},stop:function(){var that=$(this).resizable("instance");that.ghost&&that.helper&&that.helper.get(0).removeChild(that.ghost.get(0))}}),$.ui.plugin.add("resizable","grid",{resize:function(){var outerDimensions,that=$(this).resizable("instance"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,grid="number"==typeof o.grid?[o.grid,o.grid]:o.grid,gridX=grid[0]||1,gridY=grid[1]||1,ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&o.maxWidthnewWidth,isMinHeight=o.minHeight&&o.minHeight>newHeight;o.grid=grid,isMinWidth&&(newWidth+=gridX),isMinHeight&&(newHeight+=gridY),isMaxWidth&&(newWidth-=gridX),isMaxHeight&&(newHeight-=gridY),/^(se|s|e)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight):/^(ne)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight,that.position.top=op.top-oy):/^(sw)$/.test(a)?(that.size.width=newWidth,that.size.height=newHeight,that.position.left=op.left-ox):((0>=newHeight-gridY||0>=newWidth-gridX)&&(outerDimensions=that._getPaddingPlusBorderDimensions(this)),newHeight-gridY>0?(that.size.height=newHeight,that.position.top=op.top-oy):(newHeight=gridY-outerDimensions.height,that.size.height=newHeight,that.position.top=op.top+os.height-newHeight),newWidth-gridX>0?(that.size.width=newWidth,that.position.left=op.left-ox):(newWidth=gridX-outerDimensions.width,that.size.width=newWidth,that.position.left=op.left+os.width-newWidth))}});$.ui.resizable,$.widget("ui.selectable",$.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var selectees,that=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){selectees=$(that.options.filter,that.element[0]),selectees.addClass("ui-selectee"),selectees.each(function(){var $this=$(this),pos=$this.offset();$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:!1,selected:$this.hasClass("ui-selected"),selecting:$this.hasClass("ui-selecting"),unselecting:$this.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=selectees.addClass("ui-selectee"),this._mouseInit(),this.helper=$("
")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(event){var that=this,options=this.options;this.opos=[event.pageX,event.pageY],this.options.disabled||(this.selectees=$(options.filter,this.element[0]),this._trigger("start",event),$(options.appendTo).append(this.helper),this.helper.css({left:event.pageX,top:event.pageY,width:0,height:0}),options.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=!0,event.metaKey||event.ctrlKey||(selectee.$element.removeClass("ui-selected"),selectee.selected=!1,selectee.$element.addClass("ui-unselecting"),selectee.unselecting=!0,that._trigger("unselecting",event,{unselecting:selectee.element}))}),$(event.target).parents().addBack().each(function(){var doSelect,selectee=$.data(this,"selectable-item");return selectee?(doSelect=!event.metaKey&&!event.ctrlKey||!selectee.$element.hasClass("ui-selected"),selectee.$element.removeClass(doSelect?"ui-unselecting":"ui-selected").addClass(doSelect?"ui-selecting":"ui-unselecting"),selectee.unselecting=!doSelect,selectee.selecting=doSelect,selectee.selected=doSelect,doSelect?that._trigger("selecting",event,{selecting:selectee.element}):that._trigger("unselecting",event,{unselecting:selectee.element}),!1):void 0}))},_mouseDrag:function(event){if(this.dragged=!0,!this.options.disabled){var tmp,that=this,options=this.options,x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY;return x1>x2&&(tmp=x2,x2=x1,x1=tmp),y1>y2&&(tmp=y2,y2=y1,y1=tmp),this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1}),this.selectees.each(function(){var selectee=$.data(this,"selectable-item"),hit=!1;selectee&&selectee.element!==that.element[0]&&("touch"===options.tolerance?hit=!(selectee.left>x2||selectee.righty2||selectee.bottomx1&&selectee.righty1&&selectee.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,disableHorizontalScroll:!1,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(x,reference,size){return x>=reference&&reference+size>x},_isFloating:function(item){return/left|right/.test(item.css("float"))||/inline|table-cell/.test(item.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(key,value){this._super(key,value),"handle"===key&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),$.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--)this.items[i].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=!1,that=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(event),$(event.target).parents().each(function(){return $.data(this,that.widgetName+"-item")===that?(currentItem=$(this),!1):void 0}),$.data(event.target,that.widgetName+"-item")===that&&(currentItem=$(event.target)),currentItem&&(!this.options.handle||overrideHandle||($(this.options.handle,currentItem).find("*").addBack().each(function(){this===event.target&&(validHandle=!0)}),validHandle))?(this.currentItem=currentItem,this._removeCurrentsFromItems(),!0):!1)},_mouseStart:function(event,overrideHandle,noActivation){var i,body,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(event),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(event),this.originalPageX=event.pageX,this.originalPageY=event.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(body=this.document.find("body"),this.storedCursor=body.css("cursor"),body.css("cursor",o.cursor),this.storedStylesheet=$("").appendTo(body)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",event,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!noActivation)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",event,this._uiHash(this));return $.ui.ddmanager&&($.ui.ddmanager.current=this),$.ui.ddmanager&&!o.dropBehaviour&&$.ui.ddmanager.prepareOffsets(this,event),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(event),!0},_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options,scrolled=!1;for(this.position=this._generatePosition(event),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-event.pageY=0;i--)if(item=this.items[i],itemElement=item.item[0],intersection=this._intersectsWithPointer(item),intersection&&!(item.item.data("dragMultipleActive")||item.instance!==this.currentContainer||itemElement===this.currentItem[0]||this.placeholder[1===intersection?"next":"prev"]()[0]===itemElement||$.contains(this.placeholder[0],itemElement)||("semi-dynamic"===this.options.type?$.contains(this.element[0],itemElement):0))){if(this.direction=1===intersection?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(item))break;this._rearrange(event,item),this._trigger("change",event,this._uiHash());break}return this._contactContainers(event),$.ui.ddmanager&&$.ui.ddmanager.drag(this,event),this._trigger("sort",event,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(event,noPropagation){if(event){if($.ui.ddmanager&&!this.options.dropBehaviour&&$.ui.ddmanager.drop(this,event),this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={};axis&&"x"!==axis||(animation.left=cur.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),axis&&"y"!==axis||(animation.top=cur.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,$(this.helper).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event)})}else this._clear(event,noPropagation);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("deactivate",null,this._uiHash(this)),this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",null,this._uiHash(this)),this.containers[i].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),$.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?$(this.domPosition.prev).after(this.currentItem):$(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected),str=[];return o=o||{},$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||/(.+)[\-=_](.+)/);res&&str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]))}),!str.length&&o.key&&str.push(o.key+"="),str.join("&")},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected),ret=[];return o=o||{},items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"")}),ret},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,dxClick=this.offset.click.left,isOverElementHeight="x"===this.options.axis||y1+dyClick>t&&b>y1+dyClick,isOverElementWidth="y"===this.options.axis||x1+dxClick>l&&r>x1+dxClick,isOverElement=isOverElementHeight&&isOverElementWidth;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"]?isOverElement:l0?"down":"up")},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return 0!==delta&&(delta>0?"right":"left")},refresh:function(event){return this._refreshItems(event),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var options=this.options;return options.connectWith.constructor===String?[options.connectWith]:options.connectWith},_getItemsAsjQuery:function(connected){function addItems(){items.push(this)}var i,j,cur,inst,items=[],queries=[],connectWith=this._connectWith();if(connectWith&&connected)for(i=connectWith.length-1;i>=0;i--)for(cur=$(connectWith[i],this.document[0]),j=cur.length-1;j>=0;j--)inst=$.data(cur[j],this.widgetFullName),inst&&inst!==this&&!inst.options.disabled&&queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst]);for(queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=queries.length-1;i>=0;i--)queries[i][0].each(addItems);return $(items)},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=$.grep(this.items,function(item){for(var j=0;j=0;i--)for(cur=$(connectWith[i],this.document[0]),j=cur.length-1;j>=0;j--)inst=$.data(cur[j],this.widgetFullName),inst&&inst!==this&&!inst.options.disabled&&(queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]),this.containers.push(inst));for(i=queries.length-1;i>=0;i--)for(targetData=queries[i][1],_queries=queries[i][0],j=0,queriesLength=_queries.length;queriesLength>j;j++)item=$(_queries[j]),item.data(this.widgetName+"-item",targetData),items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0})},refreshPositions:function(fast){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,item,t,p;for(i=this.items.length-1;i>=0;i--)item=this.items[i],$(item.item).data("dragMultipleActive")||item.instance!==this.currentContainer&&this.currentContainer&&item.item[0]!==this.currentItem[0]||(t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item,fast||(item.width=t.outerWidth(),item.height=t.outerHeight()),p=t.offset(),item.left=p.left,item.top=p.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)p=this.containers[i].element.offset(),this.containers[i].containerCache.left=p.left,this.containers[i].containerCache.top=p.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(that){that=that||this;var className,o=that.options;o.placeholder&&o.placeholder.constructor!==String||(className=o.placeholder,o.placeholder={element:function(){var nodeName=that.currentItem[0].nodeName.toLowerCase(),element=$("<"+nodeName+">",that.document[0]).addClass(className||that.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===nodeName?that._createTrPlaceholder(that.currentItem.find("tr").eq(0),$("",that.document[0]).appendTo(element)):"tr"===nodeName?that._createTrPlaceholder(that.currentItem,element):"img"===nodeName&&element.attr("src",that.currentItem.attr("src")),className||element.css("visibility","hidden"),element},update:function(container,p){(!className||o.forcePlaceholderSize)&&(p.height()||p.height(that.currentItem.innerHeight()-parseInt(that.currentItem.css("paddingTop")||0,10)-parseInt(that.currentItem.css("paddingBottom")||0,10)),p.width()||p.width(that.currentItem.innerWidth()-parseInt(that.currentItem.css("paddingLeft")||0,10)-parseInt(that.currentItem.css("paddingRight")||0,10)))}}),that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem)),that.currentItem.after(that.placeholder),o.placeholder.update(that,that.placeholder)},_createTrPlaceholder:function(sourceTr,targetTr){var that=this;sourceTr.children().each(function(){$(" ",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(targetTr)})},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,cur,nearBottom,floating,axis,innermostContainer=null,innermostIndex=null;for(i=this.containers.length-1;i>=0;i--)if(!$.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0]))continue;innermostContainer=this.containers[i],innermostIndex=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",event,this._uiHash(this)),this.containers[i].containerCache.over=0);if(innermostContainer)if(1===this.containers.length)this.containers[innermostIndex].containerCache.over||(this.containers[innermostIndex]._trigger("over",event,this._uiHash(this)),this.containers[innermostIndex].containerCache.over=1);else{for(dist=1e4,itemWithLeastDistance=null,floating=innermostContainer.floating||this._isFloating(this.currentItem),posProperty=floating?"left":"top",sizeProperty=floating?"width":"height",axis=floating?"clientX":"clientY",j=this.items.length-1;j>=0;j--)$.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])&&this.items[j].item[0]!==this.currentItem[0]&&(cur=this.items[j].item.offset()[posProperty],nearBottom=!1,event[axis]-cur>this.items[j][sizeProperty]/2&&(nearBottom=!0),Math.abs(event[axis]-cur)this.containment[2]&&(pageX=this.containment[2]+this.offset.click.left),event.pageY-this.offset.click.top>this.containment[3]&&(pageY=this.containment[3]+this.offset.click.top)),o.grid&&(top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1],pageY=this.containment?top-this.offset.click.top>=this.containment[1]&&top-this.offset.click.top<=this.containment[3]?top:top-this.offset.click.top>=this.containment[1]?top-o.grid[1]:top+o.grid[1]:top,left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0],pageX=this.containment?left-this.offset.click.left>=this.containment[0]&&left-this.offset.click.left<=this.containment[2]?left:left-this.offset.click.left>=this.containment[0]?left-o.grid[0]:left+o.grid[0]:left)),{top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():scrollIsRootNode?0:scroll.scrollTop()),left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())}},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?i.item[0]:i.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(function(){counter===this.counter&&this.refreshPositions(!hardRefresh)})},_clear:function(event,noPropagation){function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance))}}this.reverting=!1;var i,delayedTriggers=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!noPropagation&&delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||noPropagation||delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash())}),this!==this.currentContainer&&(noPropagation||(delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash())}),delayedTriggers.push(function(c){return function(event){c._trigger("receive",event,this._uiHash(this))}}.call(this,this.currentContainer)),delayedTriggers.push(function(c){return function(event){c._trigger("update",event,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)noPropagation||delayedTriggers.push(delayEvent("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(delayedTriggers.push(delayEvent("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,noPropagation||this._trigger("beforeStop",event,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!noPropagation){for(i=0;i",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(event){event.preventDefault()},"click .ui-menu-item":function(event){var target=$(event.target);!this.mouseHandled&&target.not(".ui-state-disabled").length&&(this.select(event),event.isPropagationStopped()||(this.mouseHandled=!0),target.has(".ui-menu").length?this.expand(event):!this.element.is(":focus")&&$(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(event){if(!this.previousFilter){var target=$(event.currentTarget);target.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(event,target)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(event,keepActiveItem){var item=this.active||this.element.find(this.options.items).eq(0);keepActiveItem||this.focus(event,item)},blur:function(event){this._delay(function(){$.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(event)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(event){this._closeOnDocumentClick(event)&&this.collapseAll(event),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var elem=$(this);elem.data("ui-menu-submenu-carat")&&elem.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(event){var match,prev,character,skip,preventDefault=!0;switch(event.keyCode){case $.ui.keyCode.PAGE_UP:this.previousPage(event);break;case $.ui.keyCode.PAGE_DOWN:this.nextPage(event);break;case $.ui.keyCode.HOME:this._move("first","first",event);break;case $.ui.keyCode.END:this._move("last","last",event);break;case $.ui.keyCode.UP:this.previous(event);break;case $.ui.keyCode.DOWN:this.next(event);break;case $.ui.keyCode.LEFT:this.collapse(event);break;case $.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(event);break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:this._activate(event);break;case $.ui.keyCode.ESCAPE:this.collapse(event);break;default:preventDefault=!1,prev=this.previousFilter||"",character=String.fromCharCode(event.keyCode),skip=!1,clearTimeout(this.filterTimer),character===prev?skip=!0:character=prev+character,match=this._filterMenuItems(character),match=skip&&-1!==match.index(this.active.next())?this.active.nextAll(".ui-menu-item"):match,match.length||(character=String.fromCharCode(event.keyCode),match=this._filterMenuItems(character)),match.length?(this.focus(event,match),this.previousFilter=character,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}preventDefault&&event.preventDefault()},_activate:function(event){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(event):this.select(event))},refresh:function(){var menus,items,that=this,icon=this.options.icons.submenu,submenus=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),submenus.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var menu=$(this),item=menu.parent(),submenuCarat=$("").addClass("ui-menu-icon ui-icon "+icon).data("ui-menu-submenu-carat",!0);item.attr("aria-haspopup","true").prepend(submenuCarat),menu.attr("aria-labelledby",item.attr("id"))}),menus=submenus.add(this.element),items=menus.find(this.options.items),items.not(".ui-menu-item").each(function(){var item=$(this);that._isDivider(item)&&item.addClass("ui-widget-content ui-menu-divider")}),items.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),items.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!$.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(key,value){"icons"===key&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(value.submenu),"disabled"===key&&this.element.toggleClass("ui-state-disabled",!!value).attr("aria-disabled",value),this._super(key,value)},focus:function(event,item){var nested,focused;this.blur(event,event&&"focus"===event.type),this._scrollIntoView(item),this.active=item.first(),focused=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",focused.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),event&&"keydown"===event.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),nested=item.children(".ui-menu"),nested.length&&event&&/^mouse/.test(event.type)&&this._startOpening(nested),this.activeMenu=item.parent(),this._trigger("focus",event,{item:item})},_scrollIntoView:function(item){var borderTop,paddingTop,offset,scroll,elementHeight,itemHeight;this._hasScroll()&&(borderTop=parseFloat($.css(this.activeMenu[0],"borderTopWidth"))||0,paddingTop=parseFloat($.css(this.activeMenu[0],"paddingTop"))||0,offset=item.offset().top-this.activeMenu.offset().top-borderTop-paddingTop,scroll=this.activeMenu.scrollTop(),elementHeight=this.activeMenu.height(),itemHeight=item.outerHeight(),0>offset?this.activeMenu.scrollTop(scroll+offset):offset+itemHeight>elementHeight&&this.activeMenu.scrollTop(scroll+offset-elementHeight+itemHeight))},blur:function(event,fromFocus){fromFocus||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",event,{item:this.active}))},_startOpening:function(submenu){clearTimeout(this.timer),"true"===submenu.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(submenu)},this.delay))},_open:function(submenu){var position=$.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(submenu.parents(".ui-menu")).hide().attr("aria-hidden","true"),submenu.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(position)},collapseAll:function(event,all){clearTimeout(this.timer),this.timer=this._delay(function(){var currentMenu=all?this.element:$(event&&event.target).closest(this.element.find(".ui-menu"));currentMenu.length||(currentMenu=this.element),this._close(currentMenu),this.blur(event),this.activeMenu=currentMenu},this.delay)},_close:function(startMenu){startMenu||(startMenu=this.active?this.active.parent():this.element),startMenu.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(event){return!$(event.target).closest(".ui-menu").length},_isDivider:function(item){return!/[^\-\u2014\u2013\s]/.test(item.text())},collapse:function(event){var newItem=this.active&&this.active.parent().closest(".ui-menu-item",this.element);newItem&&newItem.length&&(this._close(),this.focus(event,newItem))},expand:function(event){var newItem=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();newItem&&newItem.length&&(this._open(newItem.parent()),this._delay(function(){this.focus(event,newItem)}))},next:function(event){this._move("next","first",event)},previous:function(event){this._move("prev","last",event)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(direction,filter,event){var next;this.active&&(next="first"===direction||"last"===direction?this.active["first"===direction?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[direction+"All"](".ui-menu-item").eq(0)),next&&next.length&&this.active||(next=this.activeMenu.find(this.options.items)[filter]()),this.focus(event,next)},nextPage:function(event){var item,base,height;return this.active?void(this.isLastItem()||(this._hasScroll()?(base=this.active.offset().top,height=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return item=$(this),item.offset().top-base-height<0}),this.focus(event,item)):this.focus(event,this.activeMenu.find(this.options.items)[this.active?"last":"first"]()))):void this.next(event)},previousPage:function(event){var item,base,height;return this.active?void(this.isFirstItem()||(this._hasScroll()?(base=this.active.offset().top,height=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return item=$(this),item.offset().top-base+height>0}),this.focus(event,item)):this.focus(event,this.activeMenu.find(this.options.items).first()))):void this.next(event)},_hasScroll:function(){return this.element.outerHeight()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var suppressKeyPress,suppressKeyPressRepeat,suppressInput,nodeName=this.element[0].nodeName.toLowerCase(),isTextarea="textarea"===nodeName,isInput="input"===nodeName;this.isMultiLine=isTextarea?!0:isInput?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[isTextarea||isInput?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(event){if(this.element.prop("readOnly"))return suppressKeyPress=!0,suppressInput=!0,void(suppressKeyPressRepeat=!0);suppressKeyPress=!1,suppressInput=!1,suppressKeyPressRepeat=!1;var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:suppressKeyPress=!0,this._move("previousPage",event);break;case keyCode.PAGE_DOWN:suppressKeyPress=!0,this._move("nextPage",event);break;case keyCode.UP:suppressKeyPress=!0,this._keyEvent("previous",event);break;case keyCode.DOWN:suppressKeyPress=!0,this._keyEvent("next",event);break;case keyCode.ENTER:this.menu.active&&(suppressKeyPress=!0,event.preventDefault(),this.menu.select(event));break;case keyCode.TAB:this.menu.active&&this.menu.select(event);break;case keyCode.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(event),event.preventDefault());break;default:suppressKeyPressRepeat=!0,this._searchTimeout(event)}},keypress:function(event){if(suppressKeyPress)return suppressKeyPress=!1,void((!this.isMultiLine||this.menu.element.is(":visible"))&&event.preventDefault());if(!suppressKeyPressRepeat){var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:this._move("previousPage",event);break;case keyCode.PAGE_DOWN:this._move("nextPage",event);break;case keyCode.UP:this._keyEvent("previous",event);break;case keyCode.DOWN:this._keyEvent("next",event)}}},input:function(event){return suppressInput?(suppressInput=!1,void event.preventDefault()):void this._searchTimeout(event)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(event){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(event),void this._change(event))}}),this._initSource(),this.menu=$("