Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfadba32

Browse files
authored
Merge pull request#270 from lorderikir/master
[U][P][UX][GAPI] v1.1.0 release
2 parents019fe9e +dddc827 commitfadba32

File tree

9 files changed

+105
-38
lines changed

9 files changed

+105
-38
lines changed

‎Gruntfile.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ module.exports = function(grunt) {
9494
browser:true,
9595
undef:true,
9696
unused:true,
97-
predef:["$","CodeMirror","console","module","require","Tour","onApiLoad","NProgress","createPicker","saveToGDrive"]
97+
predef:["$","CodeMirror","console","module","require","Tour","onApiLoad","NProgress","createPicker","saveToGDrive","folderPicker"]
9898
},
9999
files:['src/js/*.js','Gruntfile.js']
100100
},

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/MARIE-js/MARIE.js.svg?branch=master)](https://travis-ci.org/MARIE-js/MARIE.js)[![Gitter chat](https://badges.gitter.im/MARIE-js/gitter.png)](https://gitter.im/MARIE-js/Lobby)[![npm version](https://badge.fury.io/js/npm.svg)](https://badge.fury.io/js/npm)
44
==============
5-
Current version:`1.0.12`
5+
Current version:`1.1.0`
66

77
MARIE.js is an implementation of a simulator for a 'Machine Architecture that is Really Intuitive and Easy'
88
from[The Essentials of Computer Organization and Architecture](https://books.google.com.au/books/about/The_Essentials_of_Computer_Organization.html?id=3kQoAwAAQBAJ&redir_esc=y) (Linda Null, Julia Lobur) in JavaScript.

‎build/about.html‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
<liclass="divider"></li>
8686
<li><ahref="https://gitreports.com/issue/MARIE-js/MARIE.js/"target="_blank"><spanclass="fa fa-bug"></span> Report an Issue</a></li>
8787
<li><ahref="https://goo.gl/CWAaES"target="_blank"><spanclass="fa fa-paperclip"></span> Submit Feedback</a></li>
88+
<li><ahref="http://stats.uptimerobot.com/xnjJPTJj0"target="_blank"><spanclass="fa fa-check-circle"></span> Server Status</a></li>
8889
</ul>
8990
</li>
9091
</ul>
@@ -111,7 +112,7 @@
111112

112113
<main>
113114
<divid="about"class="container">
114-
<h1class="center">MARIE.js<spanclass="version">v1.0.12</span></h1>
115+
<h1class="center">MARIE.js<spanclass="version">v1.1.0</span></h1>
115116
<h2>About MARIE</h2>
116117
<p>MARIE ('Machine Architecture that is Really Intuitive and Easy') is a machine architecture and assembly language from<ahref="https://books.google.com.au/books/about/The_Essentials_of_Computer_Organization.html?id=3kQoAwAAQBAJ&redir_esc=y"target="_blank">The Essentials of Computer Organization and Architecture</a> (Linda Null, Julia Lobur). The publisher provides a set of<ahref="http://computerscience.jbpub.com/ecoa/3e/simulators.aspx">simulators for the machine</a>, written in Java. However, since using simulators can be rather difficult, we have implemented a web-based version, so that students are able to access it readily and easily. Since beginning the project we have added many features such as importing and exporting of Marie Assembly Source files (*.mas) to provide compatibility with the existing simulators.</p>
117118
<br>
@@ -154,7 +155,7 @@ <h2>License</h2>
154155
<h4class="modal-title"> MARIE.js |<iclass="fa fa-hashtag"></i> Current Version</h4>
155156
</div>
156157
<divclass="modal-body">
157-
<p>This version of<strong>MARIE.js</strong> is: v1.0.12</p>
158+
<p>This version of<strong>MARIE.js</strong> is: v1.1.0</p>
158159
</div>
159160
</div>
160161
</div>

‎build/index.html‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
<liclass="divider"></li>
128128
<li><ahref="https://gitreports.com/issue/MARIE-js/MARIE.js/"target="_blank"><spanclass="fa fa-bug"></span> Report an Issue</a></li>
129129
<li><ahref="https://goo.gl/CWAaES"target="_blank"><spanclass="fa fa-paperclip"></span> Submit Feedback</a></li>
130+
<li><ahref="http://stats.uptimerobot.com/xnjJPTJj0"target="_blank"><spanclass="fa fa-check-circle"></span> Server Status</a></li>
130131
</ul>
131132
</li>
132133
</ul>
@@ -354,7 +355,7 @@ <h4>Input Value</h4>
354355
<h4class="modal-title">MARIE.js |<iclass="fa fa-hashtag"></i> Current Version</h4>
355356
</div>
356357
<divclass="modal-body">
357-
<p>This version of<strong>MARIE.js</strong> is: v1.0.12</p>
358+
<p>This version of<strong>MARIE.js</strong> is: v1.1.0</p>
358359
</div>
359360
</div>
360361
</div>
@@ -369,7 +370,12 @@ <h4 class="modal-title">MARIE.js | <i class="fa fa-hashtag"></i> Current Version
369370
<h4class="modal-title">MARIE.js | Google Drive Save Link</h4>
370371
</div>
371372
<divclass="modal-body">
372-
<pid="linkText">The file is saved to:</p>
373+
<divclass="row">
374+
<pid="linkText">The file is saved to:</p>
375+
</div>
376+
<divclass="row">
377+
You will need to manually add sharing permissions in your drive.
378+
</div>
373379
</div>
374380
</div>
375381
</div>
@@ -575,7 +581,7 @@ <h4 class="modal-title"><span class="fa fa-download"></span> Save File to Google
575581
</div>
576582
<divclass="modal-body">
577583
<divclass="row">
578-
<p>This will savetoyour root (home) of your Google Drive</p>
584+
<p>Enter the file name you wanttocall this file, after select the Folder you want to save it in.</p>
579585
</div>
580586
<divclass="row">
581587
<divclass="col-md-8 text-left">

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"MARIE.js",
3-
"version":"1.0.12",
3+
"version":"1.1.0",
44
"description":"MARIE.js is an implementation of a simulator for a 'Machine Architecture that is Really Intuitive and Easy' from The Essentials of Computer Organization and Architecture (Linda Null, Julia Lobur) in JavaScript.",
55
"main":"index.js",
66
"scripts": {

‎src/js/ext/gapi.js‎

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
/**
4444
* Google Picker Creation Handler.
45-
*@class gapi
4645
*
4746
*@return Returns Picker and Handles a callback once file is selected
4847
*/
@@ -63,7 +62,6 @@
6362

6463
/**
6564
* Google Picker Handler.
66-
*@class gapi
6765
*
6866
*@see createPicker
6967
*@param {string} data Passes authentication
@@ -139,8 +137,9 @@
139137
'userId':'me'
140138
});
141139
request.execute(function(resp){
142-
name=resp.displayName
143-
console.log('Retrieved profile for:'+name);
140+
name=resp.displayName;
141+
console.info('Successfully Logged In');
142+
console.info('Retrieved profile for:'+name);
144143
if(name!==undefined||name!=="undefined"){
145144
$('#nameLink').html('Hello '+name);
146145
$('#nameLink').show();
@@ -157,16 +156,57 @@
157156
console.log('Success');
158157
}
159158

159+
folderPicker=function(){
160+
console.info('Loading FilePicker');
161+
//enable docsView to allow user to pick and interact with Google Drive Folder(s)
162+
vardocsView=newgoogle.picker.DocsView()
163+
.setIncludeFolders(true)
164+
.setMimeTypes('application/vnd.google-apps.folder')
165+
.setSelectFolderEnabled(true);
166+
if(pickerApiLoaded&&oauthToken){
167+
varpicker=newgoogle.picker.PickerBuilder().
168+
addView(docsView).
169+
setOAuthToken(oauthToken).
170+
setDeveloperKey(developerKey).
171+
setCallback(function(data){
172+
varfileName=$("#GFileName").val();
173+
varfileType=$('#saveGFileMode option:selected').val();
174+
175+
if(fileName===""||fileName===null){
176+
fileName="code";//default name set to code.<extension> if not selected
177+
}
178+
if(fileType===""||fileType===null){
179+
fileType="mas";//default name set to <name>.mas if not selected
180+
}
181+
182+
varcode=sessionStorage.getItem('code');
183+
varpickerAction=data[google.picker.Response.ACTION];
184+
varpickedState=google.picker.Action.PICKED;
185+
if(pickerAction===pickedState){
186+
console.log(fileName,fileType);
187+
vardoc=data[google.picker.Response.DOCUMENTS][0];// set the variable doc as First document
188+
varlocationID=doc[google.picker.Document.PARENT_ID]// Folder ID Is the file's Parent ID
189+
console.log(locationID);
190+
varfullFileName=fileName+"."+fileType;
191+
console.log(fullFileName);
192+
saveToGDrive("",locationID,code,fullFileName);
193+
}
194+
}).
195+
build();
196+
picker.setVisible(true);
197+
}
198+
}
199+
200+
160201
/**
161202
* saveToGDrive function
162-
*@class gapi
163203
* Load a file from Drive. Fetches both the metadata & content in parallel.
164204
*
165205
*@param {string} fileID Unique File ID from Google Drive which identifies it
166206
*@param {string} folderId Unique Folder ID of File ID
167207
*@param {string} text text to be updated
168208
*/
169-
saveToGDrive=function(fileID,folderId,text,callback){
209+
saveToGDrive=function(fileID,folderId,text,filename,callback){
170210
//NProgress starts with 10% when entering this function
171211

172212
//GAPI POST/PUT REQUST CONSTs
@@ -178,10 +218,8 @@
178218
varcontentType="plain/text";
179219
varmyToken=gapi.auth.getToken();
180220

181-
varfilename=$("#GFileName").val();
182-
varfileType=$('#saveGFileMode option:selected').val();
183221

184-
filename=filename+"."+fileType;
222+
185223
NProgress.inc(0.1);
186224

187225
if(fileID===""||fileID===null){
@@ -192,7 +230,8 @@
192230
varcontentType=fileData.type||'plain/text';
193231
varmetadata={
194232
'title':filename,
195-
'mimeType':contentType
233+
'mimeType':contentType,
234+
'parents':[{"id":folderId}]
196235
};
197236

198237
varbase64Data=btoa(reader.result);
@@ -239,7 +278,7 @@
239278
NProgress.done();
240279
});
241280
}
242-
}else{
281+
}else{//attempt to update file
243282
varmetadata={'mimeType':contentType,};
244283

245284
varmultipartRequestBody=
@@ -250,10 +289,13 @@
250289
close_delim;
251290

252291
if(!callback){
253-
callback=function(file){f
292+
callback=function(file){
254293
console.log("Update Complete ",file);
255-
savedToURL=request.webViewLink;
294+
varsavedToURL=file.alternateLink;
256295
console.log(savedToURL);
296+
text='The file is located to <a href="'+savedToURL+'" target="_blank">'+savedToURL+'</a>';
297+
$('#linkText').html(text);
298+
$('#saveLink').modal('toggle');
257299
NProgress.done();
258300
};
259301
}
@@ -267,7 +309,7 @@
267309
'body':multipartRequestBody,
268310
});
269311
request.execute(callback);
312+
console.log(request.alternateLink);
270313
}
271314
}
272-
273315
}());

