Skip to content

Commit dcb93be

Browse files
committed
get ready for publish
1 parent 45fa4af commit dcb93be

11 files changed

Lines changed: 148 additions & 28 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This is only the **FRONTEND**. There is also a backend component which is not op
1414
If you want to see the places where all of the _magic_ happens, take a look at `js/drive.js`, `js/sky.js`, and `js/tabs.js`. Enjoy!
1515

1616
### Recent Updates
17+
+ Tree contents loaded asyncronously
1718
+ Modes dynamically loaded, instead of all at once
1819
+ Can now import and export snippets
1920
+ Open tabs now stored automatically and reloaded
@@ -38,9 +39,11 @@ If you want to see the places where all of the _magic_ happens, take a look at `
3839
+ ~~Dynamically load modes~~ **DONE!**
3940
+ Custom-made color picker (WIP)
4041
+ Chat and collaboration using our backend, so that Onedrive users can chat and collaborate as well
41-
+ Better publishing
42+
+ Better publishing (WIP)
43+
+ ~~Remove Roboto font, use websafe font~~ **KEEP IT, LOADED VIA GOOGLE FONTS**
4244

4345
### Long-Term Goals
46+
+ Improve user onboarding and visual interface
4447
+ Reduce bloat and increase speed
4548

4649
=====

css/style.css

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
body, html{
2-
font-family: 'Roboto-Thin' !important;
2+
font-family: 'Roboto' !important;
33
overflow-x: hidden;
44
overflow-y: hidden;
55
margin: 0;
@@ -56,12 +56,6 @@ body, html{
5656
z-index: 2;
5757
float: left;
5858
}
59-
60-
#overlay{
61-
height:100%;
62-
width:100%;
63-
position:absolute;
64-
}
6559
#navbar-collapse-01{
6660
padding-left:0;
6761
}
@@ -495,6 +489,7 @@ body, html{
495489
position: relative;
496490
margin-left: 14px;
497491
height: 20px;
492+
z-index: 2;
498493
}
499494
.tab-tab h6{
500495
margin: 0;
@@ -550,15 +545,61 @@ body, html{
550545
-webkit-overflow-scrolling: touch;
551546
overflow: visible;
552547
}
553-
#overlay{
554-
background-color: #ECF0F1;
555-
z-index: 1;
548+
#overlay, #loading-overlay{
549+
background-color: #2F2E2E;
550+
z-index: 8;
551+
height:100%;
552+
width:100%;
553+
position:absolute;
554+
}
555+
#overlay h3{
556+
text-align: center;
557+
color: #DADEDF;
556558
}
557559
#overlay h4{
558560
text-align: center;
559-
text-transform: uppercase;
560561
margin-top: 14px;
561562
color: #DADEDF;
563+
font-weight: 300;
564+
}
565+
#overlay > div{
566+
display: flex;
567+
display: -webkit-flex;
568+
display: -moz-flex;
569+
}
570+
#overlay > div > div{
571+
flex: 1;
572+
text-align: center;
573+
color: #DADEDF;
574+
}
575+
#overlay > div > div > i{
576+
padding: 10px;
577+
background-color: #131313;
578+
border-radius: 5px;
579+
padding-left: 15px;
580+
padding-right: 15px;
581+
}
582+
#loading-overlay > div{
583+
width: 100%;
584+
height: 100%;
585+
display: flex;
586+
display: -webkit-flex;
587+
display: -moz-flex;
588+
justify-content: center;
589+
align-items: center;
590+
}
591+
#loading-overlay > div > div{
592+
width: 90%;
593+
height: 10px;
594+
background-color: #131313;
595+
border-radius: 5px;
596+
}
597+
#loading-overlay > div > div > span{
598+
height: 10px;
599+
width: 20%;
600+
background-color: #FF8F00;
601+
position: absolute;
602+
border-radius: 5px;
562603
}
563604
.codemirror-container{
564605
z-index: 2;
@@ -619,7 +660,8 @@ body, html{
619660
padding: 0px;
620661
background-color: transparent;
621662
text-align: center;
622-
font-family: 'Roboto-Thin';
663+
font-family: 'Roboto';
664+
font-weight: 300;
623665
z-index: 11;
624666
font-size: 17px;
625667
float: right;
@@ -669,7 +711,8 @@ body, html{
669711

670712
.option-div h4{
671713
margin: 0;
672-
font-family: 'Roboto-Thin';
714+
font-family: 'Roboto';
715+
font-weight: 300;
673716
color: #9E9E9E;
674717
float: left;
675718
}
@@ -851,7 +894,8 @@ FILE BROWSING TREE
851894
}
852895
.tree li{
853896
color: #C8CDCF;
854-
font-family: 'Roboto-Thin';
897+
font-family: 'Roboto';
898+
font-weight: 300;
855899
font-weight: 600;
856900
font-size: 11px;
857901
margin-top: 5px;
@@ -1145,9 +1189,10 @@ LOADING ICON
11451189
position: absolute;
11461190
z-index: 90;
11471191
background-color: white;
1148-
border-radius: 2px;
1192+
border-radius: 1px;
11491193
right: 5px;
11501194
top: 35px;
1195+
border: solid 1px #E6E6E6;
11511196
}
11521197
.popup>span{
11531198
display: block;

index.html

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
4+
<link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900' rel='stylesheet' type='text/css'>
5+
<link rel="stylesheet" href="css/style.css">
56
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
67
<meta charset="utf-8">
78
<script>
@@ -27,16 +28,13 @@
2728
<script src="lib/slider/files/slider.js"></script>
2829
<!--link rel="stylesheet" href="lib/messenger/css/messenger.css"-->
2930
<!--link rel="stylesheet" href="lib/messenger/css/messenger-theme-air.css"-->
30-
<link rel="stylesheet" href="fonts/font.css">
3131
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
32-
<link rel="stylesheet" href="css/style.css">
3332
<link rel="stylesheet" href="css/material.css">
3433
<link href='https://cdn.jsdelivr.net/devicons/1.8.0/css/devicons.min.css' rel='stylesheet'>
3534
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.5/clipboard.min.js"></script>
3635

3736
</head>
3837
<body>
39-
<link rel="stylesheet" href="fonts/font.css">
4038
<img id="paper-loading-spinner" style="display:none" src="images/svg/spinner.svg" height="40px" width="40px"/>
4139

4240
<div id="side" style="/*display:none*/">
@@ -182,9 +180,9 @@
182180
<div style="width:100%;height:calc(100% - 15px);position:fixed;z-index: 0;" class="move">
183181
<div class="tab-wrapper">
184182
<div class="tab-container">
185-
<span class="tab-tab tab-active" data-fileid="welcome" onclick="manager.openTab('welcome')">
183+
<span class="tab-tab tab-active" data-fileid="welcome">
186184
<i class="fa fa-align-left"></i>
187-
<h4>Welcome</h4>
185+
<h4 onclick="manager.openTab('welcome')">Welcome</h4>
188186
<h6>
189187
<i class="zmdi zmdi-close" onclick="manager.removeTab('welcome')"></i>
190188
</h6>
@@ -330,10 +328,30 @@ <h6>
330328
<span id="insert-point" style="display:none"></span>
331329
</div>
332330

333-
<div id="overlay">
334-
<h4>NO FILE</h4>
335-
<h4><i class="fa fa-question"></i></h4>
336-
<h4>SELECTED</h4>
331+
<div id="loading-overlay">
332+
<div>
333+
<div>
334+
<span style="width: 5%" id="loading-bar"></span>
335+
</div>
336+
</div>
337+
</div>
338+
339+
<div id="overlay" style="display:none">
340+
<h3>Let's Get Started</h3>
341+
<div>
342+
<div>
343+
<i class="zmdi zmdi-folder" onclick="picker.open()"></i>
344+
<h4>Open a file</h4>
345+
</div>
346+
<div>
347+
<i class="zmdi zmdi-upload" onclick="picker.upload()"></i>
348+
<h4>Upload</h4>
349+
</div>
350+
<div>
351+
<i class="zmdi zmdi-plus" onclick="new_file()"></i>
352+
<h4>New file</h4>
353+
</div>
354+
</div>
337355
</div>
338356
</div>
339357
</div>

js/context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ context.contextListener = function() {
105105
//now, check if need to open
106106
var tab_tab = context.clickInsideElement(e, "tab-tab");
107107
if(tab_tab){
108-
manager.openTab($(tab_tab).attr("data-fileid"));
108+
//manager.openTab($(tab_tab).attr("data-fileid"));
109109
}
110110
}
111111
});

js/drive.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ drive.load = function(){
1313
gapi.client.setApiKey(developerKey);
1414
window.setTimeout(function(){
1515
gapi.auth.authorize({'client_id': drive.client_id, 'scope': drive.scopes.join(' '), 'immediate': true}, function(authResult){
16+
$("#loading-bar").css("width","60%");
1617
drive.loaded = true;
1718
console.log(authResult);
1819

@@ -48,6 +49,7 @@ drive.checkAppLogin = function(callback){
4849

4950
drive.loadClient = function() {
5051
gapi.client.load('drive', 'v2', function(){
52+
$("#loading-bar").css("width","70%");
5153
//this need to be refreshed every 55 minutes
5254
setInterval(function(){
5355
drive.refresh();
@@ -77,6 +79,7 @@ drive.refresh = function() {
7779
drive.getInfo = function(){
7880
var request = gapi.client.drive.about.get();
7981
request.execute(function(resp) {
82+
$("#loading-bar").css("width","90%");
8083
drive.root = resp.rootFolderId;
8184
try{
8285
drive.email = resp.user.emailAddress;
@@ -110,6 +113,7 @@ drive.getInfo = function(){
110113
catch(e){}
111114
$(".root-tree").attr("data-tree-ul", drive.root);
112115
get_tree(drive.root);
116+
$("#loading-overlay").css("display","none");
113117
});
114118
}
115119

js/editor.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ manager.removeTab = function(id){
9898
}
9999
manager.reallyRemove = function(id){
100100
hide_loading_spinner(); //nothing should be loading anymore
101+
console.log("here1");
102+
$("#overlay").css("display","block");
101103
//remove the tab div with style!
102104
$(".tab-tab[data-fileid='"+id+"']").velocity("transition.slideUpOut",{
103105
duration: 400,
@@ -124,6 +126,7 @@ manager.reallyRemove = function(id){
124126
}
125127

126128
manager.openTab = function(id){
129+
$("#overlay").css("display","none");
127130
//remove .active from the current .active tab
128131
$(".tab-active").removeClass("tab-active");
129132
$(".tab-tab[data-fileid='"+id+"']").addClass("tab-active");

js/frontend.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,40 @@ connect.settings.getSettings = function(callback){
8282
});
8383
};
8484

85+
connect.publish = function(content, mode, fileId){
86+
if(mode === "text/x-markdown" || mode === "gfm"){
87+
content = converter.makeHtml(content);
88+
}
89+
90+
var userId = null;
91+
fileId = fileId.replace(/-/g, '');
92+
93+
if(cloud_use === "drive"){
94+
userId = drive.id;
95+
}
96+
else if(cloud_use === "sky"){
97+
userId = sky.id;
98+
}
99+
100+
var info = {
101+
mode: mode,
102+
content: content,
103+
fileId: fileId,
104+
userId: userId
105+
};
106+
107+
$.ajax("https://codeyourcloud.com/publish",{
108+
method: "POST",
109+
data: info,
110+
success: function(data, textStatus, jqXHR){
111+
112+
},
113+
error: function(jqXHR, textStatus, errorThrown){
114+
throw errorThrown;
115+
}
116+
});
117+
}
118+
85119

86120
var connection = new WebSocket('wss://codeyourcloud.com:8080');
87121
connection.onopen = function () {

js/ready.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//=============
66
//INITIALIZE WELCOME EDITOR
77
//============
8+
89
var e = CodeMirror(document.getElementById("welcome"),{
910
lineNumbers: settings.state.lineNumbers,
1011
mode: "text",
@@ -20,6 +21,7 @@ var e = CodeMirror(document.getElementById("welcome"),{
2021
//sets the introduction text
2122
e.setValue(introText);
2223
addEditor(e, "welcome", true);
24+
2325
current_file = "welcome";
2426
editor().on("beforeSelectionChange", function(cm, selection){});
2527
editor().setOption("autoCloseBrackets",true); //TODO: make this optional

js/realtime.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function init(){
2121
_init = true;
2222
//decide wether to load sky or drive
2323
drive.checkAppLogin(function(_logged_in){
24+
$("#loading-bar").css("width","10%");
2425
if(_logged_in === false){
2526
console.log("redirect for no app login");
2627
if(window.location.href.indexOf("no=true") === -1){
@@ -33,6 +34,7 @@ function init(){
3334
if(sky.logged_in === true){
3435
//ok...load sky, I guess
3536
cloud_use = "sky";
37+
$("#loading-bar").css("width","30%");
3638
}
3739
else{
3840
console.log("redirect for skydrive");
@@ -45,6 +47,7 @@ function init(){
4547
//indication of drive
4648
if(drive.logged_in === true){
4749
//all good!
50+
$("#loading-bar").css("width","30%");
4851
}
4952
else{
5053
console.log("redirect for drive");
@@ -57,12 +60,15 @@ function init(){
5760
//no indication
5861
if(drive.logged_in === true && sky.logged_in === false){
5962
//all good!
63+
$("#loading-bar").css("width","30%");
6064
}
6165
else if(drive.logged_in === false && sky.logged_in === true){
6266
cloud_use = "sky";
67+
$("#loading-bar").css("width","30%");
6368
}
6469
else if(drive.logged_in === true && sky.logged_in === true){
6570
//all good! -> prioritize drive
71+
$("#loading-bar").css("width","30%");
6672
}
6773
else{
6874
console.log("redirect for none");

0 commit comments

Comments
 (0)