Skip to content

Commit e68ca84

Browse files
committed
mobile, running, updated README
1 parent b420f3b commit e68ca84

11 files changed

Lines changed: 190 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<li>Vim modes</li>
3333
<li>Preferences</li>
3434
<li>Google Drive integration</li>
35+
<li>Run (javascript only, for now)</li>
3536
</ul>
3637
=====
3738
###Supported Languages###

about/index.html

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ <h6>Download Code Your Cloud for Google Chrome</h6>
6868
<div class="col-md-6 b-left">
6969
<h4>Follow <a href="https://plus.google.com/u/0/b/109834723365906365793/+Codeyourcloudeditor/posts">+Code Your Cloud</a></h4>
7070

71-
<div class="g-post" data-href="https://plus.google.com/109834723365906365793/posts/R4V9UtaggaM"></div>
71+
<div class="g-post" data-href="https://plus.google.com/109834723365906365793/posts/6uk64zLLQDn"></div>
7272
<!-- Place this tag where you want the +1 button to render. -->
7373
<div class="g-plusone" data-annotation="inline" data-width="300"></div>
7474

@@ -186,6 +186,12 @@ <h3 class="tile-title">Lorem generator</h3>
186186
<p>Built-in random text generator</p>
187187
<a class="btn btn-primary btn-large btn-block" href="https://github.com/f/loremjs">GitHub page</a>
188188
</div>
189+
<div class="col-md-3 tile">
190+
<h4><i class="fa fa-play"></i></h4>
191+
<h3 class="tile-title">Run code</h3>
192+
<p>Run javascript code</p>
193+
<a class="btn btn-primary btn-large btn-block" href="http://javascript.cs.lmu.edu/runner/">Demo</a>
194+
</div>
189195
</div>
190196

191197
<h2 id="code">The Code</h2>
@@ -521,19 +527,34 @@ <h4 id="pref">Preferences</h4>
521527
<li>Line Numbers</li>
522528
<li><a href="#vim">Vim</a> mode</li>
523529
</ul>
530+
524531
<p>The menu item to trigger the preferences window is found under the <i class="fa fa-cog"></i> menu at the top-right corner of the editor.</p>
532+
525533
<h4 id="drive">Google Drive Integration</h4>
534+
526535
<p>With Code Your Cloud, you can open, share, edit, upload, and save Google Drive files.</p>
536+
527537
<h6>Opening</h6>
528538
<p>Click the <i class="fa fa-folder-open"></i> icon, or the "open" menu item.<br/>Note: code your cloud CANNOT open Google Docs or Microsoft Office documents.</p>
539+
529540
<h6>Sharing</h6>
530541
<p>In order to allow other people to access your files, click the "share" menu item. If you have not added people to the list of authorized collaborators, they will not be allowed to access the file.</p>
542+
531543
<h6>Creating</h6>
532544
<p>Click the "new" menu item. The document will be titled by its unique file id (a very long string of characters) to prevent name collisions. The file will be created in the root folder of your Google Drive.</p>
545+
533546
<h6>Saving</h6>
534547
<p>Click the "save" menu item, <i class="fa fa-floppy-o"></i> icon, or the save state indicator (to the right of the collaboration button).</p>
548+
535549
<h6>Uploading</h6>
536550
<p>Select the "upload" menu item to upload a file to Google Drive. The file will appear in your root (main) folder.</p>
551+
552+
<h4 id="collab">Collaboration</h4>
553+
<p>Navigate to the document that you want to work on, and press the <i class="fa fa-play"></i> button.</p>
554+
555+
<h4 id="running">Running Code</h4>
556+
<p>You can run code (for now, only javascript) using the <i class="fa fa-play"></i> button.</p>
557+
537558
<h2 id="contact">Contact Us</h1>
538559
<h5>hostmaster@codeyourcloud.com</h5>
539560
<p>If you have any questions or comments, you can also use the comment box below. Please not that any HTML will be stripped out of your comments.</p>

