Commit df16f201 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Sebastien Robin

Rename vars.

parent 4a4b4a5b
...@@ -49,7 +49,7 @@ $().ready(function() { ...@@ -49,7 +49,7 @@ $().ready(function() {
<div> <div>
<input type="text" <input type="text"
name="fileName" name="fileName"
id="input_fileName" id="input_file_name"
value="" value=""
placeholder="File name here" />&nbsp; placeholder="File name here" />&nbsp;
<button type="submit" <button type="submit"
......
...@@ -208,7 +208,7 @@ function goToObj(s){ ...@@ -208,7 +208,7 @@ function goToObj(s){
<div> <div>
<input type="text" <input type="text"
name="fileName" name="fileName"
id="input_fileName" id="input_file_name"
value="" value=""
placeholder="File name here" />&nbsp; placeholder="File name here" />&nbsp;
<button type="submit" <button type="submit"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<li class="texteditor left-nav-tools"> <li class="texteditor left-nav-tools">
<a href="#/texteditor" <a href="#/texteditor"
onclick="javascript: onclick="javascript:
OfficeJS.open({app:'textEditor'}); OfficeJS.open({app:'text_editor'});
return false;"> return false;">
<i class="icon-font"></i> <i class="icon-font"></i>
New Text Document New Text Document
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<li class="imgeditor left-nav-tools"> <li class="imgeditor left-nav-tools">
<a href="#/imgeditor" <a href="#/imgeditor"
onclick="javascript: onclick="javascript:
OfficeJS.open({app:'imgEditor'}); OfficeJS.open({app:'img_editor'});
return false;"> return false;">
<i class="icon-pencil"></i> <i class="icon-pencil"></i>
New Image New Image
...@@ -38,16 +38,16 @@ ...@@ -38,16 +38,16 @@
<li class="spreadsheet left-nav-tools"> <li class="spreadsheet left-nav-tools">
<a href="#/spreadsheet" <a href="#/spreadsheet"
onclick="javascript: onclick="javascript:
OfficeJS.open({app:'speadsheet'}); OfficeJS.open({app:'spreadsheet'});
return false;"> return false;">
<i class="icon-signal"></i> <i class="icon-signal"></i>
New Spreadsheet New Spreadsheet
</a> </a>
</li> </li>
<!-- <li class="editpreferences left-nav-tools"> --> <!-- <li class="editpreferences left-nav-tools"> -->
<!-- <a href="#/editpreferences" --> <!-- <a href="#/edit_preferences" -->
<!-- onclick="javascript: --> <!-- onclick="javascript: -->
<!-- OfficeJS.open({app:'editpreferences'}); --> <!-- OfficeJS.open({app:'edit_preferences'}); -->
<!-- return false;"> --> <!-- return false;"> -->
<!-- <i class="icon-check"></i> --> <!-- <i class="icon-check"></i> -->
<!-- Edit Preferences --> <!-- Edit Preferences -->
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<li id="nav_document_list_header left-nav-tools"> <li id="nav_document_list_header left-nav-tools">
<a href="#/doclist" <a href="#/doclist"
onclick="javascript: onclick="javascript:
OfficeJS.open({app:'documentLister'}); OfficeJS.open({app:'document_lister'});
return false;"> return false;">
<i class="icon-list"></i> <i class="icon-list"></i>
Document List Document List
......
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
(function () { (function () {
var grid, onSortFunction, onClickFunction, checkboxselector, var grid, onSortFunction, onClickFunction, check_box_selector,
onRemoveSeveral, showIconFormatter, onRemoveSeveral, showIconFormatter,
documentlist = OfficeJS.cloneCurrentDocumentList(), document_list = OfficeJS.cloneCurrentDocumentList(),
columns = [], columns = [],
options = { options = {
enableCellNavigation: true, enableCellNavigation: true,
...@@ -62,18 +62,18 @@ ...@@ -62,18 +62,18 @@
var i, lm, cd, split, mime; var i, lm, cd, split, mime;
for (i = 0; i < array.length; i += 1) { for (i = 0; i < array.length; i += 1) {
// file names // file names
split = array[i].fileName.split('.'); split = array[i].name.split('.');
array[i].fileExt = ''; array[i].ext = '';
if (split.length > 1) { if (split.length > 1) {
array[i].fileExt = split[split.length-1]; array[i].ext = split[split.length-1];
split.length -= 1; split.length -= 1;
} }
array[i].fileBaseName = split.join('.'); array[i].base_name = split.join('.');
// app & icon // app & icon
mime = OfficeJS.getMimeOfExt (array[i].fileExt); mime = OfficeJS.getMimeOfExt (array[i].ext);
if (!mime) { if (!mime) {
array[i].icon = '?'; array[i].icon = '?';
array[i].app = 'textEditor'; array[i].app = 'text_editor';
} else { } else {
array[i].icon = mime.icon; array[i].icon = mime.icon;
array[i].app = mime.pref || mime.app; array[i].app = mime.pref || mime.app;
...@@ -81,51 +81,51 @@ ...@@ -81,51 +81,51 @@
// dates // dates
// FIXME : we can have 2012/1/1 12:5 // FIXME : we can have 2012/1/1 12:5
// we should have 2012/01/01 12:05 // we should have 2012/01/01 12:05
lm = (new Date(array[i].lastModified)); lm = (new Date(array[i].last_modified));
cd = (new Date(array[i].creationDate)); cd = (new Date(array[i].creation_date));
array[i].lastModified = lm.getFullYear()+'/'+ array[i].last_modified = lm.getFullYear()+'/'+
(lm.getMonth()+1)+'/'+lm.getDate()+' '+ (lm.getMonth()+1)+'/'+lm.getDate()+' '+
lm.getHours()+':'+lm.getMinutes(); lm.getHours()+':'+lm.getMinutes();
array[i].creationDate = cd.getFullYear()+'/'+ array[i].creation_date = cd.getFullYear()+'/'+
(cd.getMonth()+1)+'/'+cd.getDate()+' '+ (cd.getMonth()+1)+'/'+cd.getDate()+' '+
cd.getHours()+':'+cd.getMinutes(); cd.getHours()+':'+cd.getMinutes();
} }
}(documentlist)); }(document_list));
$(function () { $(function () {
checkboxselector = new Slick.CheckboxSelectColumn({ check_box_selector = new Slick.CheckboxSelectColumn({
cssClass: "slick-cell-checkboxsel" cssClass: "slick-cell-checkboxsel"
}); });
columns.push(checkboxselector.getColumnDefinition()); columns.push(check_box_selector.getColumnDefinition());
columns.push({id:"icon",name:"",field:"icon", columns.push({id:"icon",name:"",field:"icon",
sortable:true,resizable:false,width:24, sortable:true,resizable:false,width:24,
formatter:showIconFormatter}); formatter:showIconFormatter});
columns.push({id:"fileName",name:"Document", columns.push({id:"file_name",name:"Document",
field:"fileBaseName",sortable:true}); field:"base_name",sortable:true});
columns.push({id:"lastModified",name:"Modified", columns.push({id:"last_modified",name:"Modified",
field:"lastModified",sortable:true}); field:"last_modified",sortable:true});
columns.push({id:"creationDate",name:"Created", columns.push({id:"creation_date",name:"Created",
field:"creationDate",sortable:true}); field:"creation_date",sortable:true});
grid = new Slick.Grid("#myDocumentList", grid = new Slick.Grid("#myDocumentList",
documentlist, document_list,
columns, columns,
options); options);
grid.setSelectionModel(new Slick.RowSelectionModel( grid.setSelectionModel(new Slick.RowSelectionModel(
{selectActiveRow: false})); {selectActiveRow: false}));
grid.registerPlugin(checkboxselector); grid.registerPlugin(check_box_selector);
onSortFunction = function (e, args) { onSortFunction = function (e, args) {
var cols = args.sortCols; var cols = args.sortCols;
documentlist.sort(function (dataRow1, dataRow2) { document_list.sort(function (data_row1, data_row2) {
var i, l, field, sign, value1, value2, result; var i, l, field, sign, value1, value2, result;
for (i = 0, l = cols.length; i < l; i++) { for (i = 0, l = cols.length; i < l; i++) {
field = cols[i].sortCol.field; field = cols[i].sortCol.field;
sign = cols[i].sortAsc ? 1 : -1; sign = cols[i].sortAsc ? 1 : -1;
value1 = dataRow1[field]; value1 = data_row1[field];
value2 = dataRow2[field]; value2 = data_row2[field];
result = (value1==value2?0:(value1>value2?1:-1))*sign; result = (value1==value2?0:(value1>value2?1:-1))*sign;
if (result != 0) { if (result != 0) {
return result; return result;
...@@ -138,18 +138,18 @@ ...@@ -138,18 +138,18 @@
}; };
onClickFunction = function (e) { onClickFunction = function (e) {
var cell = grid.getCellFromEvent(e); var cell = grid.getCellFromEvent(e);
if (cell.cell === grid.getColumnIndex('fileName')) { if (cell.cell === grid.getColumnIndex('file_name')) {
OfficeJS.open({app:documentlist[cell.row].app, OfficeJS.open({app:document_list[cell.row].app,
fileName:documentlist[cell.row].fileName}); file_name:document_list[cell.row].name});
} }
}; };
onRemoveSeveral = function () { onRemoveSeveral = function () {
var documentnamesarray = [], selected, i, l; var document_name_array = [], selected, i, l;
selected = grid.getSelectedRows(); selected = grid.getSelectedRows();
for (i = 0, l = selected.length; i < l; i+= 1) { for (i = 0, l = selected.length; i < l; i+= 1) {
documentnamesarray.push(documentlist[selected[i]].fileName); document_name_array.push(document_list[selected[i]].name);
} }
OfficeJS.removeSeveralFromArray (documentnamesarray); OfficeJS.removeSeveralFromArray (document_name_array);
}; };
document.querySelector ('#slickgrid_document_lister_remove_selected'). document.querySelector ('#slickgrid_document_lister_remove_selected').
onclick = onRemoveSeveral; onclick = onRemoveSeveral;
......
<div> <div>
<input type="text" <input type="text"
name="fileName" name="fileName"
id="input_fileName" id="input_file_name"
value="" value=""
placeholder="File name here" />&nbsp; placeholder="File name here" />&nbsp;
<button type="submit" <button type="submit"
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<script type="text/javascript" src="src/localorcookiestorage.js"></script> <script type="text/javascript" src="src/localorcookiestorage.js"></script>
<script type="text/javascript" src="src/jio.js"></script> <script type="text/javascript" src="src/jio.js"></script>
<script type="text/javascript" src="lib/base64/base64.js"></script> <script type="text/javascript" src="lib/base64/base64.js"></script>
<script type="text/javascript" src="lib/sjcl/sjcl.js"></script>
<script type="text/javascript" src="src/jio.storage.js"></script> <script type="text/javascript" src="src/jio.storage.js"></script>
</head> </head>
<body> <body>
......
This diff is collapsed.
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// - dummyallfail // - dummyallfail
// - dummyallnotfound // - dummyallnotfound
// - dummyall3tries // - dummyall3tries
(function () { var jio_dummy_storage_loader = function ( Jio ) { (function () { var jioDummyStorageLoader = function ( Jio ) {
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// Dummy Storage 1 : all ok // Dummy Storage 1 : all ok
...@@ -33,16 +33,16 @@ ...@@ -33,16 +33,16 @@
// Returns a document object containing all information of the // Returns a document object containing all information of the
// document and its content. // document and its content.
// document object is {'fileName':string,'fileContent':string, // document object is {'name':string,'content':string,
// 'creationDate':date,'lastModified':date} // 'creation_date':date,'last_modified':date}
// wait a little in order to simulate asynchronous operation // wait a little in order to simulate asynchronous operation
setTimeout(function () { setTimeout(function () {
var doc = { var doc = {
'fileContent': 'content', 'content': 'content',
'fileName': 'file', 'name': 'file',
'creationDate': 10000, 'creation_date': 10000,
'lastModified': 15000}; 'last_modified': 15000};
that.done(doc); that.done(doc);
}, 100); }, 100);
}; // end loadDocument }; // end loadDocument
...@@ -51,17 +51,17 @@ ...@@ -51,17 +51,17 @@
// It returns a document array containing all the user documents // It returns a document array containing all the user documents
// informations, but not their content. // informations, but not their content.
// the list is [object,object] -> object = {'fileName':string, // the list is [object,object] -> object = {'name':string,
// 'lastModified':date,'creationDate':date} // 'last_modified':date,'creation_date':date}
setTimeout(function () { setTimeout(function () {
var list = [ var list = [
{'fileName':'file', {'name':'file',
'creationDate':10000, 'creation_date':10000,
'lastModified':15000}, 'last_modified':15000},
{'fileName':'memo', {'name':'memo',
'creationDate':20000, 'creation_date':20000,
'lastModified':25000 'last_modified':25000
}]; }];
that.done(list); that.done(list);
}, 100); }, 100);
...@@ -107,8 +107,8 @@ ...@@ -107,8 +107,8 @@
that.loadDocument = function () { that.loadDocument = function () {
// Returns a document object containing nothing. // Returns a document object containing nothing.
// document object is {'fileName':string,'fileContent':string, // document object is {'name':string,'content':string,
// 'creationDate':date,'lastModified':date} // 'creation_date':date,'last_modified':date}
// wait a little in order to simulate asynchronous operation // wait a little in order to simulate asynchronous operation
setTimeout(function () { setTimeout(function () {
...@@ -120,8 +120,8 @@ ...@@ -120,8 +120,8 @@
that.getDocumentList = function () { that.getDocumentList = function () {
// It returns nothing. // It returns nothing.
// the list is [object,object] -> object = {'fileName':string, // the list is [object,object] -> object = {'name':string,
// 'lastModified':date,'creationDate':date} // 'last_modified':date,'creation_date':date}
setTimeout(function () { setTimeout(function () {
that.fail({status:0,statusText:'Unknown Error', that.fail({status:0,statusText:'Unknown Error',
...@@ -171,8 +171,8 @@ ...@@ -171,8 +171,8 @@
that.loadDocument = function () { that.loadDocument = function () {
// Returns a document object containing nothing. // Returns a document object containing nothing.
// document object is {'fileName':string,'fileContent':string, // document object is {'name':string,'content':string,
// 'creationDate':date,'lastModified':date} // 'creation_date':date,'last_modified':date}
// wait a little in order to simulate asynchronous operation // wait a little in order to simulate asynchronous operation
setTimeout(function () { setTimeout(function () {
...@@ -185,8 +185,8 @@ ...@@ -185,8 +185,8 @@
that.getDocumentList = function () { that.getDocumentList = function () {
// It returns nothing. // It returns nothing.
// the list is [object,object] -> object = {'fileName':string, // the list is [object,object] -> object = {'name':string,
// 'lastModified':date,'creationDate':date} // 'last_modified':date,'creation_date':date}
setTimeout(function () { setTimeout(function () {
that.fail({status:404,statusText:'Not Found', that.fail({status:404,statusText:'Not Found',
...@@ -214,15 +214,15 @@ ...@@ -214,15 +214,15 @@
newDummyStorageAll3Tries = function ( spec, my ) { newDummyStorageAll3Tries = function ( spec, my ) {
var that = Jio.newBaseStorage( spec, my ), priv = {}; var that = Jio.newBaseStorage( spec, my ), priv = {};
priv.doJob = function (ifokreturn) { priv.doJob = function (if_ok_return) {
// wait a little in order to simulate asynchronous operation // wait a little in order to simulate asynchronous operation
setTimeout(function () { setTimeout(function () {
priv.Try3OKElseFail (that.cloneJob().tries,ifokreturn); priv.Try3OKElseFail (that.cloneJob().tries,if_ok_return);
}, 100); }, 100);
}; };
priv.Try3OKElseFail = function (tries,ifokreturn) { priv.Try3OKElseFail = function (tries,if_ok_return) {
if ( tries === 3 ) { if ( tries === 3 ) {
return that.done(ifokreturn); return that.done(if_ok_return);
} }
if ( tries < 3 ) { if ( tries < 3 ) {
return that.fail({message:'' + (3 - tries) + ' tries left.'}); return that.fail({message:'' + (3 - tries) + ' tries left.'});
...@@ -242,20 +242,20 @@ ...@@ -242,20 +242,20 @@
that.loadDocument = function () { that.loadDocument = function () {
priv.doJob ({ priv.doJob ({
'fileContent': 'content2', 'content': 'content2',
'fileName': 'file', 'name': 'file',
'creationDate': 11000, 'creation_date': 11000,
'lastModified': 17000 'last_modified': 17000
}); });
}; // end loadDocument }; // end loadDocument
that.getDocumentList = function () { that.getDocumentList = function () {
priv.doJob([{'fileName':'file', priv.doJob([{'name':'file',
'creationDate':10000, 'creation_date':10000,
'lastModified':15000}, 'last_modified':15000},
{'fileName':'memo', {'name':'memo',
'creationDate':20000, 'creation_date':20000,
'lastModified':25000} 'last_modified':25000}
]); ]);
}; // end getDocumentList }; // end getDocumentList
...@@ -269,25 +269,17 @@ ...@@ -269,25 +269,17 @@
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// add key to storageObjectType of global jio // add key to storageObjectType of global jio
Jio.addStorageType('dummyallok', function (options) { Jio.addStorageType('dummyallok', newDummyStorageAllOk);
return newDummyStorageAllOk(options); Jio.addStorageType('dummyallfail', newDummyStorageAllFail);
}); Jio.addStorageType('dummyallnotfound', newDummyStorageAllNotFound);
Jio.addStorageType('dummyallfail', function (options) { Jio.addStorageType('dummyall3tries', newDummyStorageAll3Tries);
return newDummyStorageAllFail(options);
});
Jio.addStorageType('dummyallnotfound', function (options) {
return newDummyStorageAllNotFound(options);
});
Jio.addStorageType('dummyall3tries', function (options) {
return newDummyStorageAll3Tries(options);
});
}; };
if (window.requirejs) { if (window.requirejs) {
define ('JIODummyStorages',['JIO'], jio_dummy_storage_loader); define ('JIODummyStorages',['JIO'], jioDummyStorageLoader);
} else { } else {
jio_dummy_storage_loader ( JIO ); jioDummyStorageLoader ( JIO );
} }
}()); }());
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment