forked from hshackers/nyc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontent.html
62 lines (59 loc) · 2.36 KB
/
content.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
layout: page
title: Biblioteca
caption: Livros, etc.
subtitle: Categorias, livros, ebooks e obras de seu interesse
icon: book
background: "#550000"
permalink: /content/
navigation: visible
---
<div id="div_midia_2" class="col-25 white-box">
</div>
<div id="div_midia_3" class="col-25 white-box">
</div>
<div id="div_midia_5" class="col-25 white-box">
</div>
<div id="div_midia_6" class="col-25 white-box">
</div>
<script>
// https://dribbble.com/shots/344061-Search
$( "<div/>", {
class: "search_box",
html: "<input class='search_box' type='text' id='search'><label class='search_box' for='search'>Procurar</label>"
}).appendTo("header.post-header");
$("header.post-header div.search_box input.search_box").bind("enterKey",function(e){
window.location.href = '/content/search.html?text=' + document.getElementById("search").value;
});
$('header.post-header div.search_box input.search_box').keyup(function(e){
if(e.keyCode == 13)
{
$(this).trigger("enterKey");
}
});
$("header.post-header div.search_box label.search_box").on('click', function(){
window.location.href = '/content/search.html?text=' + document.getElementById("search").value;
});
$.getJSON( "https://raw.githubusercontent.com/agnoldo/dompub_obras/gh-pages/json/midia_categorias_principais_05.json", function( data ) {
var items = {2: [], 3: [], 5: [], 6: []};
var item_names = {2: "Textos", 3: "Sons", 5: "Imagens", 6: "Vídeos"};
$.each( data.record, function( key, val ) {
items[val.co_midia].push("<tr><td style='width: 75%'><a href='/content/category.html?cat=" + val.co_categoria + "&pg=1'>" + val.nome_categoria + "</a></td><td style='text-align:right; width: 25%'><a href='/content/category.html?cat=" + val.co_categoria + "&pg=1'>" + val.total_obras + "</a></td></tr>");
});
$.each( items, function( key, val) {
$( "<h2/>" , {
"html": "<a href='/content/categories.html?midia=" + key + "'>" + item_names[key] + "</a>"
}).appendTo( "#div_midia_" + key );
$( "<table/>", {
"class": "col-100",
"style": "margin: 0 auto; width: 100%; margin-top: 10px; margin-bottom: 10px;",
html: val.join( "" )
}).appendTo( "#div_midia_" + key );
$( "<a/>", {
"class": "button button--sm",
"href": "/content/categories.html?midia=" + key,
html: "Todas as categorias »"
}).appendTo( "#div_midia_" + key );
});
});
</script>