From b14833fbb56bcd5bff0750c16fd9214009b955be Mon Sep 17 00:00:00 2001 From: Zara Gebru Date: Fri, 2 Dec 2016 15:25:23 +0100 Subject: [refactor] move app dir into public dir --- .../mail_list_actions/ui/archive_many_trigger.js | 29 ------- .../app/js/mail_list_actions/ui/compose_trigger.js | 57 ------------- .../js/mail_list_actions/ui/delete_many_trigger.js | 47 ----------- .../js/mail_list_actions/ui/mail_list_actions.js | 93 ---------------------- .../mail_list_actions/ui/mark_as_unread_trigger.js | 47 ----------- .../ui/mark_many_as_read_trigger.js | 47 ----------- .../js/mail_list_actions/ui/pagination_trigger.js | 66 --------------- .../mail_list_actions/ui/recover_many_trigger.js | 47 ----------- .../app/js/mail_list_actions/ui/refresh_trigger.js | 44 ---------- .../ui/toggle_check_all_trigger.js | 49 ------------ 10 files changed, 526 deletions(-) delete mode 100644 web-ui/app/js/mail_list_actions/ui/archive_many_trigger.js delete mode 100644 web-ui/app/js/mail_list_actions/ui/compose_trigger.js delete mode 100644 web-ui/app/js/mail_list_actions/ui/delete_many_trigger.js delete mode 100644 web-ui/app/js/mail_list_actions/ui/mail_list_actions.js delete mode 100644 web-ui/app/js/mail_list_actions/ui/mark_as_unread_trigger.js delete mode 100644 web-ui/app/js/mail_list_actions/ui/mark_many_as_read_trigger.js delete mode 100644 web-ui/app/js/mail_list_actions/ui/pagination_trigger.js delete mode 100644 web-ui/app/js/mail_list_actions/ui/recover_many_trigger.js delete mode 100644 web-ui/app/js/mail_list_actions/ui/refresh_trigger.js delete mode 100644 web-ui/app/js/mail_list_actions/ui/toggle_check_all_trigger.js (limited to 'web-ui/app/js/mail_list_actions/ui') diff --git a/web-ui/app/js/mail_list_actions/ui/archive_many_trigger.js b/web-ui/app/js/mail_list_actions/ui/archive_many_trigger.js deleted file mode 100644 index b148cdce..00000000 --- a/web-ui/app/js/mail_list_actions/ui/archive_many_trigger.js +++ /dev/null @@ -1,29 +0,0 @@ -define( - [ - 'flight/lib/component', - 'views/templates', - 'mixins/with_enable_disable_on_event', - 'page/events' - ], - - function(definecomponent, templates, withEnableDisableOnEvent, events) { - 'use strict'; - - return definecomponent(archiveManyTrigger, withEnableDisableOnEvent(events.ui.mails.hasMailsChecked)); - function archiveManyTrigger() { - - this.getMailsToArchive = function() { - this.trigger(document, events.ui.mail.wantChecked, this.$node); - }; - - this.archiveManyEmails = function(event, data) { - this.trigger(document, events.mail.archiveMany, data); - }; - - this.after('initialize', function () { - this.on('click', this.getMailsToArchive); - this.on(events.ui.mail.hereChecked, this.archiveManyEmails); - }); - } - } -); diff --git a/web-ui/app/js/mail_list_actions/ui/compose_trigger.js b/web-ui/app/js/mail_list_actions/ui/compose_trigger.js deleted file mode 100644 index ec79cb26..00000000 --- a/web-ui/app/js/mail_list_actions/ui/compose_trigger.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2014 ThoughtWorks, Inc. - * - * Pixelated 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. - * - * Pixelated 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 Pixelated. If not, see . - */ -define( - [ - 'flight/lib/component', - 'views/templates', - 'page/events' - ], - - function(defineComponent, templates, events) { - 'use strict'; - - return defineComponent(composeTrigger); - - function composeTrigger() { - - this.defaultAttrs({}); - - this.render = function() { - this.$node.html(templates.mailActions.composeTrigger); - }; - - this.enableComposing = function(event, data) { - this.trigger(document, events.dispatchers.rightPane.openComposeBox); - }; - - this.showEmailSuccess = function () { - this.trigger(document, events.ui.userAlerts.displayMessage, {message: 'Your message was sent!', class: 'success'}); - }; - - this.showEmailError = function (ev, data) { - this.trigger(document, events.ui.userAlerts.displayMessage, {message: 'Error, message not sent: ' + data.responseJSON.message, class: 'error'}); - }; - - this.after('initialize', function () { - this.render(); - this.on('click', this.enableComposing); - this.on(document, events.mail.sent, this.showEmailSuccess); - this.on(document, events.mail.send_failed, this.showEmailError); - }); - } - } -); diff --git a/web-ui/app/js/mail_list_actions/ui/delete_many_trigger.js b/web-ui/app/js/mail_list_actions/ui/delete_many_trigger.js deleted file mode 100644 index dd2f67a5..00000000 --- a/web-ui/app/js/mail_list_actions/ui/delete_many_trigger.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2014 ThoughtWorks, Inc. - * - * Pixelated 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. - * - * Pixelated 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 Pixelated. If not, see . - */ -define( - [ - 'flight/lib/component', - 'views/templates', - 'mixins/with_enable_disable_on_event', - 'page/events' - ], - - function(defineComponent, templates, withEnableDisableOnEvent, events) { - 'use strict'; - - return defineComponent(deleteManyTrigger, withEnableDisableOnEvent(events.ui.mails.hasMailsChecked)); - - function deleteManyTrigger() { - this.defaultAttrs({}); - - this.getMailsToDelete = function(event) { - this.trigger(document, events.ui.mail.wantChecked, this.$node); - }; - - this.deleteManyEmails = function (event, data) { - this.trigger(document, events.ui.mail.deleteMany, data); - }; - - this.after('initialize', function () { - this.on('click', this.getMailsToDelete); - this.on(events.ui.mail.hereChecked, this.deleteManyEmails); - }); - } - } -); diff --git a/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js b/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js deleted file mode 100644 index 69e5fde4..00000000 --- a/web-ui/app/js/mail_list_actions/ui/mail_list_actions.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2014 ThoughtWorks, Inc. - * - * Pixelated 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. - * - * Pixelated 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 Pixelated. If not, see . - */ - -define( - [ - 'flight/lib/component', - 'views/templates', - 'page/events', - 'page/router/url_params', - 'mail_list_actions/ui/compose_trigger', - 'mail_list_actions/ui/refresh_trigger', - 'mail_list/domain/refresher', - 'mail_list_actions/ui/toggle_check_all_trigger', - 'mail_list_actions/ui/pagination_trigger', - 'mail_list_actions/ui/delete_many_trigger', - 'mail_list_actions/ui/recover_many_trigger', - 'mail_list_actions/ui/archive_many_trigger', - 'mail_list_actions/ui/mark_many_as_read_trigger', - 'mail_list_actions/ui/mark_as_unread_trigger' - ], - - function ( - defineComponent, - templates, - events, - urlParams, - composeTrigger, - refreshTrigger, - refresher, - toggleCheckAllMailTrigger, - paginationTrigger, - deleteManyTrigger, - recoverManyTrigger, - archiveManyTrigger, - markManyAsReadTrigger, - markAsUnreadTrigger - ) { - 'use strict'; - return defineComponent(mailsActions); - - function mailsActions() { - this.render = function() { - this.$node.html(this.getActionsBoxTemplate()); - refreshTrigger.attachTo('#refresh-trigger'); - composeTrigger.attachTo('#compose-trigger'); - toggleCheckAllMailTrigger.attachTo('#toggle-check-all-emails'); - paginationTrigger.attachTo('#pagination-trigger'); - deleteManyTrigger.attachTo('#delete-selected'); - recoverManyTrigger.attachTo('#recover-selected'); - archiveManyTrigger.attachTo('#archive-selected'); - markManyAsReadTrigger.attachTo('#mark-selected-as-read'); - markAsUnreadTrigger.attachTo('#mark-selected-as-unread'); - refresher.attachTo(document); - }; - - this.getCurrentTag = function () { - return this.attr.currentTag || urlParams.getTag(); - }; - - this.updateCurrentTag = function (ev, data) { - this.attr.currentTag = data.tag; - this.render(); - }; - - this.getActionsBoxTemplate = function () { - if(this.getCurrentTag() === 'trash') { - return templates.mailActions.trashActionsBox(); - } else { - return templates.mailActions.actionsBox(); - } - }; - - this.after('initialize', function () { - this.on(document, events.ui.tag.select, this.updateCurrentTag); - this.render(); - }); - } - } -); diff --git a/web-ui/app/js/mail_list_actions/ui/mark_as_unread_trigger.js b/web-ui/app/js/mail_list_actions/ui/mark_as_unread_trigger.js deleted file mode 100644 index 2584e453..00000000 --- a/web-ui/app/js/mail_list_actions/ui/mark_as_unread_trigger.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2014 ThoughtWorks, Inc. - * - * Pixelated 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. - * - * Pixelated 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 Pixelated. If not, see . - */ -define( - [ - 'flight/lib/component', - 'views/templates', - 'mixins/with_enable_disable_on_event', - 'page/events' - ], - - function(defineComponent, templates, withEnableDisableOnEvent, events) { - 'use strict'; - - return defineComponent(markAsUnreadTrigger, withEnableDisableOnEvent(events.ui.mails.hasMailsChecked)); - - function markAsUnreadTrigger() { - this.defaultAttrs({}); - - this.getMailsToMarkAsUnread = function(event) { - this.trigger(document, events.ui.mail.wantChecked, this.$node); - }; - - this.markManyEmailsAsUnread = function (event, data) { - this.trigger(document, events.mail.unread, data); - }; - - this.after('initialize', function () { - this.on('click', this.getMailsToMarkAsUnread); - this.on(events.ui.mail.hereChecked, this.markManyEmailsAsUnread); - }); - } - } -); diff --git a/web-ui/app/js/mail_list_actions/ui/mark_many_as_read_trigger.js b/web-ui/app/js/mail_list_actions/ui/mark_many_as_read_trigger.js deleted file mode 100644 index c16a2229..00000000 --- a/web-ui/app/js/mail_list_actions/ui/mark_many_as_read_trigger.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2014 ThoughtWorks, Inc. - * - * Pixelated 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. - * - * Pixelated 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 Pixelated. If not, see . - */ -define( - [ - 'flight/lib/component', - 'views/templates', - 'mixins/with_enable_disable_on_event', - 'page/events' - ], - - function(defineComponent, templates, withEnableDisableOnEvent, events) { - 'use strict'; - - return defineComponent(markManyAsReadTrigger, withEnableDisableOnEvent(events.ui.mails.hasMailsChecked)); - - function markManyAsReadTrigger() { - this.defaultAttrs({}); - - this.getMailsToMarkAsRead = function(event) { - this.trigger(document, events.ui.mail.wantChecked, this.$node); - }; - - this.markManyEmailsAsRead = function (event, data) { - this.trigger(document, events.mail.read, data); - }; - - this.after('initialize', function () { - this.on('click', this.getMailsToMarkAsRead); - this.on(events.ui.mail.hereChecked, this.markManyEmailsAsRead); - }); - } - } -); diff --git a/web-ui/app/js/mail_list_actions/ui/pagination_trigger.js b/web-ui/app/js/mail_list_actions/ui/pagination_trigger.js deleted file mode 100644 index 3bc13d40..00000000 --- a/web-ui/app/js/mail_list_actions/ui/pagination_trigger.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2014 ThoughtWorks, Inc. - * - * Pixelated 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. - * - * Pixelated 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 Pixelated. If not, see . - */ -define( - [ - 'flight/lib/component', - 'views/templates', - 'page/events' - ], - - function(defineComponent, templates, events) { - 'use strict'; - - return defineComponent(paginationTrigger); - - function paginationTrigger() { - this.defaultAttrs({ - previous: '#left-arrow', - next: '#right-arrow', - currentPage: '#current-page' - }); - - this.renderWithPageNumber = function(pageNumber) { - this.$node.html(templates.mailActions.paginationTrigger({ - currentPage: pageNumber - })); - this.on(this.attr.previous, 'click', this.previousPage); - this.on(this.attr.next, 'click', this.nextPage); - }; - - this.render = function() { - this.renderWithPageNumber(1); - }; - - this.updatePageDisplay = function(event, data) { - this.renderWithPageNumber(data.currentPage); - }; - - this.previousPage = function(event) { - this.trigger(document, events.ui.page.previous); - }; - - this.nextPage = function(event) { - this.trigger(document, events.ui.page.next); - }; - - this.after('initialize', function () { - this.render(); - this.on(document, events.ui.page.changed, this.updatePageDisplay); - }); - } - } -); diff --git a/web-ui/app/js/mail_list_actions/ui/recover_many_trigger.js b/web-ui/app/js/mail_list_actions/ui/recover_many_trigger.js deleted file mode 100644 index e0a32094..00000000 --- a/web-ui/app/js/mail_list_actions/ui/recover_many_trigger.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2014 ThoughtWorks, Inc. - * - * Pixelated 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. - * - * Pixelated 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 Pixelated. If not, see . - */ -define( - [ - 'flight/lib/component', - 'views/templates', - 'mixins/with_enable_disable_on_event', - 'page/events' - ], - - function(defineComponent, templates, withEnableDisableOnEvent, events) { - 'use strict'; - - return defineComponent(recoverManyTrigger, withEnableDisableOnEvent(events.ui.mails.hasMailsChecked)); - - function recoverManyTrigger() { - this.defaultAttrs({}); - - this.getMailsToRecover = function(event) { - this.trigger(document, events.ui.mail.wantChecked, this.$node); - }; - - this.recoverManyEmails = function (event, data) { - this.trigger(document, events.ui.mail.recoverMany, data); - }; - - this.after('initialize', function () { - this.on('click', this.getMailsToRecover); - this.on(events.ui.mail.hereChecked, this.recoverManyEmails); - }); - } - } -); diff --git a/web-ui/app/js/mail_list_actions/ui/refresh_trigger.js b/web-ui/app/js/mail_list_actions/ui/refresh_trigger.js deleted file mode 100644 index a16270d2..00000000 --- a/web-ui/app/js/mail_list_actions/ui/refresh_trigger.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2014 ThoughtWorks, Inc. - * - * Pixelated 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. - * - * Pixelated 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 Pixelated. If not, see . - */ -define( - [ - 'flight/lib/component', - 'views/templates', - 'page/events' - ], - - function(defineComponent, templates, events) { - 'use strict'; - - return defineComponent(refreshTrigger); - - function refreshTrigger() { - this.render = function() { - this.$node.html(templates.mailActions.refreshTrigger); - }; - - this.refresh = function(event) { - this.trigger(document, events.ui.mails.refresh); - }; - - this.after('initialize', function () { - this.render(); - this.on('click', this.refresh); - }); - } - } -); diff --git a/web-ui/app/js/mail_list_actions/ui/toggle_check_all_trigger.js b/web-ui/app/js/mail_list_actions/ui/toggle_check_all_trigger.js deleted file mode 100644 index 71c65346..00000000 --- a/web-ui/app/js/mail_list_actions/ui/toggle_check_all_trigger.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2014 ThoughtWorks, Inc. - * - * Pixelated 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. - * - * Pixelated 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 Pixelated. If not, see . - */ -define( - [ - 'flight/lib/component', - 'page/events' - ], - - function(defineComponent, events) { - 'use strict'; - - return defineComponent(toggleCheckAllEmailsTrigger); - - function toggleCheckAllEmailsTrigger() { - this.defaultAttrs({ }); - - this.toggleCheckAll = function(event) { - if (this.$node.prop('checked')) { - this.trigger(document, events.ui.mails.checkAll); - } else { - this.trigger(document, events.ui.mails.uncheckAll); - } - }; - - this.setCheckbox = function (event, state) { - this.$node.prop('checked', state); - }; - - this.after('initialize', function () { - this.on('click', this.toggleCheckAll); - this.on(document, events.ui.mails.hasMailsChecked, this.setCheckbox); - }); - } - } -); -- cgit v1.2.3