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
require('sproutcore'); | |
require('sproutcore-touch'); | |
var set = SC.set, get = SC.get; | |
var tapEndWasCalled = true; | |
module("Touching handlebars tests", { | |
setup: function() { | |
console.group(' - Setup for new test'); |
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
mouseDown: function(evt, view) { | |
//console.log( ' mouse down.......'); | |
//console.log( evt ); | |
var simulatedEvent = new jQuery.Event(); | |
simulatedEvent.type='touchstart'; | |
simulatedEvent['originalEvent'] = { | |
targetTouches: [{ | |
id: 0, | |
pageX: evt.pageX, |
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
SC.addObserver(view, 'element' ,function() { | |
var element = view.get('element'); | |
if ( element ) { | |
var deviceHeight = $(window).height(); | |
var headerHeight = $('#header').outerHeight(); // null | |
var footerHeight = $('#footer').outerHeight(); // null | |
var availableHeight = deviceHeight - headerHeight - footerHeight; |
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
SC.Handlebars.registerHelper('bindClass', function(options) { | |
var attrs = options.hash; | |
var view = options.data.view; | |
var ret = []; | |
var dataId = ++jQuery.uuid; | |
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
UI.Kit.ScrollableView = SC.CollectionView.extend({ | |
// options | |
animationDuration: 1000, | |
easing: "easeOutExpo", | |
// must be set ( pixels available) to provide elastic scroll | |
scrollableHeight: 0, | |
// options elastic |
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
TestView.View1.app = SC.Application.create({ | |
customEvents: { | |
backbutton : 'backButton', | |
deviceready : 'deviceReady', | |
resume : 'resume' | |
} | |
}); |
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 get = SC.get, set = SC.set; | |
PG.PhoneGapEvents = SC.Mixin.create({ | |
phoneGapEvents: { | |
deviceready: 'deviceReady', | |
pause: 'pause', | |
resume: 'resume', | |
online: 'online', | |
offline: 'offline', |
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
// Copyright 2011 Strobe, Inc. All rights reserved. | |
(function ($) { | |
var Strobe = {}; | |
/** | |
Strobe global object. | |
@class Strobe | |
@static | |
*/ |
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
test("Observes data... ", function() { | |
var count = 0; | |
//var model = SC.IO.Resource.create({ | |
var model = SC.Object.create({ | |
data: null | |
}); |
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
this.manager.configure( function (){ | |
this.set('authorization', function (handshakeData, callback) { | |
console.log( 'inside authorization......'); | |
var room_id = handshakeData.query.room; | |
var authorized = this.room_trigger[room_id]!=undefined; | |
var error = authorized ? undefined : 'room is not available'; | |
callback(error, authorized); |