Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Commit

Permalink
Revert keyboard-shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
treppo committed Jul 25, 2016
1 parent eb9ce7e commit ec1e675
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 316 deletions.

This file was deleted.

19 changes: 1 addition & 18 deletions service/test/functional/features/steps/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
from behave import when
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from time import sleep

from behave import when
from common import *


Expand All @@ -31,16 +29,6 @@ def impl(context):
fill_by_css_selector(context, 'textarea#text-box', row['body'])


@when('I use a shortcut to compose a message with')
def compose_with_shortcut(context):
body = context.browser.find_element_by_tag_name('body')
body.send_keys('c')

for row in context.table:
fill_by_css_selector(context, 'input#subject', row['subject'])
fill_by_css_selector(context, 'textarea#text-box', row['body'])


@when("for the '{recipients_field}' field I enter '{to_type}'")
def enter_address_impl(context, recipients_field, to_type):
_enter_recipient(context, recipients_field, to_type + "\n")
Expand All @@ -59,11 +47,6 @@ def send_impl(context):
send_button.click()


@when('I use a shortcut to send it')
def send_with_shortcut(context):
ActionChains(context.browser).key_down(Keys.CONTROL).send_keys(Keys.ENTER).key_up(Keys.CONTROL).perform()


@when(u'I toggle the cc and bcc fields')
def collapse_cc_bcc_fields(context):
cc_and_bcc_chevron = wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, '#cc-bcc-collapse'))
Expand Down
8 changes: 2 additions & 6 deletions web-ui/app/js/page/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ define(
'page/version',
'page/unread_count_title',
'page/pix_logo',
'helpers/browser',
'page/shortcuts'
'helpers/browser'
],

function (
Expand Down Expand Up @@ -93,8 +92,7 @@ define(
version,
unreadCountTitle,
pixLogo,
browser,
shortcuts) {
browser) {

'use strict';
function initialize(path) {
Expand Down Expand Up @@ -139,8 +137,6 @@ define(

pixLogo.attachTo(document);

shortcuts.attachTo(document);

$.ajaxSetup({headers: {'X-XSRF-TOKEN': browser.getCookie('XSRF-TOKEN')}});
});
}
Expand Down
3 changes: 1 addition & 2 deletions web-ui/app/js/page/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ define(function () {
results: 'search:results',
empty: 'search:empty',
highlightResults: 'search:highlightResults',
resetHighlight: 'search:resetHighlight',
focus: 'search:focus'
resetHighlight: 'search:resetHighlight'
},
feedback: {
submit: 'feedback:submit',
Expand Down
125 changes: 0 additions & 125 deletions web-ui/app/js/page/shortcuts.js

This file was deleted.

5 changes: 0 additions & 5 deletions web-ui/app/js/search/search_trigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,13 @@ define(
}
};

this.focus = function () {
this.select('input').focus();
};

this.after('initialize', function () {
this.render();
this.on(this.select('form'), 'submit', this.search);
this.on(this.select('input'), 'focus', this.showOnlySearchTerms);
this.on(this.select('input'), 'blur', this.showSearchTermsAndPlaceHolder);
this.on(document, events.ui.tag.selected, this.clearInput);
this.on(document, events.ui.tag.select, this.clearInput);
this.on(document, events.search.focus, this.focus);
});
}
}
Expand Down
123 changes: 0 additions & 123 deletions web-ui/test/spec/page/shortcuts.spec.js

This file was deleted.

4 changes: 0 additions & 4 deletions web-ui/test/spec/search/search_trigger.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,5 @@ describeComponent('search/search_trigger', function () {
expect(self.component.select('input').val()).toBe('');
});

it('should focus search input field on focus event', function () {
$(document).trigger(Pixelated.events.search.focus);

expect($(document.activeElement)).toEqual(this.component.select('input'));
});
});

0 comments on commit ec1e675

Please sign in to comment.