dashboard/index.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@
4545
}
4646
function handleLogin(authResult) {
4747
if (authResult) {
48-
window.location.href="https://codeyourcloud.com";
48+
if(document.URL.indexOf("#") !== -1){
49+
var r = document.URL.split("#")[1];
50+
window.location = 'https://codeyourcloud.com#' + r;
51+
}
52+
if(document.URL.indexOf("?") !== -1 && (document.URL.indexOf("create") !== -1 || document.URL.indexOf("open")) !== -1){
53+
var r1 = document.URL.split("?")[1];
54+
window.location = 'https://codeyourcloud.com?' + r1;
55+
}
56+
else{
57+
window.location.href="https://codeyourcloud.com";
58+
}
4959
}
5060
else {
5161
}

images/iso.jpg

418 KB
Loading

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@
215215
<li onclick="$('#previewModal').modal('show')"><a>Preview</a></li>
216216
<li id="autoButton" onclick="getHint()"><a>Autocomplete</a></li>
217217
<li onclick="$('#randomModal').modal('show')"><a>Lorem generator</a></li>
218+
<li onclick="run()" class="run-button"><a>Run</a></li>
218219
</ul>
219220
</li>
220221
<li class="" id="will_close">
@@ -229,6 +230,7 @@
229230
<div class="btn-group toolBAR">
230231
<button class="btn btn-primary" id="openB" onclick="loadOPicker()"><span class="glyphicon glyphicon-folder-open"></span></button>
231232
<button class="btn btn-primary" onclick="save()" id="headerButton_save_right"><i class="fa fa-floppy-o"></i></button>
233+
<button class="btn btn-primary run-button" onclick="run()"><i class="fa fa-play"></i></button>
232234
<button class="btn btn-primary" id="undoB" onclick="navUndo()"><i class="fa fa-reply"></i></button>
233235
<button class="btn btn-primary" id="redoB" onclick="navRedo()"><i class="fa fa-share"></i></button>
234236
</div>

mobile/index.html

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<link rel="icon" type="image/png" href="http://codeyourcloud.com/favicon.ico">
6+
<title>Code Your Cloud</title>
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<script src="../about/flat/js/jquery-1.8.3.min.js"></script>
9+
10+
<!-- Loading Bootstrap -->
11+
<link href="../about/flat/bootstrap/css/bootstrap.css" rel="stylesheet">
12+
13+
<!-- Loading Flat UI -->
14+
<link href="../about/flat/css/flat-ui.css" rel="stylesheet">
15+
<link rel"stylesheet" href="style.css">
16+
17+
<link rel="shortcut icon" href="images/favicon.ico">
18+
19+
<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
20+
<!--[if lt IE 9]>
21+
<script src="../about/flat/js/html5shiv.js"></script>
22+
<script src="../about/flat/js/respond.min.js"></script>
23+
<![endif]-->
24+
25+
<!--
26+
CODEMIRROR
27+
-->
28+
<script src = "/lib/codemirror/lib/codemirror.js"></script>
29+
<link rel='stylesheet' type='text/css' href='/lib/codemirror/lib/codemirror.css'>
30+
<script src = '/lib/codemirror/mode/css/css.js' async="true"></script>
31+
<script src = "/lib/codemirror/mode/mode.js" async="true"></script>
32+
<link rel='stylesheet' type='text/css' href='/lib/codemirror/theme/theme.css'>
33+
</head>
34+
<body>
35+
<div class="container">
36+
37+
</div>
38+
<!-- /.container -->
39+
40+
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
41+
<div class="navbar-header">
42+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#nav1">
43+
<span class="sr-only">Toggle navigation</span>
44+
<span class="icon-bar"></span>
45+
<span class="icon-bar"></span>
46+
<span class="icon-bar"></span>
47+
</button>
48+
</div>
49+
<div class="collapse navbar-collapse" id="nav1">
50+
<ul class="nav navbar-nav">
51+
<li class="dropdown" id="codedropdown">
52+
<a class="dropdown-toggle" id="nav-main" data-toggle="dropdown">Code Your Cloud</a>
53+
<ul class="dropdown-menu">
54+
<li><a>Save</a></li>
55+
<li><a>Open</a></li>
56+
<li><a>Rename</a></li>
57+
<li><a>Preferences</a></li>
58+
</ul>
59+
</li>
60+
</ul>
61+
</div>
62+
</nav>
63+
<div id="container">
64+
<div id = "content"></div>
65+
</div>
66+
<!-- Load JS here for greater good =============================-->
67+
<script src="../about/flat/js/jquery-ui-1.10.3.custom.min.js"></script>
68+
<script src="../about/flat/js/jquery.ui.touch-punch.min.js"></script>
69+
<script src="../about/flat/js/bootstrap.min.js"></script>
70+
<script src="../about/flat/js/bootstrap-select.js"></script>
71+
<script src="../about/flat/js/bootstrap-switch.js"></script>
72+
<script src="../about/flat/js/flatui-checkbox.js"></script>
73+
<script src="../about/flat/js/flatui-radio.js"></script>
74+
<script src="../about/flat/js/jquery.tagsinput.js"></script>
75+
<script src="../about/flat/js/jquery.placeholder.js"></script>
76+
77+
<link rel="stylesheet" href="style.css">
78+
<script src="mobile.js"></script>
79+
80+
<script>
81+
$('body').on('touchstart.dropdown', '.dropdown-menu', function (e) {
82+
e.stopPropagation();
83+
});
84+
$('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });
85+
</script>
86+
</body>
87+
</html>

mobile/mobile.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var codeMirror = CodeMirror(document.getElementById("content"), {
2+
lineNumbers: true,
3+
mode: "text",
4+
theme: "mbo",
5+
lineWrapping: false,
6+
indentUnit: 4,
7+
indentWithTabs: true
8+
});

mobile/style.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#codedropdown {
2+
float:none;
3+
}
4+
.nav {
5+
width:100%;
6+
float:none;
7+
text-align:center;
8+
}
9+
html,body{
10+
width:100%;
11+
height:100%;
12+
}
13+
.CodeMirror{
14+
position: relative;
15+
height: 100%;
16+
width: 100%;
17+
margin: 0;
18+
}
19+
#content{
20+
position: relative;
21+
height: 99%;
22+
width: 100%;
23+
margin: 0px;
24+
float: right;
25+
padding-bottom: -30px;
26+
display: inline-block;
27+
margin-top:50px;
28+
}
29+
#container{
30+
position: absolute;
31+
height: 100%;
32+
width: 100%;
33+
}

