Răsfoiți Sursa

Add hotkeys modal

James Allen 12 ani în urmă
părinte
comite
c099b8e9de

+ 2 - 0
services/web/app/views/project/editor.jade

@@ -64,6 +64,8 @@ block content
 
 			.ui-layout-east
 				include ./editor/chat
+				
+	include ./editor/hotkeys
 
 	script(type="text/ng-template", id="genericMessageModalTemplate")
 		.modal-header

+ 66 - 0
services/web/app/views/project/editor/hotkeys.jade

@@ -0,0 +1,66 @@
+script(type="text/ng-template", id="hotkeysModalTemplate")
+	.modal-header
+		button.close(
+			type="button"
+			data-dismiss="modal"
+			ng-click="cancel()"
+		) ×
+		h3 Hotkeys
+	.modal-body.modal-hotkeys
+		h3 Common
+		.row
+			.col-xs-6
+				.hotkey
+					span.combination {{ctrl}} + F
+					span.description Find (and replace)
+				.hotkey
+					span.combination {{ctrl}} + Enter
+					span.description Compile
+			.col-xs-6
+				.hotkey
+					span.combination {{ctrl}} + Z
+					span.description Undo
+				.hotkey
+					span.combination {{ctrl}} + Y
+					span.description Redo
+
+		h3 Navigation
+		.row
+			.col-xs-6
+				.hotkey
+					span.combination {{ctrl}} + Home
+					span.description  Beginning of document
+				.hotkey
+					span.combination {{ctrl}} + End
+					span.description End of document
+			.col-xs-6
+				.hotkey
+					span.combination {{ctrl}} + L
+					span.description Go To Line
+
+		h3 Editing
+		.row
+			.col-xs-6
+				.hotkey
+					span.combination {{ctrl}} + /
+					span.description Toggle Comment
+				.hotkey
+					span.combination {{ctrl}} + D
+					span.description Delete Current Line
+				.hotkey
+					span.combination {{ctrl}} + A
+					span.description Select All
+			.col-xs-6
+				.hotkey
+					span.combination Tab
+					span.description Indent Selection
+				.hotkey
+					span.combination {{ctrl}} + U
+					span.description To Uppercase
+				.hotkey
+					span.combination Ctrl + Shift + U
+					span.description To Lowercase
+	.modal-footer
+		button.btn.btn-default(
+			ng-click="cancel()"
+		) OK

+ 6 - 0
services/web/app/views/project/editor/left-menu.jade

@@ -135,6 +135,12 @@ aside#left-menu.full-size(
 					option(value="pdfjs") Built-In
 					option(value="native") Native
 
+	h4 Hotkeys
+	ul.list-unstyled.nav
+		li(ng-controller="HotkeysController")
+			a(ng-click="openHotkeysModal()")
+				i.fa.fa-keyboard-o.fa-fw
+				|    Show Hotkeys
 
 #left-menu-mask(
 	ng-show="ui.leftMenuShown",

+ 1 - 1
services/web/app/views/project/editor/pdf.jade

@@ -15,7 +15,7 @@ div.full-size.pdf(ng-controller="PdfController")
 			href
 			ng-click="toggleLogs()"
 			ng-class="{ 'active': (pdf.view == 'logs' || pdf.failure) && !pdf.error && !pdf.timeout && !pdf.uncompiled }"
-			tooltip="Logs"
+			tooltip="Logs and output files"
 			tooltip-placement="bottom"
 		)
 			i.fa.fa-file-text-o

+ 1 - 1
services/web/app/views/project/editor/share.jade

@@ -115,7 +115,7 @@ script(type="text/ng-template", id="makePrivateModalTemplate")
 		) ×
 		h3 Make project private?
 	.modal-body.modal-body-share
-		p If you make your project public then only the people you choose to share it with will have access.
+		p If you make your project private then only the people you choose to share it with will have access.
 	.modal-footer
 		button.btn.btn-default(
 			ng-click="cancel()"

+ 1 - 0
services/web/public/coffee/ide.coffee

@@ -14,6 +14,7 @@ define [
 	"ide/clone/index"
 	"ide/templates/index"
 	"ide/dropbox/index"
+	"ide/hotkeys/index"
 	"ide/directives/layout"
 	"ide/services/ide"
 	"directives/focus"

+ 19 - 0
services/web/public/coffee/ide/hotkeys/controllers/HotkeysController.coffee

@@ -0,0 +1,19 @@
+define [
+	"base"
+	"ace/ace"
+], (App) ->
+	App.controller "HotkeysController", ($scope, $modal) ->
+		$scope.openHotkeysModal = ->
+			$modal.open {
+				templateUrl: "hotkeysModalTemplate"
+				controller:  "HotkeysModalController"
+			}
+		
+	App.controller "HotkeysModalController", ($scope, $modalInstance)->
+		if ace.require("ace/lib/useragent").isMac
+			$scope.ctrl = "Cmd"
+		else
+			$scope.ctrl = "Ctrl"
+		
+		$scope.cancel = () ->
+			$modalInstance.dismiss()

+ 3 - 0
services/web/public/coffee/ide/hotkeys/index.coffee

@@ -0,0 +1,3 @@
+define [
+	"ide/hotkeys/controllers/HotkeysController"
+], () ->

+ 1 - 0
services/web/public/stylesheets/app/editor.less

@@ -9,6 +9,7 @@
 @import "./editor/search.less";
 @import "./editor/publish-template.less";
 @import "./editor/online-users.less";
+@import "./editor/hotkeys.less";
 
 .full-size {
 	position: absolute;

+ 21 - 0
services/web/public/stylesheets/app/editor/hotkeys.less

@@ -0,0 +1,21 @@
+.modal-hotkeys {
+	font-size: 14px;
+	
+	h3:first-child {
+		margin-top: 0;
+	}
+	
+	.hotkey {
+		margin-bottom: @line-height-computed / 4;
+	}
+	
+	.combination {
+		padding: 4px 8px;
+		border-radius: 3px;
+		background-color: @gray-dark;
+		color: white;
+		font-family: @font-family-sans-serif;
+		font-weight: 600;
+		margin-right: @line-height-computed / 4;
+	}
+}