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
function toggleOnClick(elmToToggle, elmToClick) { | |
elmToToggle = glow.dom.get(elmToToggle); | |
var fullHeight = elmToToggle.height(); | |
glow.events.addListener(elmToClick, 'click', function() { | |
if (elmToToggle.height()) { | |
glow.anim.slideUp(elmToToggle, 1); | |
} else { | |
glow.anim.css(elmToToggle, 1, { |
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 listenerRef; | |
function addListener() { | |
listenerRef = glow.events.addListener(myCarousel2, 'afterScroll', afterScrollListener); | |
} | |
fucntion removeListener() { | |
glow.events.removeListener(listenerRef); | |
} |
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
function getFilterOpts(type, item, callback) { | |
var requestUrl = "/api/plugin:"+type+"/config?path=" +item; | |
var str = ''; | |
// get json data from config | |
glow.net.get(requestUrl, { | |
onLoad: function(response) { | |
var data = response.json(); | |
str += '<p>'+data.a_value+'</p>'; | |
// simplified example of what I need to add to var str. |
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
function slideRight(elm, seconds, opts) { | |
elm = glow.dom.get(elm); | |
opts = opts || {}; | |
// make the tween easeBoth by default | |
opts.tween = opts.tween || glow.tweens.easeBoth(); | |
// get the full width of the item | |
var currentWidth = elm[0].style.width, | |
fullWidth, | |
anim; |
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
function Ball(colour) { | |
// ... | |
} | |
Ball.prototype.on = function(eventName, callback) { | |
glow.events.addListener(this, eventName, callback); | |
}; | |
Ball.prototype._moved = function() { | |
if (this._directionChange) { | |
glow.events.fire(this, 'bounce'); | |
} |
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 mySortable = new glow.widgets.Sortable('#mySortable', { | |
onSort : function () { | |
// this will contain the IDs of the items in the sortable, in order | |
var itemIds = []; | |
// get the children of the sortable containers - these are the items you drag | |
// Then sort them, and get the ID for each | |
mySortable.containers.children().sort().each(function () { | |
itemIds.push( this.id ); | |
}); |
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 mySortable = new glow.widgets.Sortable('#mySortable', { | |
onSort : function () { | |
// this will contain the IDs of the items in the sortable, in order | |
var itemIds = []; | |
// get the children of the sortable containers - these are the items you drag | |
// Then sort them, and get the ID for each | |
mySortable.containers.children().sort().each(function () { | |
itemIds.push( this.id ); | |
}); |
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
<script type="text/javascript"> | |
gloader.load(['glow', '1', 'glow.dom', 'glow.anim'], { | |
async: false, | |
onLoad: function(glow) { | |
window.glow2 = glow; | |
} | |
}); | |
</script> | |
<script type="text/javascript"> | |
// glow2 is available here |
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
<script type="text/javascript" src="scripts/glow/2.0.0/core.js"></script> | |
<script type="text/javascript" src="scripts/glow/2.0.0/widgets/widgets.js"></script> | |
<link rel="stylesheet" href="scripts/glow/2.0.0/widgets/widgets.css" type="text/css" /> | |
<script type="text/javascript"> | |
glow.dom.get('#yey'); | |
// etc etc | |
</script> |
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
<script type="text/javascript" src="scripts/glow/2.0.0/core.js"></script> | |
<script type="text/javascript" src="scripts/glow/2.0.0/widgets/widgets.js"></script> | |
<link rel="stylesheet" href="scripts/glow/2.0.0/widgets/widgets.css" type="text/css" /> | |
<script type="text/javascript"> | |
glow.dom.get('#yey'); | |
// etc etc | |
</script> |