forked from server/landingpage
Merge branch 'master' of https://git.wiai.de/server/landingpage
This commit is contained in:
commit
ef96ed0f57
@ -40,9 +40,7 @@
|
||||
</div>
|
||||
<div class="container">
|
||||
|
||||
<ul id="content">
|
||||
|
||||
</ul>
|
||||
<div id="content"/>
|
||||
</div>
|
||||
|
||||
</div><!--/.container-->
|
||||
|
||||
78
main.js
78
main.js
@ -3,50 +3,52 @@ jQuery.fn.extend({
|
||||
var self = $(this);
|
||||
$.ajax({
|
||||
url: dataurl,
|
||||
async:true,
|
||||
contentType:"application/json",
|
||||
async: true,
|
||||
contentType: "application/json",
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
$.each(data, function(key, attributes2){
|
||||
var sitename = attributes2.sitename;
|
||||
var site_div = $("<div>");
|
||||
var site_title = $("<h1>");
|
||||
$(site_title).text = sitename;
|
||||
$(site_title).appendTo(site_div);
|
||||
$.each(attributes2.sites, function(key, attributes){
|
||||
var my_link = (typeof attributes['link'] != 'undefined') ? attributes['link'] : "";
|
||||
var my_button = (typeof attributes['button'] != 'undefined') ? attributes['button'] : "";
|
||||
var my_name = (typeof attributes['name'] != 'undefined') ? attributes['name'] : "";
|
||||
var my_image = ((typeof attributes['image'] != 'undefined') && (attributes['image'] == "empty")) ? my_name : attributes['image'];
|
||||
success: function (data) {
|
||||
$.each(data, function (key, attributes2) {
|
||||
var sitename = attributes2.sitename;
|
||||
var site_div = $("<div>");
|
||||
$(site_div).attr('id', sitename);
|
||||
var site_list = $("<ul>");
|
||||
$.each(attributes2.sites, function (key, attributes) {
|
||||
var my_link = (typeof attributes['link'] != 'undefined') ? attributes['link'] : "";
|
||||
var my_button = (typeof attributes['button'] != 'undefined') ? attributes['button'] : "";
|
||||
var my_name = (typeof attributes['name'] != 'undefined') ? attributes['name'] : "";
|
||||
var my_image = ((typeof attributes['image'] != 'undefined') && (attributes['image'] == "empty")) ? my_name : attributes['image'];
|
||||
|
||||
var new_div = $("<li>");
|
||||
var new_div = $("<li>");
|
||||
var new_anchor = $("<a>");
|
||||
$(new_anchor).attr("href", my_link);
|
||||
$(new_anchor).attr("target", "_blank");
|
||||
$(new_anchor).attr("target", "_blank");
|
||||
$(new_anchor).addClass("btn");
|
||||
$(new_anchor).addClass(my_button);
|
||||
$(new_anchor).attr("style", "height:150px");
|
||||
if ((typeof my_image != 'undefined') && (my_image != "empty")) {
|
||||
var new_content = $("<span>");
|
||||
if (my_image != my_name) {
|
||||
$(new_anchor).html(my_name);
|
||||
new_content = $("<img>");
|
||||
$(new_content).addClass("img-responsive");
|
||||
$(new_content).attr("src", my_image);
|
||||
}else{
|
||||
var new_br = $("<br>");
|
||||
$(new_br).appendTo(new_anchor);
|
||||
new_content = $("<div>");
|
||||
$(new_content).attr("style", "width:100px;height:100px");
|
||||
$(new_content).html(my_name);
|
||||
}
|
||||
$(new_content).appendTo(new_anchor);
|
||||
if ((typeof my_image != 'undefined') && (my_image != "empty")) {
|
||||
var new_content = $("<span>");
|
||||
if (my_image != my_name) {
|
||||
$(new_anchor).html(my_name);
|
||||
new_content = $("<img>");
|
||||
$(new_content).addClass("img-responsive");
|
||||
$(new_content).attr("src", my_image);
|
||||
} else {
|
||||
var new_br = $("<br>");
|
||||
$(new_br).appendTo(new_anchor);
|
||||
new_content = $("<div>");
|
||||
$(new_content).attr("style", "width:100px;height:100px");
|
||||
$(new_content).html(my_name);
|
||||
}
|
||||
$(new_content).appendTo(new_anchor);
|
||||
}
|
||||
$(new_anchor).appendTo(new_div);
|
||||
console.log(new_div);
|
||||
$(new_div).appendTo(site_div);
|
||||
});$(site_div).appendTo(self);
|
||||
});}
|
||||
$(new_div).appendTo(site_list);
|
||||
});
|
||||
$(site_list).appendTo(site_div);
|
||||
$(site_div).appendTo(self);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -56,17 +58,17 @@ jQuery.fn.extend({
|
||||
var self = $(this);
|
||||
$.ajax({
|
||||
url: "vcf/api.php",
|
||||
async:true,
|
||||
contentType:"text/html",
|
||||
async: true,
|
||||
contentType: "text/html",
|
||||
dataType: "html",
|
||||
success: function(data){
|
||||
success: function (data) {
|
||||
$(self).html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function () {
|
||||
$("#content").linklist();
|
||||
$("#impressum").impress();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user