$(document).ready(function() 
{
	//if url has #no-right-panel set one panel demo
	if (window.location.hash.indexOf("no-right-panel") != -1)
	{
		$("#vvveb-builder").addClass("no-right-panel");
		$(".component-properties-tab").show();
		Vvveb.Components.componentPropertiesElement = "#left-panel .component-properties";
	} else
	{
		$(".component-properties-tab").hide();
	}

	Vvveb.Builder.init('narrow-jumbotron/index.html', function() {
		//run code after page/iframe is loaded
	});

	Vvveb.Gui.init();
	Vvveb.FileManager.init();
	Vvveb.FileManager.addPages(
	[
		{name:"narrow-jumbotron", title:"Jumbotron",  url: "pagebuilder/load_template/narrow-jumbotron/index.php", assets: ['pagebuilder/narrow-jumbotron/narrow-jumbotron.css']},
		{name:"Blog", title:"Blog",  url: "pagebuilder/load_template/blog/index.html", assets: ['demo/startbootstrap-landing-page/css/landing-page.min.css']},
		{name:"album", title:"Album",  url: "pagebuilder/load_template/album/index.html", folder:"content", assets: ['pagebuilder/load_template/album/album.css']},
		{name:"blog", title:"Blog",  url: "pagebuilder/load_template/blog/index.html", folder:"content", assets: ['pagebuilder/load_template/blog/blog.css']},
		{name:"carousel", title:"Carousel",  url: "pagebuilder/load_template/carousel/index.html", folder:"content", assets: ['pagebuilder/load_template/carousel/carousel.css']},
		{name:"offcanvas", title:"Offcanvas",  url: "pagebuilder/load_template/offcanvas/index.html", folder:"content", assets: ['pagebuilder/load_template/offcanvas/offcanvas.css','pagebuilder/load_template/offcanvas/offcanvas.js']},
		{name:"pricing", title:"Pricing",  url: "pagebuilder/load_template/pricing/index.html", folder:"ecommerce", assets: ['pagebuilder/load_template/pricing/pricing.css']},
		{name:"product", title:"Product",  url: "pagebuilder/load_template/product/index.html", folder:"ecommerce", assets: ['pagebuilder/load_template/product/product.css']},
		//uncomment php code below and rename file to .php extension to load saved html files in the editor
		/*
		<?php 
		   $htmlFiles = glob("*.html");
		   foreach ($htmlFiles as $file) { 
			   if (in_array($file, array('new-page-blank-template.html', 'editor.html'))) continue;//skip template files
			   $pathInfo = pathinfo($file);
		?>
		{name:"<?php echo ucfirst($pathInfo['filename']);?>", title:"<?php echo ucfirst($pathInfo['filename']);?>",  url: "<?php echo $pathInfo['basename'];?>"},
		<?php } ?>
		*/
	]);
	
	Vvveb.FileManager.loadPage("narrow-jumbotron");
});