mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	hotkeys: Replace C with x for composing PM.
Pressing the 'x' key can now be used to compose a PM. Pressing the 'C' key displays a modal that shows a deprecation notice. Fixes #6548.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							af004fa6f5
						
					
				
				
					commit
					1227857de6
				
			@@ -232,7 +232,7 @@ exports.then_send_message = function (type, params) {
 | 
			
		||||
        if (type === "stream") {
 | 
			
		||||
            casper.page.sendEvent('keypress', "c");
 | 
			
		||||
        } else if (type === "private") {
 | 
			
		||||
            casper.page.sendEvent('keypress', "C");
 | 
			
		||||
            casper.page.sendEvent('keypress', "x");
 | 
			
		||||
        } else {
 | 
			
		||||
            casper.test.assertTrue(false, "send_message got valid message type");
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ casper.then(function () {
 | 
			
		||||
        casper.test.assertVisible('#stream-message', 'Stream input box visible');
 | 
			
		||||
        common.check_form('#send_message_form', {stream: '', subject: ''}, "Stream empty on new compose");
 | 
			
		||||
        casper.click('body');
 | 
			
		||||
        casper.page.sendEvent('keypress', "C");
 | 
			
		||||
        casper.page.sendEvent('keypress', "x");
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
@@ -102,7 +102,7 @@ casper.then(function () {
 | 
			
		||||
casper.then(function () {
 | 
			
		||||
    casper.waitWhileVisible('#stream-message', function () {
 | 
			
		||||
        casper.test.assertNotVisible('#stream-message', 'Close stream compose box');
 | 
			
		||||
        casper.page.sendEvent('keypress', "C");
 | 
			
		||||
        casper.page.sendEvent('keypress', "x");
 | 
			
		||||
        casper.click('body');
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,7 @@ casper.then(function () {
 | 
			
		||||
casper.then(function () {
 | 
			
		||||
    casper.test.info('Creating Private Message Draft');
 | 
			
		||||
    casper.click('body');
 | 
			
		||||
    casper.page.sendEvent('keypress', "C");
 | 
			
		||||
    casper.page.sendEvent('keypress', "x");
 | 
			
		||||
    casper.waitUntilVisible('#private-message', function () {
 | 
			
		||||
        casper.fill('form#send_message_form', {
 | 
			
		||||
            content: 'Test Private Message',
 | 
			
		||||
@@ -171,7 +171,7 @@ casper.then(function () {
 | 
			
		||||
    casper.click('#draft_overlay .exit');
 | 
			
		||||
    waitWhileDraftsVisible(function () {
 | 
			
		||||
        casper.click('body');
 | 
			
		||||
        casper.page.sendEvent('keypress', "C");
 | 
			
		||||
        casper.page.sendEvent('keypress', "x");
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -149,7 +149,7 @@ function stubbing(func_name_to_stub, test_function) {
 | 
			
		||||
 | 
			
		||||
    // Unmapped keys should immediately return false, without
 | 
			
		||||
    // calling any functions outside of hotkey.js.
 | 
			
		||||
    assert_unmapped('abefhlmotxyz');
 | 
			
		||||
    assert_unmapped('abefhlmotyz');
 | 
			
		||||
    assert_unmapped('BEFHILNOQTUWXYZ');
 | 
			
		||||
 | 
			
		||||
    // We have to skip some checks due to the way the code is
 | 
			
		||||
@@ -224,7 +224,7 @@ function stubbing(func_name_to_stub, test_function) {
 | 
			
		||||
    assert_mapping('D', 'narrow.stream_cycle_forward');
 | 
			
		||||
 | 
			
		||||
    assert_mapping('c', 'compose_actions.start');
 | 
			
		||||
    assert_mapping('C', 'compose_actions.start');
 | 
			
		||||
    assert_mapping('x', 'compose_actions.start');
 | 
			
		||||
    assert_mapping('P', 'narrow.by');
 | 
			
		||||
    assert_mapping('g', 'gear_menu.open');
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user