-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make undo and redo buttons work #109
Changes from 6 commits
7ba21fe
7f2d696
99ed154
6df2dee
678535f
95f6c0f
e313993
b3ec2a4
d4f7564
5393141
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,18 +26,51 @@ angular.module('kibibitCodeEditor') | |
}; | ||
}) | ||
|
||
.controller('menuBarController', function(ngDialog) { | ||
var vm = this; | ||
vm.settings = { | ||
printLayout: true, | ||
showRuler: true, | ||
showSpellingSuggestions: true, | ||
presentationMode: 'edit' | ||
}; | ||
vm.sampleAction = function(name, ev) { | ||
ngDialog.open({ | ||
template: '<p>You triggered the "' + name + '" action</p>', | ||
plain: true | ||
}); | ||
}; | ||
.controller('menuBarController', function( | ||
SettingsService, | ||
ngDialog, | ||
deviceDetector) { | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Illegal trailing whitespace |
||
var vm = this; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 2 characters |
||
vm.settings = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 2 characters |
||
printLayout: true, | ||
showRuler: true, | ||
showSpellingSuggestions: true, | ||
presentationMode: 'edit' | ||
}; | ||
vm.sampleAction = function(name, ev) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 2 characters |
||
ngDialog.open({ | ||
template: '<p>You triggered the "' + name + '" action</p>', | ||
plain: true | ||
}); | ||
}; | ||
|
||
vm.settings = SettingsService.getSettings(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 2 characters |
||
|
||
vm.hasUndo = function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 2 characters |
||
if (vm.settings.currentUndoManager && | ||
vm.settings.currentUndoManager.hasUndo) { | ||
vm.enableUndo = vm.settings.currentUndoManager.hasUndo(); | ||
return vm.enableUndo; | ||
} else { | ||
return false; | ||
} | ||
}; | ||
|
||
vm.hasRedo = function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 2 characters |
||
if (vm.settings.currentUndoManager && | ||
vm.settings.currentUndoManager.hasRedo) { | ||
vm.enableRedo = vm.settings.currentUndoManager.hasRedo(); | ||
return vm.enableRedo; | ||
} else { | ||
return false; | ||
} | ||
}; | ||
|
||
vm.cutSelection = function(e) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected indentation of 2 characters |
||
vm.settings.currentEditor.session.replace( | ||
vm.settings.currentEditor.selection.getRange(), ''); | ||
|
||
vm.settings.currentEditor.focus(); | ||
}; | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
<link rel="stylesheet" type="text/css" href="assets/lib/bower_components/ng-dialog/css/ngDialog.css"> | ||
<link rel="stylesheet" type="text/css" href="assets/lib/bower_components/ng-dialog/css/ngDialog-theme-default.css"> | ||
<link rel="stylesheet" type="text/css" href="assets/lib/bower_components/octicons/octicons/octicons.css"> | ||
<link rel="stylesheet" type="text/css" href="assets/lib/glyphter-font/css/Glyphter.css"> | ||
<link rel="stylesheet" type="text/css" href="assets/lib/pictonic/css/pictonic.css"> | ||
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css"> | ||
<link rel="stylesheet" type="text/css" href="assets/lib/bower_components/angular-ui-layout/src/ui-layout.css"> | ||
|
@@ -27,31 +28,36 @@ | |
<link rel="stylesheet" type="text/css" href="assets/css/style.css"> | ||
</head> | ||
|
||
<body ng-app="kibibitCodeEditor" ng-controller="mainController as main" class="main-app-container" ng-class="{foo:true}"> | ||
<div ui-layout="{ dividerSize: '0' }" > | ||
<div ui-layout-container size="104px" class="menu-bar-container"> | ||
<menu-bar></menu-bar> | ||
</div> | ||
|
||
<div ui-layout-container="central" > | ||
<div ui-layout="{ flow : 'column', dividerSize: '10' }"> | ||
<div ui-layout-container class="sidebar-container" size="20%"> | ||
<div class="sidebar" ng-scrollbars> | ||
<kb-file-tree | ||
kb-file-tree-path="main.projectFolderPath" | ||
kb-file-tree-selection="main.openFile"> | ||
</kb-file-tree> | ||
<body ng-app="kibibitCodeEditor"> | ||
<div ng-controller="mainController as main" class="main-app-container" ng-class="{'app-initiated':true}"> | ||
<div ui-layout="{ dividerSize: '0' }" > | ||
<div ui-layout-container size="104px" class="menu-bar-container"> | ||
<menu-bar></menu-bar> | ||
</div> | ||
|
||
<div ui-layout-container="central" style="z-index: 6;"> | ||
<div ui-layout="{ flow : 'column', dividerSize: '10' }"> | ||
<div ui-layout-container class="sidebar-container" size="20%"> | ||
<div class="sidebar" ng-scrollbars> | ||
<kb-file-tree | ||
kb-file-tree-path="main.projectFolderPath" | ||
kb-file-tree-selection="main.openFile"> | ||
</kb-file-tree> | ||
</div> | ||
</div> | ||
<div ui-layout-container class="main-view-container"> | ||
<div class="tabs"></div> | ||
<div class="main-view" ng-view></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div ui-layout-container class="main-view-container"> | ||
<div class="tabs"></div> | ||
<div class="main-view" ng-view></div> | ||
<div ui-layout-container size="30px" class="status-bar"> | ||
<span>Line {{main.settings.cursor.row}} - Column {{main.settings.cursor.column}}</span> | ||
</div> | ||
</div> | ||
</div> | ||
<div ui-layout-container size="30px" class="status-bar"> | ||
<span>Line {{main.settings.cursor.row}} - Column {{main.settings.cursor.column}}</span> | ||
</div> | ||
</div> | ||
<div class="loading-logo" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: center;" ng-class="{'app-initiated':true}"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. General question that concerns other places in the code too (menuBarTemplate.html for example): There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Basically, we don't use style unless it's something that needs to be loaded fast. Here, we want the loading logo to load before everything else. This way, we make sure it is rendered as fast as possible. In the besides that, I used |
||
<div class="icon-logo" style="font-size: 800%; color: #353535; text-shadow: 0px 1px 1px #5b5b5b;"></div> | ||
</div> | ||
<!-- <main> | ||
<menu-bar></menu-bar> --> | ||
|
@@ -63,7 +69,11 @@ | |
<!-- <script type="text/javascript" src="assets/lib/bower_components/emitter/emitter.js"></script> --> | ||
<script type="text/javascript" src="assets/lib/bower_components/jquery/dist/jquery.min.js"></script> | ||
<script type="text/javascript" src="assets/lib/bower_components/angular/angular.js"></script> | ||
<script type="text/javascript" src="assets/lib/bower_components/angular-sanitize/angular-sanitize.js"></script> | ||
<script type="text/javascript" src="assets/lib/bower_components/clipboard/dist/clipboard.js"></script> | ||
<script type="text/javascript" src="assets/lib/bower_components/ngclipboard/dist/ngclipboard.js"></script> | ||
<script type="text/javascript" src="assets/lib/bower_components/re-tree/re-tree.js"></script> | ||
<script type="text/javascript" src="assets/lib/bower_components/ng-device-detector/ng-device-detector.js"></script> | ||
<script type="text/javascript" src="assets/lib/bower_components/angular-sanitize/angular-sanitize.js"></script> | ||
<script type="text/javascript" src="assets/lib/bower_components/angular-route/angular-route.js"></script> | ||
<script type="text/javascript" src="assets/lib/bower_components/angular-animate/angular-animate.js"></script> | ||
<script type="text/javascript" src="assets/lib/bower_components/angular-aria/angular-aria.js"></script> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* Generated by Glyphter (http://www.glyphter.com) on Wed Apr 13 2016*/ | ||
@font-face { | ||
font-family: 'Glyphter'; | ||
src: url('../fonts/Glyphter.eot'); | ||
src: url('../fonts/Glyphter.eot?#iefix') format('embedded-opentype'), | ||
url('../fonts/Glyphter.woff') format('woff'), | ||
url('../fonts/Glyphter.ttf') format('truetype'), | ||
url('../fonts/Glyphter.svg#Glyphter') format('svg'); | ||
font-weight: normal; | ||
font-style: normal; | ||
} | ||
[class*='icon-']:before{ | ||
display: inline-block; | ||
font-family: 'Glyphter'; | ||
font-style: normal; | ||
font-weight: normal; | ||
line-height: 1; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale | ||
} | ||
.icon-logo:before{content:'\0041';} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left this here even though I didn't use it, since we'll need this for MixPanel