arkiwi_boilerplate/app/scripts/main_list_item_id.js
2015-09-13 02:43:10 +02:00

88 lines
2.1 KiB
JavaScript

/*------------------------------------------------------------------------------------------------------------------------
@package: arkiwiJsBoilerplate
@author: cek
@www: arkiwi.oeg
@copyright: COPYRIGHT 18 cek
@license: MIT
=============================================================================
Filename: main.js
=============================================================================
This file is the main entry point for js on the arkiwiJsBoilerplate app.
--------------------------------------------------------------------------------------------------------------------- */
$(document).ready(function () {
var iframe_id = $(window.frameElement).attr("data-arkiwi-id");
//console.log(iframe_id);
var iframe_type = "audio"
var iframe_type = $(window.frameElement).attr("data-arkiwi-type");
// console.log(iframe_type);
var arkiwi = new ARKIWI.Aggregator('http://www.arkiwi.org');
/* $.get("templates/list_item_id.txt", function (template) {
arkiwi.path("XM24/Occupy_Mordor", function (listone) {
var dioporco = Mustache.render(template, listone);
$(".row").append(dioporco);
}, true);
});*/
// arkiwi.search('Ampioraggio', function (result) {
// console.log('Ricerca...');
// console.log(result);
// });
arkiwi.search(iframe_id, function (result) {
console.log('Lettura cartella...');
for(var i = 0; i < result.items.length; i++)
{
var result_item = result.items[i].item;
console.log(result_item.type);
switch(result_item.type){
case "dir":
result_item.dir=true;
break;
case "audio":
result_item.audio=true;
break;
case "video":
result_item.video=true;
break;
default:
result_item.audio=true;
break;
}
}
$.get("templates/list_item_id.txt", function (template) {
var pappone = Mustache.render(template, result);
//console.log(pappone);
$(".row").append(pappone);
});
});
});