Skip to content

Commit ee139ca

Browse files
committed
update popup and set stage api
1 parent 549ce7f commit ee139ca

9 files changed

Lines changed: 89 additions & 13 deletions

File tree

Gulpfile.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ gulp.task('styl', function () {
4646
.pipe(notify('Stylus!!'))
4747
})
4848

49+
gulp.task('styl-popup', function () {
50+
return gulp.src('src/browser/popup/styles/app.styl')
51+
.pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
52+
.pipe(styl())
53+
.pipe(autoprefixer())
54+
.pipe(gulp.dest('src/browser/popup/styles/'))
55+
.pipe(livereload())
56+
.pipe(notify('Stylus!! @POPUP'))
57+
})
58+
4959
gulp.task('bs', function () {
5060
return gulp.src('src/browser/shared/styles/bootstrap.styl')
5161
.pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
@@ -76,6 +86,7 @@ gulp.task('watch-main', function () {
7686
['src/browser/main/index.inject.html', 'src/browser/main/**/*.js', 'src/browser/main/**/*.css', 'src/browser/shared/**/*.js', 'src/browser/shared/**/*.css'], ['inject-main'])
7787

7888
gulp.watch('src/browser/main/styles/**/*.styl', ['styl'])
89+
gulp.watch('src/browser/popup/styles/**/*.styl', ['styl-popup'])
7990
gulp.watch('src/browser/shared/styles/**/*.styl', ['bs'])
8091
livereload.listen()
8192
})

src/browser/main/tpls/directives/side-nav.tpl.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
<div class="new-block">
2323
<div class="btn-group" dropdown>
24-
<button btn-new-snippet type="button" class="btn btn-success"><i class="fa fa-plus-square-o fa-fw"></i> New Snippet</button>
25-
<button type="button" class="btn btn-success dropdown-toggle" dropdown-toggle>
24+
<button ng-disabled="!vm.isAuthenticated" btn-new-snippet type="button" class="btn btn-success"><i class="fa fa-plus-square-o fa-fw"></i> New Snippet</button>
25+
<button ng-disabled="!vm.isAuthenticated" type="button" class="btn btn-success dropdown-toggle" dropdown-toggle>
2626
<span class="caret"></span>
2727
<span class="sr-only">Split button!</span>
2828
</button>

src/browser/popup/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<link rel="stylesheet" href="../vendor/css/font-awesome.css" media="screen" title="no title" charset="utf-8">
1414

1515
<!-- inject:css -->
16+
<link rel="stylesheet" href="styles/app.css">
1617
<link rel="stylesheet" href="../shared/styles/bootstrap.css">
1718
<!-- endinject -->
1819

@@ -25,14 +26,12 @@
2526

2627
<div class="result-block row-fluid">
2728
<ul id="result-list" class="result-list left-pane">
28-
<li ng-click="selectSnippet($index)" ng-repeat="snippet in filteredSnippets" ng-class="{active:$index == selectIndex}"><a href="#"> <span ng-bind="snippet.callSign"></span> <small ng-bind="snippet.description"></small></a></li>
29+
<li ng-click="selectSnippet($index)" ng-repeat="snippet in filteredSnippets" ng-class="{active:$index == selectIndex}"><a href="#"> <small ng-bind="snippet.callSign"></small>&nbsp;/&nbsp;<span ng-bind="snippet.description"></span></a></li>
2930
</ul>
3031

3132
<div class="right-pane">
3233
<div class="result-detail-control">
3334
<button ng-click="writeCode(selectedItem.content)" id="btnClipboard" type="button" name="button" class="btn btn-default"><i class="fa fa-clipboard"></i></button>
34-
<!-- <button ng-click="editSnippet(selectedItem.id)" id="btnEdit" type="button" name="button" class="btn btn-default"><i class="fa fa-edit"></i></button> -->
35-
<!-- <button id="btnShare" type="button" name="button" class="btn btn-default"><i class="fa fa-share"></i></button> -->
3635
</div>
3736
<div id="aceView" class="result-detail-content"
3837
ui-ace="{

src/browser/popup/index.inject.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@
2424

2525
<div class="result-block row-fluid">
2626
<ul id="result-list" class="result-list left-pane">
27-
<li ng-click="selectSnippet($index)" ng-repeat="snippet in filteredSnippets" ng-class="{active:$index == selectIndex}"><a href="#"> <span ng-bind="snippet.callSign"></span> <small ng-bind="snippet.description"></small></a></li>
27+
<li ng-click="selectSnippet($index)" ng-repeat="snippet in filteredSnippets" ng-class="{active:$index == selectIndex}"><a href="#"> <small ng-bind="snippet.callSign"></small>&nbsp;/&nbsp;<span ng-bind="snippet.description"></span></a></li>
2828
</ul>
2929

3030
<div class="right-pane">
3131
<div class="result-detail-control">
3232
<button ng-click="writeCode(selectedItem.content)" id="btnClipboard" type="button" name="button" class="btn btn-default"><i class="fa fa-clipboard"></i></button>
33-
<!-- <button ng-click="editSnippet(selectedItem.id)" id="btnEdit" type="button" name="button" class="btn btn-default"><i class="fa fa-edit"></i></button> -->
34-
<!-- <button id="btnShare" type="button" name="button" class="btn btn-default"><i class="fa fa-share"></i></button> -->
3533
</div>
3634
<div id="aceView" class="result-detail-content"
3735
ui-ace="{
@@ -50,6 +48,7 @@
5048
<script src="../vendor/ace.js"></script>
5149
<script src="../vendor/angular.js" charset="utf-8"></script>
5250
<script src="../vendor/satellizer.js"></script>
51+
<script src="../vendor/hotkeys.js" charset="utf-8"></script>
5352

5453
<!-- inject:js -->
5554
<!-- endinject -->

src/browser/popup/styles/_popup.styl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
padding: 0
2727
border-right: 1px solid $baseBorderColor
2828
li
29+
white-space nowrap
2930
&:nth-child(even)
3031
background-color $baseBackgroundColor
3132
&:nth-child(odd)

src/browser/popup/styles/app.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
.popup-body .search-block {
2+
padding: 5px;
3+
height: 44px;
4+
position: absolute;
5+
top: 0;
6+
width: 100%;
7+
}
8+
.popup-body .result-block {
9+
position: absolute;
10+
top: 44px;
11+
bottom: 0;
12+
width: 100%;
13+
overflow: hidden;
14+
}
15+
.popup-body .result-block .left-pane {
16+
margin: 0;
17+
position: absolute;
18+
left: 0;
19+
top: 0;
20+
bottom: 0;
21+
width: 40%;
22+
overflow-y: auto;
23+
overflow-x: hidden;
24+
}
25+
.popup-body .result-block .result-list {
26+
list-style: none;
27+
padding: 0;
28+
border-right: 1px solid #001a20;
29+
}
30+
.popup-body .result-block .result-list li {
31+
white-space: nowrap;
32+
}
33+
.popup-body .result-block .result-list li:nth-child(even) {
34+
background-color: #002b36;
35+
}
36+
.popup-body .result-block .result-list li:nth-child(odd) {
37+
background-color: #00323f;
38+
}
39+
.popup-body .result-block .result-list li.active {
40+
color: #fff;
41+
background-color: #088cff;
42+
}
43+
.popup-body .result-block .result-list li a {
44+
display: block;
45+
padding: 5px 10px;
46+
border-bottom: 1px solid #001a20;
47+
}
48+
.popup-body .result-block .right-pane {
49+
position: absolute;
50+
left: 40%;
51+
top: 0;
52+
bottom: 0;
53+
width: 60%;
54+
overflow-y: auto;
55+
overflow-x: hidden;
56+
}
57+
.popup-body .result-block .result-detail-control {
58+
position: absolute;
59+
top: 0;
60+
width: 100%;
61+
height: 34px;
62+
}
63+
.popup-body .result-block .result-detail-content {
64+
position: absolute;
65+
top: 34px;
66+
bottom: 0;
67+
width: 100%;
68+
}

src/browser/shared/config/env.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/* global angular */
22
angular.module('codexen.shared')
3-
.constant('apiUrl', 'http://localhost:8000/')
4-
// .constant('apiUrl', 'http://codexen-server-dev.elasticbeanstalk.com/')
3+
// .constant('apiUrl', 'http://localhost:8000/')
4+
.constant('apiUrl', 'http://codexen-server-dev.elasticbeanstalk.com/')

src/main.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,14 @@ app.on('ready', function () {
8787

8888
var fromMain
8989
// Register a 'ctrl+x' shortcut listener.
90-
var ret = globalShortcut.register('ctrl+tab+shift', function () {
90+
globalShortcut.register('ctrl+tab+shift', function () {
9191
if (popUpWindow.isVisible()) {
9292
hidePopUp()
9393
return
9494
}
9595
fromMain = mainWindow ? mainWindow.isFocused() : false
9696
popUpWindow.show()
97-
9897
})
99-
if (!ret) console.log('registerion fails')
10098

10199
// MENU
102100
var Menu = require('menu')

0 commit comments

Comments
 (0)