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
ISTOUCHING = false; | |
function useTouchEvents() { | |
return isTouchDevice(); | |
} | |
function triggerClick(dom) { | |
if (useTouchEvents()) { | |
dom.trigger('tap'); | |
} else { |
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 navigator = window.navigator || {}; | |
navigator.camera = (function() { | |
function resizeImage(img, maxHeight, maxWidth) { | |
var ratio = maxHeight/maxWidth; | |
if (img.height/img.width > ratio){ | |
// height is the problem | |
if (img.height > maxHeight){ | |
img.width = Math.round(img.width*(maxHeight/img.height)); | |
img.height = maxHeight; |
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
import unittest | |
import datetime | |
from sys import * | |
from selenium import webdriver | |
from selenium.webdriver.support.ui import WebDriverWait | |
import login_dom | |
class BaseTests(unittest.TestCase): |
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
from selenium.common.exceptions import NoSuchElementException, TimeoutException | |
class DomHelper(object): | |
driver = None | |
waiter = None | |
def open_page(self, url): | |
self.driver.get(url) |
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
import base_tests | |
import dom_helper | |
import facebook_dom | |
class FacebookTests(base_tests.BaseTests): | |
@classmethod | |
def setUpClass(cls): | |
super(StartTests, cls).setUpClass() | |
StartTests.clear_data() |
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
import dom_helper | |
import test_defaults | |
FBEMAIL = '#email' | |
FBPASS = '#pass' | |
FBLOGIN = 'input[name="login"]' | |
FBGRANT = 'input[name="grant_clicked"]' | |
class FacebookDom(dom_helper.DomHelper): |
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
<!--[if lt IE 7]> | |
<script type="text/javascript" | |
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script> | |
<script> | |
// The conditional ensures that this code will only execute in IE, | |
// Therefore we can use the IE-specific attachEvent without worry | |
window.attachEvent("onload", function() { | |
CFInstall.check({ | |
mode: "overlay" | |
}); |
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
// Calculate moving average | |
var averageData = []; | |
var lastValue = null; | |
var movingAverage = null; | |
for (var i = 0; i < dates.length; i++) { | |
var value = measurementData[i] || missingData[i]; | |
if (!movingAverage) { | |
movingAverage = value; | |
} else { | |
movingAverage = ((value - movingAverage)/7) + movingAverage; |
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
/* =========================================================== | |
* bootstrap-datepicker.js v1.3.0 | |
* http://twitter.github.com/bootstrap/javascript.html#datepicker | |
* =========================================================== | |
* Copyright 2011 Twitter, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* |
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
.datepicker { | |
background-color: $white; | |
border-color: #999; | |
border-color: rgba(0, 0, 0, 0.2); | |
border-style: solid; | |
border-width: 1px; | |
@include border-radius(4px); | |
@include box-shadow(0 2px 4px rgba(0,0,0,.2)); | |
@include background-clip(padding-box); |