scripts/main.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,17 @@ function handleAuthResult(authResult) {
7070
loadClient(init);
7171
}
7272
else {
73-
window.location = 'https://codeyourcloud.com/dashboard';
73+
if(document.URL.indexOf("#") !== -1){
74+
var r = document.URL.split("#")[1];
75+
window.location = 'https://codeyourcloud.com/dashboard#' + r;
76+
}
77+
if(document.URL.indexOf("?") !== -1 && (document.URL.indexOf("create") !== -1 || document.URL.indexOf("open")) !== -1){
78+
var r1 = document.URL.split("?")[1];
79+
window.location = 'https://codeyourcloud.com/dashboard?' + r1;
80+
}
81+
else{
82+
window.location = 'https://codeyourcloud.com/dashboard';
83+
}
7484
}
7585
}
7686
function loadClient(callback) {
@@ -278,4 +288,12 @@ function start_anaytics(){
278288
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
279289
ga('create', 'UA-47415821-1', 'codeyourcloud.com');
280290
ga('send', 'pageview');
291+
}
292+
/***********
293+
RUN
294+
***********/
295+
function run(){
296+
if(codeMirror.getOption("mode").indexOf("javascript") !== -1){
297+
eval(codeMirror.getValue());
298+
}
281299
}

scripts/visual.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ function checkFileName(fileValue) { //adjusts the mode based on the file name
113113
var e = exten(fileValue);
114114
codeMirror.setOption("mode", "text"); //default
115115
codeMirror.setOption("extraKeys", {});
116+
$(".run-button").addClass("hide");
116117
switch(e){
117118
case "java":
118119
codeMirror.setOption("mode", "text/x-java");
@@ -143,6 +144,7 @@ function checkFileName(fileValue) { //adjusts the mode based on the file name
143144
codeMirror.setOption("mode", "text/javascript");
144145
startTern();
145146
removeClass("autoButton","hide");
147+
$(".run-button").removeClass("hide");
146148
break;
147149
case "coffee":
148150
codeMirror.setOption("mode", "coffeescript");

0 commit comments

Comments
 (0)