This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: Private Page | |
*/ | |
get_header(); ?> | |
<?php if(post_password_required()): ?> | |
<div id="primary" class="content-area"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="botui botui-container" v-botui-container> | |
<div class="botui-messages-container"> | |
<div v-for="msg in messages" class="botui-message" :class="[{human: msg.human, bot: !msg.human}, msg.cssClass]" v-botui-scroll> | |
<transition name="slide-fade"> | |
<div v-if="msg.visible" :class="[{human: msg.human, 'botui-message-content': true}, msg.type]"> | |
<span v-if="msg.type == 'text'" v-text="msg.content" v-botui-markdown></span> | |
<iframe v-if="msg.type == 'embed'" :src="msg.content" frameborder="0" allowfullscreen scrolling="no"></iframe> | |
</div> | |
</transition> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1) Bind click events in the preview iframe. | |
(function( exports, $ ){ | |
var api = wp.customize; | |
api.controlConstructor.myCustomControl = api.Control.extend({ | |
ready: function() { | |
var control = this; | |
// wait for the preview iframe to be ready | |
var timer = setInterval(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hidden{ display: none; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vertically and horizontally center a block on the browser screen | |
function centerBlock ($block){ | |
var top = Math.floor(($(window).height() - $block.height())/2); | |
var left = Math.floor(($(window).width() - $block.width())/2); | |
$block.css('margin', top+'px '+left+'px'); | |
} | |
// use it | |
centerBlock($('.myblock')); | |
$(window).resize(function(){ |