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
/** | |
* Example reading multiple databaserequests simultaniously | |
* while calling the callback-Fn only when all request have finished | |
* | |
* In this example, we want to read a table with all area's in a specific country. | |
* From there on, from every area we need to know the citienames and population, which resides in a second table. | |
* | |
* In some situations, this might be done with one statement using INNER JOIN, but there are cases where you need multiple requests. (performance or limitation) | |
* | |
* The array is build, has this form: |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>DT Destroy</title> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
</head> | |
<body class="yui3-skin-sam"> | |
<button id="btnRebuild">Rebuild it!</button> | |
<div>build times: <span id="count"></span></div> |
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
Y.PieModel = Y.Base.create('pieModel', Y.Model, [], { | |
initializer: function () { | |
this.internalModellist = new Y.ModelList(); | |
}, | |
_setModelList: function (newdata) { | |
return this.internalModellist.reset(newdata); | |
} | |
}, |
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
You must download the yui3-files (for every version you want to serve) as well as the Gallery-modules. | |
Yui3 --> http://yuilibrary.com/yui/quick-start/ or https://github.com/yui/yui3 | |
Gallery --> download zip from https://github.com/yui/yui3-gallery | |
The Gist presumes the next directory-structure on the server: | |
/usr/local/yui_libraries/ | |
/usr/local/yui_libraries/yui3/ | |
/usr/local/yui_libraries/yui3/3.10.3/... |
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
/*global SM:true*/ | |
'use strict'; | |
// Publish a very special, promise-compatible event that supports the default | |
// function behavior to chain on internally created promises before executing | |
// the after() subs. on() subs can still e.preventDefault(), which will | |
// reject the promise and thus skip the default behavior and after() subs. | |
var asyncEvent = eventTarget.publish('foo'); | |
asyncEvent._firing = new Y.Promise(function (resolve) { resolve(); }); |
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
// Special thanks to Luke Smiths !! https://github.com/lsmith, who helped me creating this custom publish-method. | |
// More details https://gist.github.com/lsmith/6664382/db6e9e3342d5a7610d0efc3e4b72b480604ce46a | |
YModel.prototype.publishAsync = function(type, opts) { | |
var instance = this, | |
asyncEvent = this.publish(type, opts); | |
asyncEvent._firing = new Y.Promise(function (resolve) { resolve(); }); |
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
/*jshint maxlen:205 */ | |
/* | |
* SPECIAL NOTE 1: | |
* | |
* This code is created as a yui-module inside Mojito. | |
* If you need it as standalone for any Nodejs-project, you need to require YUI as well. | |
* | |
* See: http://yuilibrary.com/yui/docs/yui/nodejs.html | |
* |
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
/*jslint anon:true, sloppy:true, nomen:true*/ | |
YUI.add('Foo', function(Y, NAME) { | |
/** | |
* The Foo module. | |
* | |
* @module Foo | |
*/ | |
/** |
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
<VirtualHost *:80> | |
ServerName mydomain.com | |
ServerAlias mydomain.com *.mydomain.com | |
DocumentRoot "/var/www/vhosts/mydomain.com/httpdocs" | |
<IfModule rewrite_module> | |
RewriteEngine on | |
RewriteCond %{HTTP:X-PJAX} ^true$ | |
RewriteRule (.*) /pjaxdir/$1 [L] | |
# or: | |
# RewriteRule (.*) processpjax.php?uri=$1 [L] |
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
Y.namespace('Plugin').ChartDataSource = Y.Base.create('chartDataSource', Y.Plugin.DataTableDataSource, [], { | |
/** | |
* Callback function passed to DataSource's sendRequest() method populates | |
* an entire DataTable with new data, clearing previous data, if any. | |
* | |
* @method onDataReturnInitializeTable | |
* @param e {EventFacade} DataSource Event Facade object. | |
*/ | |
onDataReturnInitializeTable : function(e) { |
OlderNewer