‎src/js/interface.js‎

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,6 +1623,30 @@ window.addEventListener("load", function() {
16231623
}
16241624
NProgress.done();
16251625
});
1626+
1627+
$('#opensgdModal').click(function(){
1628+
NProgress.start();
1629+
varfileID=sessionStorage.getItem('savedFileID');
1630+
varfolderID=sessionStorage.getItem("parentID");
1631+
varcode=programCodeMirror.getValue();
1632+
sessionStorage.setItem('code',code);
1633+
1634+
NProgress.inc(0.1);
1635+
// case when saving for first time
1636+
if(fileID===""||fileID===null||folderID===null||folderID===""){
1637+
$('#savetoGDriveModal').modal('show');//Toggle Modal if file is not actually saved to GoogleDrive
1638+
}else{//otherwise call a direct function
1639+
saveToGDrive(fileID,folderID,code);
1640+
console.log(programCodeMirror.getValue());
1641+
}
1642+
});
1643+
1644+
1645+
1646+
$('#saveToGDrive').click(function(){
1647+
$('#savetoGDriveModal').modal('hide');//hide Modal if file is not actually saved to GoogleDrive
1648+
folderPicker();
1649+
});
16261650
});
16271651

16281652
$(document).ready(function(){
@@ -1636,19 +1660,7 @@ $(document).ready(function(){
16361660
$('#logOut').hide();
16371661
$('#opensgdModal').hide();
16381662

1639-
$('#saveToGDrive').click(function(){
1640-
NProgress.start();
1641-
varfileID=sessionStorage.getItem('savedFileID');
1642-
varfolderID=sessionStorage.getItem("parentID");
1643-
varcode=localStorage.getItem('marie-program');
1644-
NProgress.inc(0.1);
1645-
if(fileID===""||folderID===""){
1646-
$('#savetoGDriveModal').modal('toggle');//Toggle Modal if file is not actually saved to GoogleDrive
1647-
}
1648-
saveToGDrive(fileID,folderID,code);
1649-
});
16501663

1651-
$('#opensgdModal').click(function(){
1652-
$('#savetoGDriveModal').modal('toggle');
1653-
});
1664+
1665+
16541666
});

‎src/templates/index.ejs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@
178178
<h4class="modal-title">MARIE.js | Google Drive Save Link</h4>
179179
</div>
180180
<divclass="modal-body">
181-
<pid="linkText">The file is saved to: </p>
181+
<divclass="row">
182+
<pid="linkText">The file is saved to: </p>
183+
</div>
184+
<divclass="row">
185+
You will need to manually add sharing permissions in your drive.
186+
</div>
182187
</div>
183188
</div>
184189
</div>
@@ -384,7 +389,7 @@
384389
</div>
385390
<divclass="modal-body">
386391
<divclass="row">
387-
<p>This will savetoyour root (home) of your Google Drive</p>
392+
<p>Enter the file name you wanttocall this file, after select the Folder you want to save it in.</p>
388393
</div>
389394
<divclass="row">
390395
<divclass="col-md-8 text-left">

‎src/templates/partials/nav.ejs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<liclass="divider"></li>
7676
<li><ahref="https://gitreports.com/issue/MARIE-js/MARIE.js/"target="_blank"><spanclass="fa fa-bug"></span> Report an Issue</a></li>
7777
<li><ahref="https://goo.gl/CWAaES"target="_blank"><spanclass="fa fa-paperclip"></span> Submit Feedback</a></li>
78+
<li><ahref="http://stats.uptimerobot.com/xnjJPTJj0"target="_blank"><spanclass="fa fa-check-circle"></span> Server Status</a></li>
7879
</ul>
7980
</li>
8081
</ul>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp