This file contains 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 | |
/** | |
* For each page each, loop through registered columns, and output value | |
* @param String - current column name | |
* @param Int - current page ID | |
*/ | |
function populate_column ( $column, $page_id ) | |
{ | |
switch ( $column ) { | |
// if the current column name is template |
This file contains 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 | |
/** | |
* instructs wordpress that our column is sortable | |
* @param Array - existing columns from wordpress | |
* @return Array - column array with new attributes | |
*/ | |
function register_sortable ( $columns ) | |
{ | |
$columns['template'] = 'template'; | |
return $columns; |
This file contains 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 | |
/** | |
* instruct wordpress what orderby=template means | |
* @param Array wordpress request rules | |
* @return Array modified $vars | |
*/ | |
function template_column_orderby( $vars ) { | |
// the search extras that will order correctly | |
if ( isset( $vars['orderby'] ) && 'template' == $vars['orderby'] ) { | |
$vars = array_merge( $vars, array( // merge the existing search parameters with ours |
This file contains 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
// preload bitmap font into Phaser | |
game.load.bitmapFont('font-name', 'path/to/font.png', 'path/to/font-name.fnt'); |
This file contains 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
// render bitmap font to game stage | |
game.add.bitmapText(0, 0, 'font-name', 'Text to display'); |
This file contains 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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> | |
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/css/materialize.min.css"> | |
<script src="http://jsblocks.com/jsblocks/blocks.js"></script> | |
<script> | |
var App = blocks.Application({ | |
history: 'pushState' |
This file contains 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
App.View('Tags', { | |
options: { | |
url: AppPath + 'views/tag.html', | |
route: AppPath +'tag/{{tag}}' | |
}, | |
tag: 'default', | |
routed: function (params) { | |
this.tag = params.tag; |
This file contains 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
/* | |
* ** SUMMARY ** | |
* App._router._route should not be empty, but contain a Route object, with the currently mapped URL parameters | |
* App._router._route could be accessed as App.getRoute() | |
* | |
* App._router._route could be accessed as App.getRoutes() | |
* | |
* Is there an event which fires internally on a successful route change? | |
* I realise this would set a precedence, so window events can be used instead. It is just a nice feature, but not 100% needed. | |
* |
This file contains 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
App.View('Navigation', { | |
options: { | |
url: AppPath + 'views/navigation.html', | |
}, | |
// the current path as an array of URL parts | |
currentPath: blocks.observable(['Home']) | |
}); | |
This file contains 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
var AppPath = '/teimr/', | |
App = blocks.Application({ | |
history: 'pushState' | |
}); | |
App.View('Navigation', { | |
options: { | |
url: AppPath + 'views/navigation.html', | |
}, |
OlderNewer