Permalink
Browse files

Safari added

  • Loading branch information...
1 parent 973cbd4 commit f0b1ac967e564bbec1c53a8c38ef0eb3bfa5cdca @stuartgibson stuartgibson committed Sep 29, 2011
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Author</key>
+ <string>Wee Tidy</string>
+ <key>Builder Version</key>
+ <string>7534.48.3</string>
+ <key>CFBundleDisplayName</key>
+ <string>Pull to Refresh</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.weetidy.pulltorefresh</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>Chrome</key>
+ <dict/>
+ <key>Content</key>
+ <dict>
+ <key>Scripts</key>
+ <dict>
+ <key>Start</key>
+ <array>
+ <string>jquery-1.6.4.min.js</string>
+ <string>pull_to_refresh.js</string>
+ </array>
+ </dict>
+ <key>Stylesheets</key>
+ <array>
+ <string>styles.css</string>
+ </array>
+ </dict>
+ <key>Description</key>
+ <string>Pull to refresh on any web page</string>
+ <key>ExtensionInfoDictionaryVersion</key>
+ <string>1.0</string>
+ <key>Permissions</key>
+ <dict>
+ <key>Website Access</key>
+ <dict>
+ <key>Include Secure Pages</key>
+ <true/>
+ <key>Level</key>
+ <string>All</string>
+ </dict>
+ </dict>
+</dict>
+</plist>

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,107 @@
+(function(){
+
+ var special = jQuery.event.special,
+ uid1 = 'D' + (+new Date()),
+ uid2 = 'D' + (+new Date() + 1);
+
+ special.scrollstop = {
+ latency: 300,
+ setup: function() {
+
+ var timer,
+ handler = function(evt) {
+
+ var _self = this,
+ _args = arguments;
+
+ if (timer) {
+ clearTimeout(timer);
+ }
+
+ timer = setTimeout( function(){
+
+ timer = null;
+ evt.type = 'scrollstop';
+ jQuery.event.handle.apply(_self, _args);
+
+ }, special.scrollstop.latency);
+
+ };
+
+ jQuery(this).bind('scroll', handler).data(uid2, handler);
+
+ },
+ teardown: function() {
+ jQuery(this).unbind( 'scroll', jQuery(this).data(uid2) );
+ }
+ };
+
+})();
+
+
+var pully = {
+
+ position: null,
+ refreshPossible: false,
+
+ init: function() {
+ var current_url = document.URL;
+ if( current_url.search( 'twitter.com' ) == -1 )
+ {
+ // Inject the div
+ $('body').prepend('<div id="pullToRefresh"><div class="wrap"><span class="icon">&nbsp;</span><div id="pulltorefreshheader"></div></div></div>');
+ // listener for scrolling
+ $(window).bind('scroll', pully.scrollStart);
+ $(window).bind('scrollstop', pully.scrollStop);
+ }
+ },
+
+ scrollStart: function() {
+ pully.position = $(window).scrollTop();
+
+ if (pully.position <= -30)
+ {
+ $('#pullToRefresh #pulltorefreshheader').text('Release to refresh');
+ $('#pullToRefresh .icon').addClass('release');
+ pully.refreshPossible = true;
+ }
+ else if (pully.position <= -5 && pully.refreshPossible === false)
+ {
+ pully.slideDownMenu();
+ }
+ else if (pully.refreshPossible === false)
+ {
+ pully.slideUpMenu();
+ }
+
+ },
+
+ scrollStop: function() {
+ pully.position = $(window).scrollTop();
+
+ if (pully.position >= 0 && pully.refreshPossible === true)
+ {
+ $('#pullToRefresh').addClass('fixed');
+ $('#pullToRefresh #pulltorefreshheader').text('Reloading…');
+ $(window).scrollTop(0);
+
+ setTimeout(function(){
+ window.location.reload();
+ }, 1000);
+ }
+
+ },
+
+ slideDownMenu: function() {
+ $('#pullToRefresh').slideDown(200);
+ $('#pullToRefresh #pulltorefreshheader').text('Pull to refresh');
+ $('#pullToRefresh .icon').removeClass('release');
+ },
+
+ slideUpMenu: function() {
+ $('#pullToRefresh').slideUp(200);
+ }
+
+};
+
+$(document).ready(pully.init);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,74 @@
+#pullToRefresh{
+ display: none;
+ position: fixed !important;
+ top: 0px !important;
+ left: 0px !important;
+ height: 40px !important;
+ width: 40% !important;
+ margin: 0 30% !important;
+ border-bottom-left-radius: 10px !important;
+ border-bottom-right-radius: 10px !important;
+ background: -webkit-linear-gradient(bottom, rgba(20,20,20,0.9) 5%, rgba(64,64,64,0.9) 53%) !important;
+ z-index: 10000 !important;
+ box-shadow: 0 0 10px rgba(0,0,0,0.2) !important;
+}
+
+#pullToRefresh.fixed{ display: block !important; }
+
+#pullToRefresh .wrap{
+ width: 180px !important;
+ margin: 0 auto !important;
+ padding: 10px 0 !important;
+}
+
+#pullToRefresh #pulltorefreshheader{
+ width: 160px !important;
+ display: block !important;
+ color: #fff !important;
+ line-height: 20px !important;
+ font-size: 16px !important;
+ font-family: 'Helvetica Neue', Helvetica, sans-serif !important;
+ text-shadow: 1px 1px 0px rgba(0,0,0,0.8) !important;
+}
+
+#pullToRefresh .icon{
+ background: url('whiteArrow.png') !important;
+ float: right !important;
+ display: block !important;
+ width: 20px !important;
+ height: 20px !important;
+ color: #fff !important;
+ font-size: 20px !important;
+ line-height: 20px !important;
+ text-align: center !important;
+ border-radius: 20px !important;
+ margin-left: 20px !important;
+ -webkit-transition: all .3s ease-in-out;
+}
+
+#pullToRefresh.fixed .icon{
+ -webkit-transition: none;
+}
+
+#pullToRefresh .icon.release{
+ -webkit-transform: rotate(180deg);
+}
+
+@-webkit-keyframes rotate {
+ from {
+ -webkit-transform: rotate(0deg);
+ }
+ to {
+ -webkit-transform: rotate(360deg);
+ }
+}
+
+#pullToRefresh.fixed .icon{
+ background: url('spinner.png') !important;
+ text-indent: -10000px !important;
+ -webkit-animation-name: rotate;
+ -webkit-animation-duration: 0.5s;
+ -webkit-animation-iteration-count: infinite;
+ -webkit-transition-timing-function: linear;
+ -webkit-transform: rotate(0deg);
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f0b1ac9

Please sign in to comment.