<?php $__env->startSection('CSS'); ?>
<link rel="stylesheet" type="text/css" href="https://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css">
<?php $__env->stopSection(); ?>


<?php $__env->startSection('Contenido'); ?>
<div class="row">
	<div class="col-md-12">
		<h2><i class="fa fa-envelope-o"></i> E-Mail Marketing </h2>
	</div><!--/col-md-12-->
</div><!--/row-->

<div class="row">
	<?php /*
	<div class="col-md-12">
		<nav class="navbar navbar-inverse">
			<ul class="nav navbar-nav">
				<li><a href="<?php echo URL::to('templates'); ?>">Ver todos los Templates</a></li>
				<li><a href="<?php echo URL::to('templates/create'); ?>">Crear un Template</a>
			</ul>
		</nav>
	</div>
	*/ ?>
	<div class="col-md-12">
		<?php if(Session::has('message')): ?>
		<div class="alert alert-info"><?php echo Session::get('message'); ?></div>
		<?php endif; ?>
	</div>
</div>

<div class="row">
	<div class="col-md-8">
		<div class="block-web">
			<div class="header"> <h3 class="content-header"> Formulario <strong> <?php echo $Formulario->nombre; ?> </strong> </div>
			<div class="porlets-content">
				<div class="text-center">
					<!--<iframe id="FrameFormulario" src="<?php echo URL::route('SysWebEmailMarketingFormulario', array($Formulario->token)); ?>" frameBorder="0" onload="LargoiFrame()" onresize="LargoiFrame()" style="width: 100%;"></iframe>-->
					<div id="codigo_html">
						<iframe id="<?php echo $Formulario->token; ?>" style="width: 100%;" src="<?php echo URL::route('SysWebEmailMarketingFormulario', array($Formulario->token)); ?>" frameborder="0" scrolling="no"></iframe>
					</div>
				</div>
			</div>
			<div class="bottom"> </div>
		</div>
	</div>
	<div class="col-md-4">
		<div class="block-web">
			<div class="header"> <h3 class="content-header"> Código para pegar en WordPress </div>
			<div class="porlets-content lang-html">
<pre class="prettyprint linenums lang-html" id="codigo_wordpress">
&lt;iframe id="<?php echo $Formulario->token; ?>" style="width: 100%;" src="<?php echo URL::route('SysWebEmailMarketingFormulario', array($Formulario->token)); ?>" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;script src="<?php echo asset('iframe-resizer/iframeResizer.min.js'); ?>"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
	&lt;!--
	iFrameResize({log:false, checkOrigin:false}, document.getElementById("<?php echo $Formulario->token; ?>"));
//--&gt;&lt;/script&gt;
</pre>
<?php /*<pre class="prettyprint linenums lang-html">
&lt;iframe id="<?php echo $Formulario->token; ?>" style="width: 100%;" src="<?php echo URL::route('SysWebEmailMarketingFormulario', array($Formulario->token)); ?>" frameborder="0"&gt;&lt;/iframe&gt;
&lt;script type="text/javascript"&gt;
	&lt;!--
	function recibirAlto<?php echo str_replace('-', '', $Formulario->token); ?>(e){
		if(e.data.Mensaje == "Alto" &#38;&#38; e.data.Frm == "<?php echo str_replace('-', '', $Formulario->token); ?>" ){
			var iframe = document.getElementById("<?php echo $Formulario->token; ?>");
			if(iframe) {
				iframe.height = "";
				iframe.height = e.data.height + "px";
			}
		}
	}
	window.addEventListener("message", recibirAlto<?php echo str_replace('-', '', $Formulario->token); ?>, false);
//-->&gt;&lt;/script&gt;
</pre>*/ ?>
			</div>
			<div class="bottom">
				<button id="btnCopiar" type="button" class="btn btn-success btnCopiar" data-clipboard-target="#codigo_wordpress"> <i class="fa fa-copy"></i> </button>
			</div>
		</div>
	</div>
</div><!--/row end-->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('JS'); ?>
<?php /*<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>*/ ?>
<script type="text/javascript" src="https://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></script>
<?php echo HTML::script('iframe-resizer/iframeResizer.min.js'); ?>

<?php echo HTML::script('ClipboardJS/clipboard.min.js'); ?>

<script type="text/javascript">
	<?php /*function recibirAlto<?php echo str_replace('-', '', $Formulario->token); ?>(e){
		if(e.data.Mensaje == "Alto" && e.data.Frm == "<?php echo str_replace('-', '', $Formulario->token); ?>"){
			var iframe = document.getElementById("<?php echo $Formulario->token; ?>");
			if(iframe) {
				console.log(e.data.height);
				iframe.height = "";
				iframe.height = e.data.height + "px";
			}
		}
	}
	window.addEventListener("message", recibirAlto<?php echo str_replace('-', '', $Formulario->token); ?>, false);*/ ?>
	//$("#<?php echo $Formulario->token; ?>").iFrameResize({log:true});
	iFrameResize({log:false}, document.getElementById("<?php echo $Formulario->token; ?>"));
	function recibirDisenho(e){
		if(e.data.Disenho == "V"){
			$("#codigo_html").addClass("col-sm-4 col-md-4 col-md-offset-4 col-sm-offset-4");
		}
		else if(e.data.Disenho == "H"){
			$("#codigo_html").addClass("col-xs-12");
		}
	}
	window.addEventListener("message", recibirDisenho, false);
</script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('JSOr'); ?>
prettyPrint();
var clipboard = new Clipboard(".btnCopiar");
clipboard.on("success", function(e) {
	$("#"+e.trigger.id).tooltip({trigger: "manual", title: "Copiado!"});
	$("#"+e.trigger.id).tooltip("show");
	$("#"+e.trigger.id).html('<i class="fa fa-check"></i>');
	setTimeout(function(){ $("#"+e.trigger.id).html('<i class="fa fa-copy"></i>'); $("#"+e.trigger.id).tooltip("destroy"); }, 1000);
});
clipboard.on("error", function(e) {
	var msj = "";
	if(/iPhone|iPad/i.test(navigator.userAgent)) {
		msj = "El navegador web no soporta la función de copiado, debes hacerlo manualmente";
	}
	else if (/Mac/i.test(navigator.userAgent)) {
		msj = "Presiona ⌘-C para copiar";
	}
	else {
		msj = "Presiona Ctrl-C para copiar";
	}
	$("#"+e.trigger.id).tooltip({trigger: "manual", title: msj});
	$("#"+e.trigger.id).tooltip("show");
	setTimeout(function(){ $("#"+e.trigger.id).tooltip("destroy"); }, 5000);
});
<?php if(Session::has('MensajeS')): ?>
new PNotify({ title: "Realizado", text: "<?php echo Session::get('MensajeS'); ?>", type: "success" });
<?php endif; ?>
<?php if(Session::has('MensajeE')): ?>
new PNotify({ title: "Realizado", text: "<?php echo Session::get('MensajeE'); ?>", type: "error" });
<?php endif; ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('BaseSistemaWeb', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>