End road work
Request.YQL
Extends: Request.JSONP
A very simple extension that accepts a YQL query and makes the call returning data from YQL in json format (default).
Accepts all inherited options from the Request.* classes up the Request.JSONP family line but url must be the service url. The default value of format is“json” it can be any of the defined YQL formats.
NB: The .send() method needs to be called and a onSuccess defined for it to do anything. Example:
new Request.YQL("show tables",{
onSuccess: function(data) {
console.log(data);
}
}).send();
/** ============================================================================
* YQL driver
* Extends: Request.JSONP
*
* @version 1.0
*
* @license MIT-style license
* @author Rhys Burnie
* @copyright Author <rhys [at] hybridgarden.com>
* @param {String} YQL query
* @param {Object} Request options
* NB: options.url must be to the YQL service (default to v1 path)
*/
if( ($chk(Request) && $chk(Request.JSONP)) && !$chk(Request.YQL) ) {
Request.YQL = new Class({
Extends: Request.JSONP,
options: {
url: "http://query.yahooapis.com/v1/public/yql?",
format: 'json'
},
initialize: function(query,options) {
this.parent(options);
if (!query)
return;
this.options.url = this.options.url + 'q=' + encodeURIComponent(query) + '&format='+this.options.format;
},
success: function(data, script) {
this.parent(data, script);
}
});
}
Hippo(s) will be exhibited in the 2010 Works on Paper prize at Brunswick Street Gallery. I ended up winning an acquisitive award for this work so I think it’s part of the gallery collection.
Hippo(s) is one of a planned series of works. I have also completed another work Warrior(s) at the same size and started a 3rd called Mustacio(s).
There are two techniques that I find useful for making the WordPress content editor html5 capable. The first is to replace the default wpautop filter for the_excerpt & the_content with Nicolas Gallagher’s html5autop filter.
The second is to allow html5 tags and attributes in tinyMCE otherwise the tags would be removed when switching between html view, yes you can just use the code view permanently which seems to be a favorite “solution” offered by many developers whenever there’s an issue with the WYSIWYG but I for one would much rather use the WYSIWYG any day to coding in a crappy textarea. As one guy mentions in Nicholas’ comments you can add tinyMCE settings via the tiny_mce_before_init WordPress filter. So I did this:
function extend_valid_html5($init) {
// Standard attributes
$atts = 'role|accesskey|class|contenteditable|contextmenu|dir|draggable|hidden|id|item|itemprop|lang|spellcheck|style|subject|tabindex|title';
$html5Elements = array(
'article[#|cite|pubdate]',
'aside[#]',
'audio[#]',
'canvas[#]',
'command[#]',
'datalist[#]',
'details[#]',
'figure[#]',
'figcaption[#]',
'footer[#]',
'header[#]',
'hgroup[#]',
'mark[#]',
'meter[#]',
'nav[#]',
'output[#]',
'progress[#]',
'section[#]',
'summary[#]',
'time[#|datetime]',
'video[#]'
);
if(!isset($init['extended_valid_elements'])) {
$init['extended_valid_elements'] = '';
}
$init['extended_valid_elements'] .= str_replace('#',$atts,implode(',',$html5Elements));
return $init;
}
add_filter('tiny_mce_before_init', 'extend_valid_html5');
NB: Needs more attributes I’m just going to add them when I need them for now.
Nicholas adds his filter to the themes function.php file but I placed both filters into a html5support.php plugin which just sits there activated making the filters available, that way I can have multiple themes and not bother writing it into every themes function.php file.