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
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 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
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 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
var listenerRef; | |
function addListener() { | |
listenerRef = glow.events.addListener(myCarousel2, 'afterScroll', afterScrollListener); | |
} | |
fucntion removeListener() { | |
glow.events.removeListener(listenerRef); | |
} |
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
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 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
function User(name,id) { | |
this.name = name; | |
this.id = id; | |
} | |
User.prototype.show_user = function() { | |
alert("Nom : " + this.name + " id : " + this.id); | |
} | |
var test_object = new User("greg",2); |
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
Function.prototype.delay = function(ms, obj) { | |
setTimeout(function() { | |
this.call(obj); | |
}, ms) | |
} |
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
function createCookie(name,value,days) { | |
if (days) { | |
var date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
var expires = "; expires="+date.toGMTString(); | |
} | |
else var expires = ""; | |
document.cookie = name+"="+value+expires+"; path=/"; | |
} |
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
new glow.widgets.Timetable(container, startTime, endTime, viewStartTime, viewEndTime, { | |
// timetable options | |
tracks: [ | |
// add an array for each track like this... | |
[trackTitle, trackSize, { | |
// track options | |
items: [ | |
// add an array like this for each item | |
[title, startTime, endTime, opts] | |
] |
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
<script type="text/javascript"> | |
(function() { | |
var glow; | |
gloader.load( | |
["glow", "1", "glow.widgets.Panel"], | |
{ | |
async: true, | |
onLoad: function(g) { | |
glow = g; |
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
return ( | |
a[2] < b[0] ? 0 : | |
b[2] < a[0] ? 0 : | |
a[0] < b[0] ? (a[2] < b[2] ? a[2] - b[0] : b[2] - b[0]) : | |
b[2] < a[2] ? b[2] - a[0] : a[2] - a[0] | |
) * ( | |
a[1] < b[3] ? 0 : | |
b[1] < a[3] ? 0 : | |
a[3] < b[3] ? (a[1] < b[1] ? a[1] - b[3] : b[1] - b[3]) : | |
b[1] < a[1] ? b[1] - a[3] : a[1] - a[3] |