Pārlūkot izejas kodu

wdg list item id works

cri 8 gadi atpakaļ
vecāks
revīzija
a40ac5ca4c

+ 4 - 0
Doc

@@ -28,3 +28,7 @@ widget/pagine differenti
  ricerca e ricerca avanzata/visualizzazione risposte
  visualizzazione singola (senza login)
 
+
+todo:
+in ricerche: escludi cartelle, se medatype:null
+

+ 3 - 3
app/index.html

@@ -62,14 +62,14 @@
     
 </body><div class="container">
 <p>Iframe list items con id:
-<pre>iframe class="embed" data-id="42" height="400px" width="99%" frameBorder='1' seamless='seamless' src="./wdg_list_item_id.html"</pre>
+<pre>iframe class="embed" data-arkiwi-id="hack" height="400px" width="99%" frameBorder='1' seamless='seamless' src="./wdg_list_item_id.html"</pre>
 </p>
-<iframe class="embed" data-id="title:hack" height="400px" width="99%" frameBorder='1' seamless='seamless' src="./wdg_list_item_id.html"></iframe>
+<iframe class="embed" name="arkiwi" data-arkiwi-id="title:hack" height="400px" width="99%" frameBorder='1' seamless='seamless' src="./wdg_list_item_id.html"></iframe>
 <div class="container-fluid" id="list" ><div class="row"></div></div>
 
 
 <p>Iframe  list items viz Arkiwi home page:
-<pre>iframe class="embed" height="400px" width="99%" frameBorder='1' seamless='seamless' src="./wdg_list_item_home.html"</pre>
+<pre>iframe class="embed" height="400px" width="400px" frameBorder='1' seamless='seamless' src="./wdg_list_item_home.html"</pre>
 </p>
 <iframe class="embed" data-id="title:hack" height="400px" width="99%" frameBorder='1' seamless='seamless' src="./wdg_list_item_home.html"></iframe>
 <div class="container-fluid" id="list" ><div class="row"></div></div>

+ 17 - 3
app/index.html~

@@ -22,6 +22,7 @@
     <!-- endbower -->
     <!-- endbuild -->
     <!-- build:css(.tmp) styles/main.css -->
+<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.css">
     <link rel="stylesheet" href="styles/main.css">
     <!-- endbuild -->
 
@@ -45,7 +46,7 @@
     <div class="container">
         <header>
             <h1>App Generated <small>with the html5 app generator</small></h1>
-            <p>Now go develop</p>
+            <p>Example of the widget embed</p>
         </header>
     </div>
     <!-- build:js scripts/vendor.js -->
@@ -58,7 +59,20 @@
     <!-- endbuild -->
 
     <script src="scripts/arkiwi.js"></script>
-    <script src="scripts/main.js"></script>
-</body>
+    
+</body><div class="container">
+<p>Iframe list items con id:
+<pre>iframe class="embed" data-arkiwi-id="hack" height="400px" width="99%" frameBorder='1' seamless='seamless' src="./wdg_list_item_id.html"</pre>
+</p>
+<iframe class="embed" name="arkiwi" data-id="title:hack" height="400px" width="99%" frameBorder='1' seamless='seamless' src="./wdg_list_item_id.html"></iframe>
 <div class="container-fluid" id="list" ><div class="row"></div></div>
+
+
+<p>Iframe  list items viz Arkiwi home page:
+<pre>iframe class="embed" height="400px" width="400px" frameBorder='1' seamless='seamless' src="./wdg_list_item_home.html"</pre>
+</p>
+<iframe class="embed" data-id="title:hack" height="400px" width="99%" frameBorder='1' seamless='seamless' src="./wdg_list_item_home.html"></iframe>
+<div class="container-fluid" id="list" ><div class="row"></div></div>
+
+</div> <!--container-->
 </html>

+ 17 - 4
app/scripts/main_list_item_id.js

@@ -13,8 +13,14 @@
  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 arkiwi = new ARKIWI.Arkiwi('http://www.arkiwi.org', 'http://upload.arkiwi.org');
