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

jio.js modified

update JQuery from 1.5.2 to 1.7.2
parent e15ffd29
...@@ -23,80 +23,90 @@ ...@@ -23,80 +23,90 @@
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// little functions
var objectDump = function (o) { var objectDump = function (o) {
console.log (JSON.stringify(o)); console.log (JSON.stringify(o));
}; };
var is_array = function (v) {
return Object.prototype.toString.apply(v) === '[object Array]';
};
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Preparing JIO // Preparing JIO
JIO.PubSub.start_saving = function (o,r) { //// Setting events reactions
JIO.subscribe('start_saving', function (o) {
console.log ('start_saving received'); console.log ('start_saving received');
objectDump(o); objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' + $('#divmessage').html($('#divmessage').html() + '<br/>' +
'Saving "' + o.fileName + '"...'); 'Saving ...');
$('#divdebug').html($('#divdebug').html() + '<br/>' + // $('#divdebug').html($('#divdebug').html() + '<br/>' +
'save remainingjobs: ' + r); // 'save remainingjobs: ' + o.remaining.save);
}; });
JIO.PubSub.stop_saving = function (o) { JIO.subscribe('stop_saving', function (o) {
console.log ('stop_saving received'); console.log ('stop_saving received');
objectDump(o); objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' + $('#divmessage').html($('#divmessage').html() + '<br/>' +
'Saving ended with result: ' + o.status + ', message: ' + o.message); 'Saving ended.');
}; });
JIO.PubSub.start_loading = function (o,r) { JIO.subscribe('start_loading', function (e,o,r) {
console.log ('start_loading received'); console.log ('start_loading received');
objectDump(o); objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' + $('#divmessage').html($('#divmessage').html() + '<br/>' +
'Loading "' + o.fileName + '"...'); 'Loading "' + o.fileName + '"...');
$('#divdebug').html($('#divdebug').html() + '<br/>' + $('#divdebug').html($('#divdebug').html() + '<br/>' +
'load remainingjobs: ' + r); 'load remainingjobs: ' + r);
}; });
JIO.PubSub.stop_loading = function (o) { JIO.subscribe('stop_loading', function (e,o) {
console.log ('stop_loading received'); console.log ('stop_loading received');
objectDump(o); objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' + $('#divmessage').html($('#divmessage').html() + '<br/>' +
'Loading ended with result: ' + o.status + ', message: ' + o.message); 'Loading ended with result: ' + o.status + ', message: ' + o.message);
}; });
JIO.PubSub.start_deleting = function (o,r) { JIO.subscribe('start_deleting', function (e,o,r) {
console.log ('start_deleting received'); console.log ('start_deleting received');
objectDump(o); objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' + $('#divmessage').html($('#divmessage').html() + '<br/>' +
'Deleting "' + o.fileName + '"...'); 'Deleting "' + o.fileName + '"...');
$('#divdebug').html($('#divdebug').html() + '<br/>' + $('#divdebug').html($('#divdebug').html() + '<br/>' +
'delete remainingjobs: ' + r); 'delete remainingjobs: ' + r);
}; });
JIO.PubSub.stop_deleting = function (o) { JIO.subscribe('stop_deleting', function (e,o) {
console.log ('stop_deleting received'); console.log ('stop_deleting received');
objectDump(o); objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' + $('#divmessage').html($('#divmessage').html() + '<br/>' +
'Deleting ended with result: ' + o.status + ', message: ' + o.message); 'Deleting ended with result: ' + o.status + ', message: ' + o.message);
}; });
JIO.PubSub.start_gettinglist = function (o) { JIO.subscribe('start_gettinglist', function (e,o) {
console.log ('start_deleting received'); console.log ('start_deleting received');
objectDump(o); objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' + $('#divmessage').html($('#divmessage').html() + '<br/>' +
'Getting list...'); 'Getting list...');
}; });
JIO.PubSub.stop_gettinglist = function (o) { JIO.subscribe('stop_gettinglist', function (e,o) {
console.log ('stop_deleting received'); console.log ('stop_deleting received');
objectDump(o); objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' + $('#divmessage').html($('#divmessage').html() + '<br/>' +
'Getting list ended with result: ' + o.status + ', message: ' + o.message); 'Getting list ended with result: ' + o.status + ', message: ' + o.message);
$('#divdebug').html($('#divdebug').html() + '<br/>' + $('#divdebug').html($('#divdebug').html() + '<br/>' +
'getList: ' + JSON.stringify(o.list)); 'getList: ' + JSON.stringify(o.list));
}; });
JIO.initialize({"type":"local","userName":"tristan"},{"ID":"www.ungproject.com"}); //// events set
//// init JIO
JIO.initialize({"type":"local","userName":"tristan"},"www.ungproject.com");
if ( !JIO.isReady() ) alert('Not ready'); if ( !JIO.isReady() ) alert('Not ready');
// Let's test! //// end init
JIO.loadDocument("SonNom");
JIO.saveDocument("Inside the document.","SonNom"); //// Let's test!
// JIO.loadDocument("SonNom");
JIO.saveDocument("Inside the document.","SonNom"); JIO.saveDocument("Inside the document.","SonNom");
// JIO.saveDocument("Inside the document.","SonNom");
JIO.saveDocument("Inside the document.","SonNom2"); JIO.saveDocument("Inside the document.","SonNom2");
JIO.getDocumentList(); // JIO.getDocumentList();
JIO.loadDocument("SonNom"); // JIO.loadDocument("SonNom");
JIO.deleteDocument("SonNom"); // JIO.deleteDocument("SonNom");
JIO.deleteDocument("SonNom"); // JIO.deleteDocument("SonNom");
JIO.deleteDocument("SonNom3"); // JIO.deleteDocument("SonNom3");
JIO.getDocumentList(); // JIO.getDocumentList();
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
//--> //-->
</script> </script>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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