sincro file con quelle caricate sul server

This commit is contained in:
cri 2015-09-12 18:35:18 +02:00
parent 6f1f9695de
commit fc0c1d0298
2 changed files with 44 additions and 36 deletions

View file

@ -149,7 +149,7 @@ ARKIWI.Arkiwi.prototype.close = function (callback) {
ARKIWI.Arkiwi.prototype.path = function (path, callback, notBase64) { ARKIWI.Arkiwi.prototype.path = function (path, callback, notBase64) {
var pathType = notBase64 ? 'path' : 'path64'; var pathType = notBase64 ? 'path' : 'path64';
$.getJSON(this.endpoint + '/' + pathType + '/' + path + '/jsonml/?' + this.defaultParameters, function (result) { $.getJSON(this.endpoint + '/' + pathType + '/' + path + '/json/?' + this.defaultParameters, function (result) {
if (callback != undefined) if (callback != undefined)
callback(result); callback(result);
}).fail(function (error) { }).fail(function (error) {
@ -165,7 +165,7 @@ ARKIWI.Arkiwi.prototype.search = function (query, callback, jailFolder) {
sanitizedQuery = window.btoa(sanitizedQuery); //convert to Base64 sanitizedQuery = window.btoa(sanitizedQuery); //convert to Base64
$.getJSON(this.endpoint + '/search64/' + sanitizedQuery + '/jsonml/?' + this.defaultParameters, function (result) { $.getJSON(this.endpoint + '/search64/' + sanitizedQuery + '/json/?' + this.defaultParameters, function (result) {
if (callback != undefined) if (callback != undefined)
callback(result); callback(result);
}).fail(function (error) { }).fail(function (error) {

View file

@ -20,13 +20,21 @@ $(document).ready(function () {
var dioporco = Mustache.render(template, listone); var dioporco = Mustache.render(template, listone);
$(".row").append(dioporco); $(".row").append(dioporco);
},true); },true);
}); });
var arkiwi = new ARKIWI.Arkiwi('http://www.arkiwi.org');
arkiwi.search('Ampioraggio', function (result) {
arkiwi.search('Ampioraggio', function (result) {
console.log('Ricerca...'); console.log('Ricerca...');
console.log(result); console.log(result);
}); });
arkiwi.path('XM24', function (result) { arkiwi.path('XM24', function (result) {