Merge pull request #15 from RDCH106/develop

Update README.md
This commit is contained in:
Francesco Malagrino
2016-09-15 21:00:51 +01:00
committed by GitHub
3 changed files with 66 additions and 81 deletions

View File

@@ -1,39 +1,18 @@
BootstrapPageGenerator Bootstrap Page Generator
====================== ======================
Bootstrap Page Generator as layoutit
Hello all,
this tool is based on the following project : https://github.com/justjavac/layoutit
I made a version for Bootstrap 3 and i made a function for save the page as file HTML.
A Demo is at the following link :
Update version 2.0 new layout and added a new section called FORM
Update version 1.2 added new functionalities:
You can now see the website for different device from the Desktop to a small device.
Update version 1.1 added new functionalities: in the example miss the Color.
Added :
Dashboard
Color
Jumbotron Narrow
Glyphicon
http://www.francescomalagrino.com/BootstrapPageGenerator/3/
[![Codacy Badge](https://www.codacy.com/project/badge/970393072b7c492c87e5ddb3ff0bfa32)](https://www.codacy.com/app/francesco-malagrino/BootstrapPageGenerator) [![Codacy Badge](https://www.codacy.com/project/badge/970393072b7c492c87e5ddb3ff0bfa32)](https://www.codacy.com/app/francesco-malagrino/BootstrapPageGenerator)
Bootstrap Page Generator is an Open Source alternative to [LayoutIt!](http://www.layoutit.com/)
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Vegetam/bootstrappagegenerator/trend.png)](https://bitdeli.com/free "Bitdeli Badge") Create frontend code simply and quickly with Bootstrap using a drag & drop interface builder.
![screenshot](https://cloud.githubusercontent.com/assets/1483414/18440053/f5c2e120-7907-11e6-9770-d10ac5082959.PNG)
Try it: [Live Demo](https://cdn.rawgit.com/Vegetam/BootstrapPageGenerator/master/index.html)
### Authors
* [justjavac](https://github.com/justjavac) (Main Author)
* [Vegetam](https://github.com/Vegetam) (Main Author)
* [RDCH106](https://github.com/RDCH106)

View File

@@ -6788,7 +6788,7 @@ button.close {
float: left; float: left;
} }
.col-xs-12 { .col-xs-12 {
width: 100%; width: 99%;
} }
.col-xs-11 { .col-xs-11 {
width: 91.66666667%; width: 91.66666667%;

View File

@@ -117,7 +117,7 @@ function handleJsIds() {
handleModalIds(); handleModalIds();
handleAccordionIds(); handleAccordionIds();
handleCarouselIds(); handleCarouselIds();
handleTabsIds() handleTabsIds();
} }
function handleAccordionIds() { function handleAccordionIds() {
var e = $(".demo #myAccordion"); var e = $(".demo #myAccordion");
@@ -129,12 +129,12 @@ function handleAccordionIds() {
r = "accordion-element-" + randomNumber(); r = "accordion-element-" + randomNumber();
$(t).find(".accordion-toggle").each(function(e, t) { $(t).find(".accordion-toggle").each(function(e, t) {
$(t).attr("data-parent", "#" + n); $(t).attr("data-parent", "#" + n);
$(t).attr("href", "#" + r) $(t).attr("href", "#" + r);
}); });
$(t).find(".accordion-body").each(function(e, t) { $(t).find(".accordion-body").each(function(e, t) {
$(t).attr("id", r) $(t).attr("id", r);
}) });
}) });
} }
function handleCarouselIds() { function handleCarouselIds() {
var e = $(".demo #myCarousel"); var e = $(".demo #myCarousel");
@@ -142,10 +142,10 @@ function handleCarouselIds() {
var n = "carousel-" + t; var n = "carousel-" + t;
e.attr("id", n); e.attr("id", n);
e.find(".carousel-indicators li").each(function(e, t) { e.find(".carousel-indicators li").each(function(e, t) {
$(t).attr("data-target", "#" + n) $(t).attr("data-target", "#" + n);
}); });
e.find(".left").attr("href", "#" + n); e.find(".left").attr("href", "#" + n);
e.find(".right").attr("href", "#" + n) e.find(".right").attr("href", "#" + n);
} }
function handleModalIds() { function handleModalIds() {
var e = $(".demo #myModalLink"); var e = $(".demo #myModalLink");
@@ -154,7 +154,7 @@ function handleModalIds() {
var r = "modal-" + t; var r = "modal-" + t;
e.attr("id", r); e.attr("id", r);
e.attr("href", "#" + n); e.attr("href", "#" + n);
e.next().attr("id", n) e.next().attr("id", n);
} }
function handleTabsIds() { function handleTabsIds() {
var e = $(".demo #myTabs"); var e = $(".demo #myTabs");
@@ -165,14 +165,14 @@ function handleTabsIds() {
var n = $(t).attr("id"); var n = $(t).attr("id");
var r = "panel-" + randomNumber(); var r = "panel-" + randomNumber();
$(t).attr("id", r); $(t).attr("id", r);
$(t).parent().parent().find("a[href=#" + n + "]").attr("href", "#" + r) $(t).parent().parent().find("a[href=#" + n + "]").attr("href", "#" + r);
}) });
} }
function randomNumber() { function randomNumber() {
return randomFromInterval(1, 1e6) return randomFromInterval(1, 1e6);
} }
function randomFromInterval(e, t) { function randomFromInterval(e, t) {
return Math.floor(Math.random() * (t - e + 1) + e) return Math.floor(Math.random() * (t - e + 1) + e);
} }
function gridSystemGenerator() { function gridSystemGenerator() {
$(".lyrow .preview input").bind("keyup", function() { $(".lyrow .preview input").bind("keyup", function() {
@@ -181,22 +181,22 @@ function gridSystemGenerator() {
var n = $(this).val().split(" ", 12); var n = $(this).val().split(" ", 12);
$.each(n, function(n, r) { $.each(n, function(n, r) {
e = e + parseInt(r); e = e + parseInt(r);
t += '<div class="span' + r + ' column"></div>' t += '<div class="span' + r + ' column"></div>';
}); });
if (e == 12) { if (e == 12) {
$(this).parent().next().children().html(t); $(this).parent().next().children().html(t);
$(this).parent().prev().show() $(this).parent().prev().show();
} else { } else {
$(this).parent().prev().hide() $(this).parent().prev().hide();
} }
}) });
} }
function configurationElm(e, t) { function configurationElm(e, t) {
$(".demo").delegate(".configuration > a", "click", function(e) { $(".demo").delegate(".configuration > a", "click", function(e) {
e.preventDefault(); e.preventDefault();
var t = $(this).parent().next().next().children(); var t = $(this).parent().next().next().children();
$(this).toggleClass("active"); $(this).toggleClass("active");
t.toggleClass($(this).attr("rel")) t.toggleClass($(this).attr("rel"));
}); });
$(".demo").delegate(".configuration .dropdown-menu a", "click", function(e) { $(".demo").delegate(".configuration .dropdown-menu a", "click", function(e) {
e.preventDefault(); e.preventDefault();
@@ -206,21 +206,21 @@ function configurationElm(e, t) {
$(this).parent().addClass("active"); $(this).parent().addClass("active");
var r = ""; var r = "";
t.find("a").each(function() { t.find("a").each(function() {
r += $(this).attr("rel") + " " r += $(this).attr("rel") + " ";
}); });
t.parent().removeClass("open"); t.parent().removeClass("open");
n.removeClass(r); n.removeClass(r);
n.addClass($(this).attr("rel")) n.addClass($(this).attr("rel"));
}) });
} }
function removeElm() { function removeElm() {
$(".demo").delegate(".remove", "click", function(e) { $(".demo").delegate(".remove", "click", function(e) {
e.preventDefault(); e.preventDefault();
$(this).parent().remove(); $(this).parent().remove();
if (!$(".demo .lyrow").length > 0) { if (!$(".demo .lyrow").length > 0) {
clearDemo() clearDemo();
} }
}) });
} }
function clearDemo() { function clearDemo() {
$(".demo").empty(); $(".demo").empty();
@@ -229,13 +229,13 @@ function clearDemo() {
localStorage.removeItem("layoutdata"); localStorage.removeItem("layoutdata");
} }
function removeMenuClasses() { function removeMenuClasses() {
$("#menu-layoutit li button").removeClass("active") $("#menu-layoutit li button").removeClass("active");
} }
function changeStructure(e, t) { function changeStructure(e, t) {
$("#download-layout ." + e).removeClass(e).addClass(t) $("#download-layout ." + e).removeClass(e).addClass(t);
} }
function cleanHtml(e) { function cleanHtml(e) {
$(e).parent().append($(e).children().html()) $(e).parent().append($(e).children().html());
} }
function downloadLayoutSrc() { function downloadLayoutSrc() {
var e = ""; var e = "";
@@ -245,28 +245,28 @@ function downloadLayoutSrc() {
t.find(".lyrow").addClass("removeClean"); t.find(".lyrow").addClass("removeClean");
t.find(".box-element").addClass("removeClean"); t.find(".box-element").addClass("removeClean");
t.find(".lyrow .lyrow .lyrow .lyrow .lyrow .removeClean").each(function() { t.find(".lyrow .lyrow .lyrow .lyrow .lyrow .removeClean").each(function() {
cleanHtml(this) cleanHtml(this);
}); });
t.find(".lyrow .lyrow .lyrow .lyrow .removeClean").each(function() { t.find(".lyrow .lyrow .lyrow .lyrow .removeClean").each(function() {
cleanHtml(this) cleanHtml(this);
}); });
t.find(".lyrow .lyrow .lyrow .removeClean").each(function() { t.find(".lyrow .lyrow .lyrow .removeClean").each(function() {
cleanHtml(this) cleanHtml(this);
}); });
t.find(".lyrow .lyrow .removeClean").each(function() { t.find(".lyrow .lyrow .removeClean").each(function() {
cleanHtml(this) cleanHtml(this);
}); });
t.find(".lyrow .removeClean").each(function() { t.find(".lyrow .removeClean").each(function() {
cleanHtml(this) cleanHtml(this);
}); });
t.find(".removeClean").each(function() { t.find(".removeClean").each(function() {
cleanHtml(this) cleanHtml(this);
}); });
t.find(".removeClean").remove(); t.find(".removeClean").remove();
$("#download-layout .column").removeClass("ui-sortable"); $("#download-layout .column").removeClass("ui-sortable");
$("#download-layout .row-fluid").removeClass("clearfix").children().removeClass("column"); $("#download-layout .row-fluid").removeClass("clearfix").children().removeClass("column");
if ($("#download-layout .container").length > 0) { if ($("#download-layout .container").length > 0) {
changeStructure("row-fluid", "row") changeStructure("row-fluid", "row");
} }
formatSrc = $.htmlClean($("#download-layout").html(), { formatSrc = $.htmlClean($("#download-layout").html(), {
format: true, format: true,
@@ -286,7 +286,7 @@ function downloadLayoutSrc() {
}); });
$("#download-layout").html(formatSrc); $("#download-layout").html(formatSrc);
$("#downloadModal textarea").empty(); $("#downloadModal textarea").empty();
$("#downloadModal textarea").val(formatSrc) $("#downloadModal textarea").val(formatSrc);
webpage = formatSrc; webpage = formatSrc;
} }
@@ -345,7 +345,7 @@ $(document).ready(function() {
startdrag = 1; startdrag = 1;
}, },
drag: function(e, t) { drag: function(e, t) {
t.helper.width(400) t.helper.width(400);
}, },
stop: function(e, t) { stop: function(e, t) {
$(".demo .column").sortable({ $(".demo .column").sortable({
@@ -373,7 +373,7 @@ $(document).ready(function() {
startdrag = 1; startdrag = 1;
}, },
drag: function(e, t) { drag: function(e, t) {
t.helper.width(400) t.helper.width(400);
}, },
stop: function() { stop: function() {
handleJsIds(); handleJsIds();
@@ -402,54 +402,54 @@ $(document).ready(function() {
}); });
$("#download").click(function() { $("#download").click(function() {
downloadLayout(); downloadLayout();
return false return false;
}); });
$("#downloadhtml").click(function() { $("#downloadhtml").click(function() {
downloadHtmlLayout(); downloadHtmlLayout();
return false return false;
}); });
$("#edit").click(function() { $("#edit").click(function() {
$("body").removeClass("devpreview sourcepreview"); $("body").removeClass("devpreview sourcepreview");
$("body").addClass("edit"); $("body").addClass("edit");
removeMenuClasses(); removeMenuClasses();
$(this).addClass("active"); $(this).addClass("active");
return false return false;
}); });
$("#clear").click(function(e) { $("#clear").click(function(e) {
e.preventDefault(); e.preventDefault();
clearDemo() clearDemo();
}); });
$("#devpreview").click(function() { $("#devpreview").click(function() {
$("body").removeClass("edit sourcepreview"); $("body").removeClass("edit sourcepreview");
$("body").addClass("devpreview"); $("body").addClass("devpreview");
removeMenuClasses(); removeMenuClasses();
$(this).addClass("active"); $(this).addClass("active");
return false return false;
}); });
$("#sourcepreview").click(function() { $("#sourcepreview").click(function() {
$("body").removeClass("edit"); $("body").removeClass("edit");
$("body").addClass("devpreview sourcepreview"); $("body").addClass("devpreview sourcepreview");
removeMenuClasses(); removeMenuClasses();
$(this).addClass("active"); $(this).addClass("active");
return false return false;
}); });
$("#fluidPage").click(function(e) { $("#fluidPage").click(function(e) {
e.preventDefault(); e.preventDefault();
changeStructure("container", "container-fluid"); changeStructure("container", "container-fluid");
$("#fixedPage").removeClass("active"); $("#fixedPage").removeClass("active");
$(this).addClass("active"); $(this).addClass("active");
downloadLayoutSrc() downloadLayoutSrc();
}); });
$("#fixedPage").click(function(e) { $("#fixedPage").click(function(e) {
e.preventDefault(); e.preventDefault();
changeStructure("container-fluid", "container"); changeStructure("container-fluid", "container");
$("#fluidPage").removeClass("active"); $("#fluidPage").removeClass("active");
$(this).addClass("active"); $(this).addClass("active");
downloadLayoutSrc() downloadLayoutSrc();
}); });
$(".nav-header").click(function() { $(".nav-header").click(function() {
$(".sidebar-nav .boxes, .sidebar-nav .rows").hide(); $(".sidebar-nav .boxes, .sidebar-nav .rows").hide();
$(this).next().slideDown() $(this).next().slideDown();
}); });
$('#undo').click(function(){ $('#undo').click(function(){
stopsave++; stopsave++;
@@ -464,9 +464,15 @@ $(document).ready(function() {
removeElm(); removeElm();
gridSystemGenerator(); gridSystemGenerator();
setInterval(function() { setInterval(function() {
handleSaveLayout() handleSaveLayout();
}, timerSave) }, timerSave);
}) var prevalue_sv = $('.sidebar-nav').css('overflow');
$('.popover-info').hover(function(){
$('.sidebar-nav').css('overflow', 'inherit');
}, function(){
$('.sidebar-nav').css('overflow', prevalue_sv);
});
});
function saveHtml() function saveHtml()
{ {