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 @@
<script type="text/javascript">
<!--
////////////////////////////////////////////////////////////////////////////////
// little functions
var objectDump = function (o) {
console.log (JSON.stringify(o));
};
var is_array = function (v) {
return Object.prototype.toString.apply(v) === '[object Array]';
};
////////////////////////////////////////////////////////////////////////////////
// Preparing JIO
JIO.PubSub.start_saving = function (o,r) {
//// Setting events reactions
JIO.subscribe('start_saving', function (o) {
console.log ('start_saving received');
objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' +
'Saving "' + o.fileName + '"...');
$('#divdebug').html($('#divdebug').html() + '<br/>' +
'save remainingjobs: ' + r);
};
JIO.PubSub.stop_saving = function (o) {
'Saving ...');
// $('#divdebug').html($('#divdebug').html() + '<br/>' +
// 'save remainingjobs: ' + o.remaining.save);
});
JIO.subscribe('stop_saving', function (o) {
console.log ('stop_saving received');
objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' +
'Saving ended with result: ' + o.status + ', message: ' + o.message);
};
JIO.PubSub.start_loading = function (o,r) {
'Saving ended.');
});
JIO.subscribe('start_loading', function (e,o,r) {
console.log ('start_loading received');
objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' +
'Loading "' + o.fileName + '"...');
$('#divdebug').html($('#divdebug').html() + '<br/>' +
'load remainingjobs: ' + r);
};
JIO.PubSub.stop_loading = function (o) {
});
JIO.subscribe('stop_loading', function (e,o) {
console.log ('stop_loading received');
objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' +
'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');
objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' +
'Deleting "' + o.fileName + '"...');
$('#divdebug').html($('#divdebug').html() + '<br/>' +
'delete remainingjobs: ' + r);
};
JIO.PubSub.stop_deleting = function (o) {
});
JIO.subscribe('stop_deleting', function (e,o) {
console.log ('stop_deleting received');
objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' +
'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');
objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' +
'Getting list...');
};
JIO.PubSub.stop_gettinglist = function (o) {
});
JIO.subscribe('stop_gettinglist', function (e,o) {
console.log ('stop_deleting received');
objectDump(o);
$('#divmessage').html($('#divmessage').html() + '<br/>' +
'Getting list ended with result: ' + o.status + ', message: ' + o.message);
$('#divdebug').html($('#divdebug').html() + '<br/>' +
'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');
// Let's test!
JIO.loadDocument("SonNom");
JIO.saveDocument("Inside the document.","SonNom");
//// end init
//// Let's test!
// JIO.loadDocument("SonNom");
JIO.saveDocument("Inside the document.","SonNom");
// JIO.saveDocument("Inside the document.","SonNom");
JIO.saveDocument("Inside the document.","SonNom2");
JIO.getDocumentList();
JIO.loadDocument("SonNom");
JIO.deleteDocument("SonNom");
JIO.deleteDocument("SonNom");
JIO.deleteDocument("SonNom3");
JIO.getDocumentList();
// JIO.getDocumentList();
// JIO.loadDocument("SonNom");
// JIO.deleteDocument("SonNom");
// JIO.deleteDocument("SonNom");
// JIO.deleteDocument("SonNom3");
// JIO.getDocumentList();
////////////////////////////////////////////////////////////////////////////////
//-->
</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