Skip to content

Commit a29052d

Browse files
authored
Merge pull request #675 from witheve/feature/save-load-gist
Feature/save load gist
2 parents a9f659e + 8fcca3e commit a29052d

File tree

8 files changed

+374
-47
lines changed

8 files changed

+374
-47
lines changed

assets/css/ide.css

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,22 @@ body { justify-content: stretch; }
3535
/****************************************************************************\
3636
* Navigator
3737
\****************************************************************************/
38-
.navigator-header { display: flex; flex-direction: column; padding:10px 5px; user-select: none; -webkit-user-select: none; margin-bottom:10px; font-size:18px; color: #555; transition:color 0.2s ease-in-out; }
39-
.navigator-pane:hover .navigator-header { color: #aaa; }
38+
.navigator-header { display: flex; flex-direction: column; padding:10px 5px; user-select: none; -webkit-user-select: none; margin-bottom:10px; font-size:18px; color: #aaa; transition:color 0.2s ease-in-out; }
4039
.navigator-header > .controls { display:flex; flex-direction:row; flex:1; }
41-
.navigator-header > .controls > * { height: 20px; text-align: center; transition: transform 0.3s; cursor: pointer; }
42-
.navigator-header > .controls > div:hover { color: #eee; }
40+
.navigator-header > .controls > * {height: 20px; text-align: center; padding: 0 5px; transition: transform 0.3s; cursor: pointer; }
41+
.navigator-header > .controls > *:last-child { margin-right: -5px; }
42+
.navigator-header > .controls > div:not(.disabled):hover { color: #eee; }
4343
.navigator-pane.collapsed:hover .navigator-header > .controls > div { color: #eee; }
44-
.navigator-header:hover > .controls > *:not(.disabled) { }
4544
.navigator-header .collapse-btn { transform: rotate(180deg); color: #999; }
45+
.navigator-header .up-btn.disabled > .up-icon { opacity: 0; }
46+
47+
.navigator-pane .load-dialog { padding: 10 25; color: #555; margin-top: -10px; margin-bottom: 10px; }
48+
.navigator-pane .load-dialog input { padding: 5px; outline: none; border-top-left-radius: 2px; border: 1px solid #CCC; border-bottom-left-radius: 2px; }
49+
.navigator-pane .load-dialog .load-btn { padding: 5px; background: white; border: 1px solid #CCC; border-left-color: transparent; border-top-right-radius: 2px; border-bottom-right-radius: 2px; }
50+
.navigator-pane .load-dialog .load-btn:before { position: relative; top: 3px; }
51+
.navigator-pane .load-dialog .load-btn:hover { background: #EEE; }
52+
.navigator-pane .load-dialog .load-btn:active { background: #DDD; }
53+
4654
.navigator-header .up-btn .label { display: flex; font-size:16px; margin-left: 10px; }
4755
.navigator-header .label { white-space: pre; display:none; }
4856

@@ -81,16 +89,35 @@ body { justify-content: stretch; }
8189
/****************************************************************************\
8290
* Notices
8391
\****************************************************************************/
84-
.main-pane { display: flex; flex-direction: column; justify-content: stretch; overflow-y: hidden; }
85-
.main-pane .notices { display: flex; flex: 0 0 auto; flex-direction: column; }
92+
.main-pane { display: flex; flex-direction: column; justify-content: stretch; overflow-y: hidden; position: relative; }
93+
.main-pane .notices { display: flex; flex: 0 0 auto; flex-direction: column; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; }
8694

87-
.main-pane .notices > .notice { padding: 5px 60px; background: #e0e0e0; flex: 0 0 auto; }
88-
.main-pane .notices > .notice + .notice { border-bottom: 1px solid #d0d0d0; }
95+
.main-pane .notices > .notice { padding: 5px 60px; background: #f5f5f5; flex: 0 0 auto; }
96+
.main-pane .notices > .notice + .notice { border-top: 1px solid #ddd; }
8997
.main-pane .notices > .notice > .time { margin-right: 10px; }
9098

99+
.main-pane .notices > .notice > .dismiss-btn { margin-left: 10px; vertical-align: bottom; align-self: center; opacity: 0; transition: opacity 0.2s; }
100+
.main-pane .notices:hover > .notice > .dismiss-btn { opacity: 1; }
101+
.main-pane .notices > .notice > .dismiss-btn:hover { background: #eee; }
102+
91103
.main-pane .notices > .notice.error { background: rgb(255, 216, 222); }
92104
.main-pane .notices > .notice.warning { background: rgb(255, 247, 217); }
93105

106+
/****************************************************************************\
107+
* Modals
108+
\****************************************************************************/
109+
.main-pane > .modal-overlay {display: flex;justify-content: center;align-items: center;position: absolute;top: 0;left: 0;bottom: 0;right: 0;z-index: 5;background: rgba(0, 0, 0, 0.1);}
110+
.main-pane > .modal-overlay .modal-window { display: flex; flex-direction: column; width: 320; padding: 20; background: #FFF; border-radius: 4px; z-index: 10; box-shadow: 0 4px 5px rgba(0, 0, 0, 0.25); }
111+
.main-pane > .modal-overlay .modal-window h3 { align-self: center; margin-top: 0; }
112+
.main-pane > .modal-overlay .modal-window .controls { flex: 0 0 auto; }
113+
.main-pane > .modal-overlay .modal-window .btn { flex: 1; text-align: center; padding: 5 10; border: 1px solid #DDD; border-radius: 4px; -webkit-user-select: none; -moz-webkit-user-select: none; }
114+
.main-pane > .modal-overlay .modal-window .btn + .btn { margin-left: 10; }
115+
.main-pane > .modal-overlay .modal-window .btn:hover { background: #EEE; }
116+
.main-pane > .modal-overlay .modal-window .btn:active {background: #DDD; }
117+
.main-pane > .modal-overlay .modal-window .btn.danger { background: #EE5555; color: white; border: #CC3333; }
118+
.main-pane > .modal-overlay .modal-window .btn.danger:hover { background: #DD4444; }
119+
.main-pane > .modal-overlay .modal-window .btn.danger:active { background: #CC3333; }
120+
94121
/****************************************************************************\
95122
* Editor
96123
\****************************************************************************/

examples/todomvc.eve

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ bind @browser
5252
[#strong text: todo-count]
5353
[#span text: " items left"]]
5454
[#ul #filters, class: "filters", children:
55-
[#li children: [#a href: "#/examples/todomvc.eve/#/all" text: "all"
55+
[#li children: [#a href: "#/all" text: "all"
5656
class: [selected: is(filter = "all")]]]
57-
[#li children: [#a href: "#/examples/todomvc.eve/#/active" text: "active"
57+
[#li children: [#a href: "#/active" text: "active"
5858
class: [selected: is(filter = "active")]]]
59-
[#li children: [#a href: "#/examples/todomvc.eve/#/completed" text: "completed"
59+
[#li children: [#a href: "#/completed" text: "completed"
6060
class: [selected: is(filter = "completed")]]]]
6161
[#span #clear-completed text: "Clear completed"
6262
class: [clear-completed: true,

src/client.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ export class EveClient {
287287
// Ensure the URL bar is in sync with the server.
288288
// @FIXME: This back and forth of control over where we are
289289
// is an Escherian nightmare.
290+
290291
if(!data.path) {
291292
history.pushState({}, "", window.location.pathname);
292293
}
@@ -469,11 +470,13 @@ function changeDocument() {
469470
let ide = client.ide;
470471
// @FIXME: This is not right in the non-internal case.
471472
let docId = "/examples/quickstart.eve";
472-
let path = location.hash && location.hash.split('?')[0].split("#/")[1];
473+
let path = location.hash && location.hash.split('?')[0].split("#")[1];
474+
if(path[path.length - 1] === "/") path = path.slice(0, -1);
473475
if(path && path.length > 2) {
474476
if(path[path.length - 1] === "/") path = path.slice(0, -1);
475-
docId = "/" + path;
477+
docId = path;
476478
}
479+
477480
if(!docId) return;
478481
if(docId === ide.documentId) return;
479482
try {

0 commit comments

Comments
 (0)