arkiwi_boilerplate/app/scripts/main_list_item_id.js

89 lines
2.1 KiB
JavaScript
Raw Normal View History

/*------------------------------------------------------------------------------------------------------------------------
@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 () {
2015-09-13 00:21:01 +02:00
var iframe_id = $(window.frameElement).attr("data-arkiwi-id");
2015-09-13 01:03:33 +02:00
//console.log(iframe_id);
2015-09-13 01:07:30 +02:00
var iframe_type = "audio"
var iframe_type = $(window.frameElement).attr("data-arkiwi-type");
2015-09-13 02:06:29 +02:00
// console.log(iframe_type);
2015-09-13 00:21:01 +02:00
2015-09-12 20:15:55 +02:00
var arkiwi = new ARKIWI.Arkiwi('http://www.arkiwi.org', 'http://upload.arkiwi.org');
2015-09-13 00:21:01 +02:00
/* $.get("templates/list_item_id.txt", function (template) {
2015-09-12 20:37:43 +02:00
arkiwi.path("XM24/Occupy_Mordor", function (listone) {
var dioporco = Mustache.render(template, listone);
$(".row").append(dioporco);
}, true);
2015-09-13 00:21:01 +02:00
});*/
2015-09-13 02:06:29 +02:00
// arkiwi.search('Ampioraggio', function (result) {
2015-09-13 01:03:33 +02:00
// console.log('Ricerca...');
// console.log(result);
2015-09-13 02:06:29 +02:00
// });
2015-09-13 00:21:01 +02:00
arkiwi.search(iframe_id, function (result) {
console.log('Lettura cartella...');
2015-09-13 02:06:29 +02:00
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) {
2015-09-13 00:21:01 +02:00
var pappone = Mustache.render(template, result);
2015-09-13 01:03:33 +02:00
//console.log(pappone);
2015-09-13 00:21:01 +02:00
$(".row").append(pappone);
});
});
});