-    $.get("templates/list_item_id.txt", function (template) {
+   /* $.get("templates/list_item_id.txt", function (template) {
 
         arkiwi.path("XM24/Occupy_Mordor", function (listone) {
             var dioporco = Mustache.render(template, listone);
@@ -22,7 +28,7 @@ $(document).ready(function () {
         }, true);
 
 
-    });
+    });*/
 
     arkiwi.search('Ampioraggio', function (result) {
         console.log('Ricerca...');
@@ -30,8 +36,15 @@ $(document).ready(function () {
 
     });
 
-    arkiwi.path('XM24/Occupy_Mordor', function (result) {
+	   $.get("templates/list_item_id.txt", function (template) {
+		   
+    arkiwi.search(iframe_id, function (result) {
         console.log('Lettura cartella...');
         console.log(result);
-    }, true);
+		var pappone =   Mustache.render(template, result);
+		console.log(pappone);
+            $(".row").append(pappone);
+    });
+	   });
+		   
 });

+ 19 - 2
app/styles/main.css

@@ -19,12 +19,29 @@ http://paletton.com/#uid=70f0u0ksXsOhL-cmHuduim--whE
 width:100%;
 min-width:100%;
 height:auto;
+resize: both;
+overflow: auto;
 }
 
 audio {
     background-color: #E65116 !important;
     border-radius: 6px;
     height: 35px;
-    opacity: 1;
-    z-index: 99;
+    width:100%;
+ 
+}
+.tools a img {
+    width: 30px;
+}
+/*correzioni alle merde di bootstrapt*/
+/*media query aggiuntive*/
+@media (max-width: 660px) {
+  .col-xs-6 {
+    width: 49.9%;
+}
+}
+@media (max-width: 460px) {
+  .col-xs-6 {
+    width: 99%;
+}
 }

+ 0 - 22
app/templates/list.txt

@@ -1,22 +0,0 @@
-{{#items}}
-  <div class="col-sm-6 col-md-4">
-    <div class="thumbnail">
-<h3><a href='/hack/path64/{{item.URI}}/'>{{item.title}}</a></h3>
-<h4>{{#item.creator}}</h4><small>by: <i>{{item.creator}}</i></small>{{/item.creator}}
-      <img src="..." alt="...">
-{{#item.player}}
-<iframe class="embed-iframe" frameBorder='0' seamless='seamless'  src='{{url}}'></iframe>
-{{/item.player}}
-      <div class="caption">
-        <p><i>{{item.description}}</i></p>
-        <p>
-<a href='/hack/path64/{{item.URI}}/' role="button" class="btn btn-primary">
-<img title="Download" alt="[Download]" src="http://arkiwi.org/arav_icons/download_icon.png">
-</a>
-<a href="#"  >Button</a>
-<a href="#" class="btn btn-default" role="button">Button</a></p>
-      </div>
-    </div>
-  </div>
-
-{{/items}}

+ 7 - 8
app/templates/list.txt~

@@ -1,23 +1,22 @@
 {{#items}}
-
   <div class="col-sm-6 col-md-4">
     <div class="thumbnail">
 <h3><a href='/hack/path64/{{item.URI}}/'>{{item.title}}</a></h3>
 <h4>{{#item.creator}}</h4><small>by: <i>{{item.creator}}</i></small>{{/item.creator}}
       <img src="..." alt="...">
 {{#item.player}}
-<p><iframe style="display:none;" frameBorder='0' seamless='seamless' width='{{width}}' height='{{height}}' src='{{url}}'></iframe></p>
+<iframe class="embed-iframe" frameBorder='0' seamless='seamless'  src='{{url}}'></iframe>
 {{/item.player}}
       <div class="caption">
         <p><i>{{item.description}}</i></p>
-        <p><a href="#" class="btn btn-primary" role="button">Button</a> <a href="#" class="btn btn-default" role="button">Button</a></p>
+        <p>
+<a href='/hack/path64/{{item.URI}}/' role="button" class="btn btn-primary">
+<img title="Download" alt="[Download]" src="http://arkiwi.org/arav_icons/download_icon.png">
+</a>
+<a href="#"  >Button</a>
+<a href="#" class="btn btn-default" role="button">Button</a></p>
       </div>
     </div>
   </div>
 
-
-
-
-
-
 {{/items}}

+ 10 - 4
app/templates/list_item_id.txt

@@ -1,16 +1,22 @@
 {{#items}}
-  <div class="col-sm-6 col-md-4">
+  <div class="col-xs-6 col-sm-3">
     <div class="thumbnail">
-<h4>{{#item.creator}}</h4><small>by: <i>{{item.creator}}</i></small>{{/item.creator}}
+<h3>{{#item.title}}<small><b>{{item.title}}</b></small></h3>{{/item.title}}
 {{#item.player}}
-<iframe class="embed-iframe" frameBorder='0' seamless='seamless'  src='{{url}}'></iframe>
+ <audio controls>
+  <source src="http://storage.arkiwi.org/{{item.identifier}}" type="audio/ogg">
+  <source src="#" type="audio/mpeg">
+Your browser does not support the audio element.
+</audio> 
+<h4>{{#item.creator}}</h4><small>Creato da: <i>{{item.creator}}</i></small>{{/item.creator}}
 {{/item.player}}
       <div class="caption">
         <p><i>{{item.description}}</i></p>
-        <p>
+        <div class="tools">
 <a target="_blank" href='http://storage.arkiwi.org/{{item.identifier}}' download>
 <img title="Download" alt="[Download]" src="http://arkiwi.org/arav_icons/download_icon.png">
 </a>
+</div>
       </div>
     </div>
   </div>

+ 1 - 0
app/wdg_list_item_id.html

@@ -57,4 +57,5 @@
     <script src="scripts/main_list_item_id.js"></script>
 </body>
 <div class="container-fluid" id="list" ><div class="row"></div></div>
+
 </html>