├── smilecounter ├── __init__.py ├── migrations │ ├── __init__.py │ └── 0001_initial.py ├── static │ ├── img │ │ ├── smile.jpg │ │ ├── favicon.ico │ │ ├── logo300.jpg │ │ ├── bg-smile.jpg │ │ ├── logo-200.png │ │ ├── smile-blur.jpg │ │ ├── tile-480.png │ │ ├── ChromeWebStore.png │ │ ├── WebStoreButton.png │ │ ├── bg-smile-blur.jpg │ │ ├── smile-blur-dark.jpg │ │ ├── SmileAlways-1400x560.png │ │ ├── SmileAlways-440x280.png │ │ ├── SmileAlways-920x680.png │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png │ ├── css │ │ ├── my.css │ │ ├── bootstrap-responsive.min.css │ │ └── bootstrap-responsive.css │ └── js │ │ └── bootstrap.min.js ├── models.py ├── views.py ├── urls.py ├── templates │ └── smilecounter │ │ ├── index.html │ │ ├── base.html │ │ └── faq.html ├── wsgi.py └── settings.py ├── .gitignore ├── Procfile ├── images ├── Screenshot.png ├── SmileAlways-440x280.png ├── SmileAlways-920x680.png ├── SmileAlwaysLogo-128.png ├── SmileAlwaysLogo-16.png ├── SmileAlwaysLogo-48.png ├── SmileAlways-1280x800.png └── SmileAlways-1400x560.png ├── chromeplugin ├── SA-16x16.png ├── SA-48x48.png ├── SA-128x128.png ├── manifest.json └── request.js ├── tests ├── setup.js ├── test.html ├── tests.js └── resources │ ├── qunit-1.12.0.css │ └── qunit-1.12.0.js ├── requirements.txt ├── manage.py ├── README.md ├── safariextension └── smilealways.safariextension │ └── Info.plist └── LICENSE.md /smilecounter/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /smilecounter/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.db 2 | *.zip 3 | *.sw* 4 | *.pyc 5 | local_settings.py 6 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: newrelic-admin run-program gunicorn smilecounter.wsgi 2 | -------------------------------------------------------------------------------- /images/Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/images/Screenshot.png -------------------------------------------------------------------------------- /chromeplugin/SA-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/chromeplugin/SA-16x16.png -------------------------------------------------------------------------------- /chromeplugin/SA-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/chromeplugin/SA-48x48.png -------------------------------------------------------------------------------- /chromeplugin/SA-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/chromeplugin/SA-128x128.png -------------------------------------------------------------------------------- /images/SmileAlways-440x280.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/images/SmileAlways-440x280.png -------------------------------------------------------------------------------- /images/SmileAlways-920x680.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/images/SmileAlways-920x680.png -------------------------------------------------------------------------------- /images/SmileAlwaysLogo-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/images/SmileAlwaysLogo-128.png -------------------------------------------------------------------------------- /images/SmileAlwaysLogo-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/images/SmileAlwaysLogo-16.png -------------------------------------------------------------------------------- /images/SmileAlwaysLogo-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/images/SmileAlwaysLogo-48.png -------------------------------------------------------------------------------- /images/SmileAlways-1280x800.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/images/SmileAlways-1280x800.png -------------------------------------------------------------------------------- /images/SmileAlways-1400x560.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/images/SmileAlways-1400x560.png -------------------------------------------------------------------------------- /smilecounter/static/img/smile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/smile.jpg -------------------------------------------------------------------------------- /smilecounter/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/favicon.ico -------------------------------------------------------------------------------- /smilecounter/static/img/logo300.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/logo300.jpg -------------------------------------------------------------------------------- /smilecounter/static/img/bg-smile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/bg-smile.jpg -------------------------------------------------------------------------------- /smilecounter/static/img/logo-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/logo-200.png -------------------------------------------------------------------------------- /smilecounter/static/img/smile-blur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/smile-blur.jpg -------------------------------------------------------------------------------- /smilecounter/static/img/tile-480.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/tile-480.png -------------------------------------------------------------------------------- /smilecounter/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | class SmileRedirect(models.Model): 4 | time = models.DateTimeField() 5 | -------------------------------------------------------------------------------- /smilecounter/static/img/ChromeWebStore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/ChromeWebStore.png -------------------------------------------------------------------------------- /smilecounter/static/img/WebStoreButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/WebStoreButton.png -------------------------------------------------------------------------------- /smilecounter/static/img/bg-smile-blur.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/bg-smile-blur.jpg -------------------------------------------------------------------------------- /smilecounter/static/img/smile-blur-dark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/smile-blur-dark.jpg -------------------------------------------------------------------------------- /smilecounter/static/img/SmileAlways-1400x560.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/SmileAlways-1400x560.png -------------------------------------------------------------------------------- /smilecounter/static/img/SmileAlways-440x280.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/SmileAlways-440x280.png -------------------------------------------------------------------------------- /smilecounter/static/img/SmileAlways-920x680.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/SmileAlways-920x680.png -------------------------------------------------------------------------------- /smilecounter/static/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /smilecounter/static/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jdhaimson/smilealways/HEAD/smilecounter/static/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /tests/setup.js: -------------------------------------------------------------------------------- 1 | // add fake webRequest object to chrome object so we don't get an eror 2 | // when running this outside of an extension environment 3 | chrome.webRequest = { 4 | onBeforeRequest: { 5 | addListener: function(listener) {} 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.6 2 | South==0.8.2 3 | argparse==1.2.1 4 | distribute==0.6.34 5 | dj-database-url==0.2.2 6 | dj-static==0.0.5 7 | django-toolbelt==0.0.1 8 | gunicorn==18.0 9 | newrelic==2.4.0.4 10 | psycopg2==2.5.1 11 | pytz==2013.8 12 | static==0.4 13 | wsgiref==0.1.2 14 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "smilecounter.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /tests/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Testing Smile Always Chrome Extension 6 | 7 | 8 | 9 |
10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /smilecounter/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.http import HttpResponse 3 | from smilecounter.models import SmileRedirect 4 | from datetime import datetime 5 | from pytz import UTC 6 | from django.utils import simplejson 7 | 8 | def home(request): 9 | return render(request, 'smilecounter/index.html', {}) 10 | 11 | def faq(request): 12 | return render(request, 'smilecounter/faq.html', {}) 13 | 14 | def addRedirect(request): 15 | SmileRedirect.objects.create(time=UTC.localize(datetime.now())) 16 | response_data = {} 17 | return HttpResponse(simplejson.dumps(response_data), content_type="application/json") 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **** 2 | The Amazon Smile program is being sunsetted as of 2/20/2023, rendering this extension obsolete. It has been updated to remove redirect functionality, while being left here for reference, should anyone find it useful. 3 | ====================== 4 | **** 5 | 6 | Amazon Smile Redirector Chrome Plugin 7 | ====================== 8 | 9 | Chrome Extension to redirect all [www.amazon.com]() URLs to [smile.amazon.com]() 10 | 11 | Installation 12 | ============ 13 | 14 | 1. Download this repository 15 | 1. Open Chrome 16 | 1. Go to 'Extensions' (`chrome://extensions/`) 17 | 1. Enable 'Developer mode' 18 | 1. Click 'Load unpacked extension' 19 | 1. Select `chromeplugin` folder from this repository 20 | 21 | Happy shopping. 22 | -------------------------------------------------------------------------------- /chromeplugin/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "background": { 3 | "scripts": [ "request.js" ] 4 | }, 5 | "description": "DEFUNCT - Previously redirected any www.amazon.com page to smile.amazon.com", 6 | "icons": { "16": "SA-16x16.png", 7 | "48": "SA-48x48.png", 8 | "128": "SA-128x128.png" }, 9 | "manifest_version": 2, 10 | "name": "Smile Always", 11 | "permissions": [ "webRequest", "webRequestBlocking", "http://www.amazon.com/*", "https://www.amazon.com/*", "http://www.amazon.de/*", "https://www.amazon.de/*", "http://www.amazon.co.uk/*", "https://www.amazon.co.uk/*" ], 12 | "version": "0.95", 13 | "homepage_url": "http://www.smilealways.io", 14 | "author":"Josh Haimson and Dan Elitzer" 15 | } 16 | -------------------------------------------------------------------------------- /smilecounter/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, include, url 2 | 3 | # Uncomment the next two lines to enable the admin: 4 | # from django.contrib import admin 5 | # admin.autodiscover() 6 | 7 | urlpatterns = patterns('', 8 | # Examples: 9 | url(r'^$', 'smilecounter.views.home', name='home'), 10 | url(r'^faq/', 'smilecounter.views.faq', name='faq'), 11 | # url(r'^newredirect', 'smilecounter.views.addRedirect', name='home'), 12 | # url(r'^smilecounter/', include('smilecounter.foo.urls')), 13 | 14 | # Uncomment the admin/doc line below to enable admin documentation: 15 | # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), 16 | 17 | # Uncomment the next line to enable the admin: 18 | # url(r'^admin/', include(admin.site.urls)), 19 | ) 20 | -------------------------------------------------------------------------------- /smilecounter/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import datetime 3 | from south.db import db 4 | from south.v2 import SchemaMigration 5 | from django.db import models 6 | 7 | 8 | class Migration(SchemaMigration): 9 | 10 | def forwards(self, orm): 11 | # Adding model 'SmileRedirect' 12 | db.create_table(u'smilecounter_smileredirect', ( 13 | (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), 14 | ('time', self.gf('django.db.models.fields.DateTimeField')()), 15 | )) 16 | db.send_create_signal(u'smilecounter', ['SmileRedirect']) 17 | 18 | 19 | def backwards(self, orm): 20 | # Deleting model 'SmileRedirect' 21 | db.delete_table(u'smilecounter_smileredirect') 22 | 23 | 24 | models = { 25 | u'smilecounter.smileredirect': { 26 | 'Meta': {'object_name': 'SmileRedirect'}, 27 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 28 | 'time': ('django.db.models.fields.DateTimeField', [], {}) 29 | } 30 | } 31 | 32 | complete_apps = ['smilecounter'] -------------------------------------------------------------------------------- /smilecounter/templates/smilecounter/index.html: -------------------------------------------------------------------------------- 1 | {% extends "smilecounter/base.html" %} 2 | {% load staticfiles %} 3 | 4 | {% block main %} 5 | 7 |
8 |

SmileAlways

9 | 10 |
11 |
12 |

SmileAlways is a Chrome extension that automatically redirects you to smile.amazon.com to make donating to charity easier!

13 |
14 |
15 |

SmileAlways is a Chrome extension that automatically redirects you to smile.amazon.com to make donating to charity easier!

16 |
17 | 18 | 19 |
20 | Chrome Web Store 21 |
22 |
23 | 24 |

FAQ

25 |
26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /safariextension/smilealways.safariextension/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Author 6 | Josh Haimson 7 | Builder Version 8 | 534.57.2 9 | CFBundleDisplayName 10 | smilealways 11 | CFBundleIdentifier 12 | com.yourcompany.smilealways 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | Chrome 20 | 21 | Content 22 | 23 | Scripts 24 | 25 | 26 | Description 27 | Smile Always redirects all amazon.com requests to smile.amazon.com 28 | ExtensionInfoDictionaryVersion 29 | 1.0 30 | Permissions 31 | 32 | Website Access 33 | 34 | Allowed Domains 35 | 36 | http://www.amazon.com 37 | https://www.amazon.com 38 | 39 | Include Secure Pages 40 | 41 | Level 42 | Some 43 | 44 | 45 | Website 46 | www.smilealways.io 47 | 48 | 49 | -------------------------------------------------------------------------------- /smilecounter/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for smilecounter project. 3 | 4 | This module contains the WSGI application used by Django's development server 5 | and any production WSGI deployments. It should expose a module-level variable 6 | named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover 7 | this application via the ``WSGI_APPLICATION`` setting. 8 | 9 | Usually you will have the standard Django WSGI application here, but it also 10 | might make sense to replace the whole Django WSGI application with a custom one 11 | that later delegates to the Django one. For example, you could introduce WSGI 12 | middleware here, or combine a Django application with an application of another 13 | framework. 14 | 15 | """ 16 | import os 17 | 18 | # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks 19 | # if running multiple sites in the same mod_wsgi process. To fix this, use 20 | # mod_wsgi daemon mode with each site in its own daemon process, or use 21 | # os.environ["DJANGO_SETTINGS_MODULE"] = "smilecounter.settings" 22 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "smilecounter.settings") 23 | 24 | # This application object is used by any WSGI server configured to use this 25 | # file. This includes Django's development server, if the WSGI_APPLICATION 26 | # setting points here. 27 | from django.core.wsgi import get_wsgi_application 28 | from dj_static import Cling 29 | 30 | application = Cling(get_wsgi_application()) 31 | 32 | # Apply WSGI middleware here. 33 | # from helloworld.wsgi import HelloWorldApplication 34 | # application = HelloWorldApplication(application) 35 | -------------------------------------------------------------------------------- /smilecounter/static/css/my.css: -------------------------------------------------------------------------------- 1 | html { 2 | height: 100%; 3 | } 4 | 5 | body { 6 | background: url(../img/smile-blur-dark.jpg) no-repeat center center fixed; 7 | -webkit-background-size: cover; 8 | -moz-background-size: cover; 9 | -o-background-size: cover; 10 | background-size: cover; 11 | overflow: auto; 12 | height: 100%; 13 | } 14 | 15 | #header { 16 | height: 20%; 17 | width: 100%; 18 | text-align: center; 19 | margin-top: -10px; 20 | vertical-align: middle; 21 | } 22 | 23 | a { 24 | color: #777; 25 | } 26 | 27 | 28 | 29 | h1 { 30 | font-size: 6em; 31 | margin-bottom: .5em; 32 | line-height: 1em; 33 | } 34 | 35 | h1, h2, h3, h4 { 36 | color: #fff; 37 | } 38 | 39 | h3, h4 { 40 | font-weight: normal; 41 | } 42 | 43 | h3 { 44 | font-size: 1.5em; 45 | line-height: 1.3em; 46 | } 47 | 48 | 49 | #description { 50 | margin-top: 10%; 51 | margin-bottom: 20%; 52 | text-align: center; 53 | padding-right: 10px; 54 | } 55 | 56 | #mobile-desc { 57 | text-align: center; 58 | padding-right: 10px; 59 | } 60 | 61 | #webstore { 62 | margin-top: 10%; 63 | margin-bottom: 20%; 64 | border-radius: 35px; 65 | border: solid 1px #888; 66 | background-image: -webkit-gradient( 67 | linear, 68 | left bottom, 69 | left top, 70 | color-stop(0, #DFDDEB), 71 | color-stop(1, #FFFFFF) 72 | ); 73 | background-image: -o-linear-gradient(top, #DFDDEB 0%, #FFFFFF 100%); 74 | background-image: -moz-linear-gradient(top, #DFDDEB 0%, #FFFFFF 100%); 75 | background-image: -webkit-linear-gradient(top, #DFDDEB 0%, #FFFFFF 100%); 76 | background-image: -ms-linear-gradient(top, #DFDDEB 0%, #FFFFFF 100%); 77 | background-image: linear-gradient(to top, #DFDDEB 0%, #FFFFFF 100%); 78 | 79 | } 80 | 81 | #content { 82 | margin: 0 auto; 83 | text-align: center; 84 | } 85 | 86 | #wrapper { 87 | margin-left: 0; 88 | } 89 | 90 | #faqwrapper { 91 | background: rgba(256,256,256,.65); 92 | margin: 0; 93 | padding: 10px; 94 | padding-bottom: 100px; 95 | } 96 | 97 | 98 | #footer { 99 | height: 7%; 100 | width: 100%; 101 | text-align: center; 102 | position: fixed; 103 | bottom: 0; 104 | border-top: 2px dotted #888; 105 | background: rgba(256,256,256,.65); 106 | } 107 | 108 | #footer h4 { 109 | color: #888; 110 | } 111 | -------------------------------------------------------------------------------- /smilecounter/templates/smilecounter/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% load staticfiles %} 6 | 7 | SmileAlways Chrome Extension 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | {% block main %}{% endblock %} 48 | 49 | 50 | 51 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /chromeplugin/request.js: -------------------------------------------------------------------------------- 1 | //Commenting out all code to prevent infinite redirect loop for extension users when the Amazon Smile program is sunset on 2/20/2023 2 | 3 | /*********************** REDIRECT CODE **********************/ 4 | /* 5 | chrome.webRequest.onBeforeRequest.addListener(function(details) { 6 | return detectRedirect(details); 7 | }, { 8 | urls : [""], 9 | types: ["main_frame","sub_frame"] 10 | }, ["blocking"]); 11 | 12 | 13 | function detectRedirect(details) { 14 | var url = details.url; 15 | 16 | if (url == null) { 17 | return; 18 | } 19 | 20 | var domain = url_domain(url); 21 | var amazonurl = "www.amazon.com"; 22 | var country = "com"; 23 | if (domain.includes("amazon.de")) { 24 | amazonurl = "www.amazon.de"; 25 | country = "de"; 26 | } else if (domain.includes("amazon.co.uk")) { 27 | amazonurl = "www.amazon.co.uk"; 28 | country = "uk"; 29 | } 30 | 31 | var https = "https://"; 32 | // ignore links with these strings in them 33 | var filter = "(sa-no-redirect=)" 34 | + "|(redirect=true)" 35 | + "|(redirect.html)" 36 | + "|(r.html)" 37 | + "|(f.html)" 38 | + "|(/dmusic/cloudplayer)" 39 | + "|(/photos)" 40 | + "|(/wishlist)" 41 | + "|(/clouddrive)" 42 | + "|(/ap/)" 43 | + "|(aws.amazon.)" 44 | + "|(read.amazon.)" 45 | + "|(login.amazon.)" 46 | + "|(payments.amazon.)" 47 | + "|(http://)"; //all Amazon pages now redirect to HTTPS, also fixes conflict with HTTPS Everywhere extension 48 | 49 | // Don't try and redirect pages that are in our filter 50 | if (url.match(filter) != null) { 51 | return; 52 | } 53 | 54 | return redirectToSmile(https, amazonurl, url, country); 55 | } 56 | 57 | function redirectToSmile(scheme, amazonurl, url, country) { 58 | var smileurl = "smile.amazon.com"; 59 | if (country === "de") { 60 | smileurl = "smile.amazon.de"; 61 | } else if (country === "uk") { 62 | smileurl = "smile.amazon.co.uk"; 63 | } 64 | return { 65 | // redirect to amazon smile append the rest of the url 66 | redirectUrl : scheme + smileurl + getRelativeRedirectUrl(amazonurl, url) 67 | }; 68 | } 69 | 70 | function getRelativeRedirectUrl(amazonurl, url) { 71 | var relativeUrl = url.split(amazonurl)[1]; 72 | var noRedirectIndicator = "sa-no-redirect=1"; 73 | var paramStart = "?"; 74 | var paramStartRegex = "\\" + paramStart; 75 | var newurl = null; 76 | 77 | // check to see if there are already GET variables in the url 78 | if (relativeUrl.match(paramStartRegex) != null) { 79 | newurl = relativeUrl + "&" + noRedirectIndicator; 80 | } else { 81 | newurl = relativeUrl + paramStart + noRedirectIndicator; 82 | } 83 | return newurl; 84 | } 85 | 86 | function url_domain(data) { 87 | var a = document.createElement('a'); 88 | a.href = data; 89 | return a.hostname; 90 | } 91 | */ 92 | -------------------------------------------------------------------------------- /smilecounter/templates/smilecounter/faq.html: -------------------------------------------------------------------------------- 1 | {% extends "smilecounter/base.html" %} 2 | {% load staticfiles %} 3 | 4 | {% block main %} 5 |
6 |
7 |
8 |

SmileAlways FAQ

9 |

What is AmazonSmile?

10 |

AmazonSmile is a simple and automatic way for you to support your favorite charitable organization every time you shop at Amazon, at no cost to you. Learn more at https://smile.amazon.com/about.

11 | 12 |

Who created SmileAlways?

13 |

SmileAlways was developed by two MIT students, Josh Haimson and Dan Elitzer. Josh and Dan wrote and published the initial version of this extension on November 10th, 2013, dedicating it to the memory of Aaron Swartz.

14 | 15 |

How are you making money from this?

16 |

We’re not. We’re both frequent Amazon customers and when we learned about the AmazonSmile program, we thought it was great. Who doesn’t want to help charities raise more money?! But we knew we would probably forget to start our shopping at smile.amazon.com. The idea of an extension that would automatically redirect Amazon URLs to smile.amazon.com seemed obvious to us, so we assumed someone would build it. When we couldn’t find anything doing that after a couple weeks, we decided to build it ourselves.

17 | 18 |

Sounds great. What’s the catch?

19 |

There is none. The extension doesn’t collect any personal information or browsing data. All it does is redirect www.amazon.com URLs to smile.amazon.com.

20 | 21 |

Really? I don’t believe you.

22 |

Yes, really! You can check for yourself - all the code is available at http://github.com/Jdhaimson/smilealways.

23 | 24 |

Okay, I’m convinced. How can my favorite nonprofit benefit from SmileAlways?

25 |

Some nonprofits are already promoting AmazonSmile to their supporters as an easy way to help out. Unfortunately, we suspect most people probably register on AmazonSmile to support their favorite charity, but forget to start their shopping at smile.amazon.com. By encouraging supporters to both register and install SmileAlways, nonprofits can ensure that if they get their supporters to take action one time, it will lead to ongoing revenue for as long as Amazon continues the AmazonSmile program.

26 | 27 |

If you need help integrating SmileAlways on your website, contact us at info@smilealways.io.

28 | 29 |

Don’t programs like AmazonSmile replace other giving?

30 |

We sure hope not! While we encourage everyone who shops at Amazon to use this extension, we encourage you to also find other ways to contribute to charitable causes you care about by directly donating your dollars, skills, and time. If you are unsure which charity you want to give to, please check out the organizations recommended by GiveWell, a charity research and evaluation group with whom Aaron volunteered his time.

31 |
32 |

Home

33 |
34 |
35 |
36 | {% endblock %} 37 | -------------------------------------------------------------------------------- /tests/tests.js: -------------------------------------------------------------------------------- 1 | var spoofRequest = function(spoofUrl) { 2 | return { 3 | url: spoofUrl 4 | } 5 | }; 6 | 7 | var testHelper = function(inputUrl, expRes, testMsg) { 8 | // make sure detectRedirect performs properly 9 | var req = spoofRequest(inputUrl); 10 | var res = detectRedirect(req); 11 | // if we didn't get a redirect then set it to the same url for testing 12 | if (!res) { 13 | res = { 14 | redirectUrl: inputUrl 15 | }; 16 | } 17 | equal(res.redirectUrl, expRes, testMsg); 18 | // make the actual amazon request and make sure things work 19 | }; 20 | 21 | var makeRequest = function(url) { 22 | $.get( 23 | url, 24 | {paramOne : 1, paramX : 'abc'}, 25 | function(data) { 26 | console.log('page content: ' + data); 27 | } 28 | ); 29 | }; 30 | 31 | test("testing detectRedirect", function() { 32 | var saTag = "sa-no-redirect=1"; 33 | testHelper("http://www.amazon.com", "http://smile.amazon.com?" + saTag, "test basic http request"); 34 | testHelper("https://www.amazon.com", "https://smile.amazon.com?" + saTag, "test basic https request"); 35 | 36 | // Affiliate Programs 37 | testHelper("http://www.amazon.com/Samsung-Fitness-Tracker-Smartwatch-Warranty/dp/B00JBJ3JBI/?t=slicinc-20&tag=slicinc-20&ascsubtag=b8845bf585ad460b9e8d6a7891446fb7", 38 | "http://smile.amazon.com/Samsung-Fitness-Tracker-Smartwatch-Warranty/dp/B00JBJ3JBI/?t=slicinc-20&tag=slicinc-20&ascsubtag=b8845bf585ad460b9e8d6a7891446fb7&" + saTag, 39 | "test affiliate link 1"); 40 | 41 | testHelper("http://www.amazon.com/gp/product/B008Z1IAB2/ref=pe_820770_118255880_em_1p_0_ti", 42 | "http://smile.amazon.com/gp/product/B008Z1IAB2/ref=pe_820770_118255880_em_1p_0_ti?" + saTag, 43 | "test affiliate link 2"); 44 | 45 | // Reviews 46 | testHelper("http://www.amazon.com/review/R27KDST5CWRJFZ/ref=cm_cr_quotes_dprb_1?ie=UTF8&ASIN=B00JBJ3JBI&nodeID=2335752011&store=wireless", 47 | "http://smile.amazon.com/review/R27KDST5CWRJFZ/ref=cm_cr_quotes_dprb_1?ie=UTF8&ASIN=B00JBJ3JBI&nodeID=2335752011&store=wireless&" + saTag, 48 | "test review link"); 49 | 50 | // Email links -- should not redirect 51 | testHelper("http://www.amazon.com/gp/r.html?R=31397EMN4EI6D&C=1WC8X72NNSJIY&H=UJLQOSJUR5AAM1BEA3SCZ9UDLHWA&T=C&U=http%3A%2F%2Fwww.amazon.com%2Fb%2Fref%3Dpe_854610_117920160_amzn_student_wlcmml_menuitem1%3Fie%3DUTF8%26node%3D668781011", 52 | "http://www.amazon.com/gp/r.html?R=31397EMN4EI6D&C=1WC8X72NNSJIY&H=UJLQOSJUR5AAM1BEA3SCZ9UDLHWA&T=C&U=http%3A%2F%2Fwww.amazon.com%2Fb%2Fref%3Dpe_854610_117920160_amzn_student_wlcmml_menuitem1%3Fie%3DUTF8%26node%3D668781011", 53 | "test email link 1"); 54 | testHelper("http://www.amazon.com/gp/r.html?R=31397EMN4EI6D&C=1WC8X72NNSJIY&H=EZ9XEOWKFVAPN3ETNHTGAHHUVACA&T=C&U=http%3A%2F%2Fwww.amazon.com%2Fb%2Fref%3Dpe_854610_117920160_amzn_student_wlcmml_menuitem2%3Fie%3DUTF8%26node%3D465600", 55 | "http://www.amazon.com/gp/r.html?R=31397EMN4EI6D&C=1WC8X72NNSJIY&H=EZ9XEOWKFVAPN3ETNHTGAHHUVACA&T=C&U=http%3A%2F%2Fwww.amazon.com%2Fb%2Fref%3Dpe_854610_117920160_amzn_student_wlcmml_menuitem2%3Fie%3DUTF8%26node%3D465600", 56 | "test email link 2"); 57 | testHelper("https://www.amazon.com/gp/f.html?C=blah&K=blah&R=blah&T=C&U=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fcd%2Fm%2FFxRTNUCY84BRXB%2F-%2FTx22GZ1U68IKAGZ%2F2%2FMx3GRFSB857NV2I%3Fref_%3Dpe_623860_70668520&A=blah&H=blah&ref_=pe_623860_70668520", 58 | "https://www.amazon.com/gp/f.html?C=blah&K=blah&R=blah&T=C&U=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fcd%2Fm%2FFxRTNUCY84BRXB%2F-%2FTx22GZ1U68IKAGZ%2F2%2FMx3GRFSB857NV2I%3Fref_%3Dpe_623860_70668520&A=blah&H=blah&ref_=pe_623860_70668520", 59 | "test email link 3 (new comment notification)"); 60 | 61 | // Mailing labels -- should not redirect 62 | testHelper("https://www.amazon.com/gp/f.html?C=blah&K=blah&R=blah&T=C&U=https%3A%2F%2Fwww.amazon.com%2Freturns%2Flabel%2F9ceeablah-blah%2FrmaID%2FDckf6ZftRRMA%3Fref_%3Dpe_1811570_blah_E_Label_Page&A=blah&H=blah&ref_=pe_1811570_136791410_E_Label_Page", 63 | "https://www.amazon.com/gp/f.html?C=blah&K=blah&R=blah&T=C&U=https%3A%2F%2Fwww.amazon.com%2Freturns%2Flabel%2F9ceeablah-blah%2FrmaID%2FDckf6ZftRRMA%3Fref_%3Dpe_1811570_blah_E_Label_Page&A=blah&H=blah&ref_=pe_1811570_136791410_E_Label_Page", 64 | "test mailing label link"); 65 | 66 | 67 | // Amazon Services - should not redirect 68 | testHelper("http://aws.amazon.com", "http://aws.amazon.com", "test aws"); 69 | testHelper("http://www.amazon.com/gp/dmusic/cloudplayer/web?ie=UTF8&*Version*=1&*entries*=0#albums", 70 | "http://www.amazon.com/gp/dmusic/cloudplayer/web?ie=UTF8&*Version*=1&*entries*=0#albums", 71 | "test cloud player"); 72 | testHelper("http://read.amazon.com", "http://read.amazon.com", "test reader"); 73 | 74 | }); 75 | -------------------------------------------------------------------------------- /tests/resources/qunit-1.12.0.css: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * QUnit v1.12.0 - A JavaScript Unit Testing Framework 4 | * 5 | * http://qunitjs.com 6 | * 7 | * Copyright 2012 jQuery Foundation and other contributors 8 | * Released under the MIT license. 9 | * http://jquery.org/license 10 | */ 11 | 12 | /** Font Family and Sizes */ 13 | 14 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { 15 | font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; 16 | } 17 | 18 | #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } 19 | #qunit-tests { font-size: smaller; } 20 | 21 | 22 | /** Resets */ 23 | 24 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { 25 | margin: 0; 26 | padding: 0; 27 | } 28 | 29 | 30 | /** Header */ 31 | 32 | #qunit-header { 33 | padding: 0.5em 0 0.5em 1em; 34 | 35 | color: #8699a4; 36 | background-color: #0d3349; 37 | 38 | font-size: 1.5em; 39 | line-height: 1em; 40 | font-weight: normal; 41 | 42 | border-radius: 5px 5px 0 0; 43 | -moz-border-radius: 5px 5px 0 0; 44 | -webkit-border-top-right-radius: 5px; 45 | -webkit-border-top-left-radius: 5px; 46 | } 47 | 48 | #qunit-header a { 49 | text-decoration: none; 50 | color: #c2ccd1; 51 | } 52 | 53 | #qunit-header a:hover, 54 | #qunit-header a:focus { 55 | color: #fff; 56 | } 57 | 58 | #qunit-testrunner-toolbar label { 59 | display: inline-block; 60 | padding: 0 .5em 0 .1em; 61 | } 62 | 63 | #qunit-banner { 64 | height: 5px; 65 | } 66 | 67 | #qunit-testrunner-toolbar { 68 | padding: 0.5em 0 0.5em 2em; 69 | color: #5E740B; 70 | background-color: #eee; 71 | overflow: hidden; 72 | } 73 | 74 | #qunit-userAgent { 75 | padding: 0.5em 0 0.5em 2.5em; 76 | background-color: #2b81af; 77 | color: #fff; 78 | text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; 79 | } 80 | 81 | #qunit-modulefilter-container { 82 | float: right; 83 | } 84 | 85 | /** Tests: Pass/Fail */ 86 | 87 | #qunit-tests { 88 | list-style-position: inside; 89 | } 90 | 91 | #qunit-tests li { 92 | padding: 0.4em 0.5em 0.4em 2.5em; 93 | border-bottom: 1px solid #fff; 94 | list-style-position: inside; 95 | } 96 | 97 | #qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { 98 | display: none; 99 | } 100 | 101 | #qunit-tests li strong { 102 | cursor: pointer; 103 | } 104 | 105 | #qunit-tests li a { 106 | padding: 0.5em; 107 | color: #c2ccd1; 108 | text-decoration: none; 109 | } 110 | #qunit-tests li a:hover, 111 | #qunit-tests li a:focus { 112 | color: #000; 113 | } 114 | 115 | #qunit-tests li .runtime { 116 | float: right; 117 | font-size: smaller; 118 | } 119 | 120 | .qunit-assert-list { 121 | margin-top: 0.5em; 122 | padding: 0.5em; 123 | 124 | background-color: #fff; 125 | 126 | border-radius: 5px; 127 | -moz-border-radius: 5px; 128 | -webkit-border-radius: 5px; 129 | } 130 | 131 | .qunit-collapsed { 132 | display: none; 133 | } 134 | 135 | #qunit-tests table { 136 | border-collapse: collapse; 137 | margin-top: .2em; 138 | } 139 | 140 | #qunit-tests th { 141 | text-align: right; 142 | vertical-align: top; 143 | padding: 0 .5em 0 0; 144 | } 145 | 146 | #qunit-tests td { 147 | vertical-align: top; 148 | } 149 | 150 | #qunit-tests pre { 151 | margin: 0; 152 | white-space: pre-wrap; 153 | word-wrap: break-word; 154 | } 155 | 156 | #qunit-tests del { 157 | background-color: #e0f2be; 158 | color: #374e0c; 159 | text-decoration: none; 160 | } 161 | 162 | #qunit-tests ins { 163 | background-color: #ffcaca; 164 | color: #500; 165 | text-decoration: none; 166 | } 167 | 168 | /*** Test Counts */ 169 | 170 | #qunit-tests b.counts { color: black; } 171 | #qunit-tests b.passed { color: #5E740B; } 172 | #qunit-tests b.failed { color: #710909; } 173 | 174 | #qunit-tests li li { 175 | padding: 5px; 176 | background-color: #fff; 177 | border-bottom: none; 178 | list-style-position: inside; 179 | } 180 | 181 | /*** Passing Styles */ 182 | 183 | #qunit-tests li li.pass { 184 | color: #3c510c; 185 | background-color: #fff; 186 | border-left: 10px solid #C6E746; 187 | } 188 | 189 | #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } 190 | #qunit-tests .pass .test-name { color: #366097; } 191 | 192 | #qunit-tests .pass .test-actual, 193 | #qunit-tests .pass .test-expected { color: #999999; } 194 | 195 | #qunit-banner.qunit-pass { background-color: #C6E746; } 196 | 197 | /*** Failing Styles */ 198 | 199 | #qunit-tests li li.fail { 200 | color: #710909; 201 | background-color: #fff; 202 | border-left: 10px solid #EE5757; 203 | white-space: pre; 204 | } 205 | 206 | #qunit-tests > li:last-child { 207 | border-radius: 0 0 5px 5px; 208 | -moz-border-radius: 0 0 5px 5px; 209 | -webkit-border-bottom-right-radius: 5px; 210 | -webkit-border-bottom-left-radius: 5px; 211 | } 212 | 213 | #qunit-tests .fail { color: #000000; background-color: #EE5757; } 214 | #qunit-tests .fail .test-name, 215 | #qunit-tests .fail .module-name { color: #000000; } 216 | 217 | #qunit-tests .fail .test-actual { color: #EE5757; } 218 | #qunit-tests .fail .test-expected { color: green; } 219 | 220 | #qunit-banner.qunit-fail { background-color: #EE5757; } 221 | 222 | 223 | /** Result */ 224 | 225 | #qunit-testresult { 226 | padding: 0.5em 0.5em 0.5em 2.5em; 227 | 228 | color: #2b81af; 229 | background-color: #D2E0E6; 230 | 231 | border-bottom: 1px solid white; 232 | } 233 | #qunit-testresult .module-name { 234 | font-weight: bold; 235 | } 236 | 237 | /** Fixture */ 238 | 239 | #qunit-fixture { 240 | position: absolute; 241 | top: -10000px; 242 | left: -10000px; 243 | width: 1000px; 244 | height: 1000px; 245 | } 246 | -------------------------------------------------------------------------------- /smilecounter/settings.py: -------------------------------------------------------------------------------- 1 | # Django settings for smilecounter project. 2 | 3 | DEBUG = False 4 | TEMPLATE_DEBUG = DEBUG 5 | 6 | ADMINS = ( 7 | ('Josh Haimson', 'jdhaimson@gmail.com'), 8 | ) 9 | 10 | MANAGERS = ADMINS 11 | 12 | DATABASES = { 13 | 'default': { 14 | 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 15 | 'NAME': '', # Or path to database file if using sqlite3. 16 | # The following settings are not used with sqlite3: 17 | 'USER': '', 18 | 'PASSWORD': '', 19 | 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. 20 | 'PORT': '', # Set to empty string for default. 21 | } 22 | } 23 | 24 | # Hosts/domain names that are valid for this site; required if DEBUG is False 25 | # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts 26 | ALLOWED_HOSTS = ['localhost'] 27 | 28 | # Local time zone for this installation. Choices can be found here: 29 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 30 | # although not all choices may be available on all operating systems. 31 | # In a Windows environment this must be set to your system time zone. 32 | TIME_ZONE = 'America/New_York' 33 | 34 | # Language code for this installation. All choices can be found here: 35 | # http://www.i18nguy.com/unicode/language-identifiers.html 36 | LANGUAGE_CODE = 'en-us' 37 | 38 | SITE_ID = 1 39 | 40 | # If you set this to False, Django will make some optimizations so as not 41 | # to load the internationalization machinery. 42 | USE_I18N = True 43 | 44 | # If you set this to False, Django will not format dates, numbers and 45 | # calendars according to the current locale. 46 | USE_L10N = True 47 | 48 | # If you set this to False, Django will not use timezone-aware datetimes. 49 | USE_TZ = True 50 | 51 | # Absolute filesystem path to the directory that will hold user-uploaded files. 52 | # Example: "/var/www/example.com/media/" 53 | MEDIA_ROOT = '' 54 | 55 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a 56 | # trailing slash. 57 | # Examples: "http://example.com/media/", "http://media.example.com/" 58 | MEDIA_URL = '' 59 | 60 | # Absolute path to the directory static files should be collected to. 61 | # Don't put anything in this directory yourself; store your static files 62 | # in apps' "static/" subdirectories and in STATICFILES_DIRS. 63 | # Example: "/var/www/example.com/static/" 64 | STATIC_ROOT = '' 65 | 66 | # URL prefix for static files. 67 | # Example: "http://example.com/static/", "http://static.example.com/" 68 | STATIC_URL = '/static/' 69 | 70 | # Additional locations of static files 71 | STATICFILES_DIRS = ( 72 | # Put strings here, like "/home/html/static" or "C:/www/django/static". 73 | # Always use forward slashes, even on Windows. 74 | # Don't forget to use absolute paths, not relative paths. 75 | ) 76 | 77 | # List of finder classes that know how to find static files in 78 | # various locations. 79 | STATICFILES_FINDERS = ( 80 | 'django.contrib.staticfiles.finders.FileSystemFinder', 81 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 82 | # 'django.contrib.staticfiles.finders.DefaultStorageFinder', 83 | ) 84 | 85 | # Make this unique, and don't share it with anybody. 86 | SECRET_KEY = '$3^tju9b4clit-1&r9&llt_@e%qj6u3s@9co@so51ja!z=ce0-' 87 | 88 | # List of callables that know how to import templates from various sources. 89 | TEMPLATE_LOADERS = ( 90 | 'django.template.loaders.filesystem.Loader', 91 | 'django.template.loaders.app_directories.Loader', 92 | # 'django.template.loaders.eggs.Loader', 93 | ) 94 | 95 | MIDDLEWARE_CLASSES = ( 96 | 'django.middleware.common.CommonMiddleware', 97 | 'django.contrib.sessions.middleware.SessionMiddleware', 98 | 'django.middleware.csrf.CsrfViewMiddleware', 99 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 100 | 'django.contrib.messages.middleware.MessageMiddleware', 101 | # Uncomment the next line for simple clickjacking protection: 102 | # 'django.middleware.clickjacking.XFrameOptionsMiddleware', 103 | ) 104 | 105 | ROOT_URLCONF = 'smilecounter.urls' 106 | 107 | # Python dotted path to the WSGI application used by Django's runserver. 108 | WSGI_APPLICATION = 'smilecounter.wsgi.application' 109 | 110 | TEMPLATE_DIRS = ( 111 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". 112 | # Always use forward slashes, even on Windows. 113 | # Don't forget to use absolute paths, not relative paths. 114 | ) 115 | 116 | INSTALLED_APPS = ( 117 | 'django.contrib.auth', 118 | 'django.contrib.contenttypes', 119 | 'django.contrib.sessions', 120 | 'django.contrib.sites', 121 | 'django.contrib.messages', 122 | 'django.contrib.staticfiles', 123 | 'smilecounter', 124 | 'south', 125 | # Uncomment the next line to enable the admin: 126 | # 'django.contrib.admin', 127 | # Uncomment the next line to enable admin documentation: 128 | # 'django.contrib.admindocs', 129 | ) 130 | 131 | # A sample logging configuration. The only tangible logging 132 | # performed by this configuration is to send an email to 133 | # the site admins on every HTTP 500 error when DEBUG=False. 134 | # See http://docs.djangoproject.com/en/dev/topics/logging for 135 | # more details on how to customize your logging configuration. 136 | LOGGING = { 137 | 'version': 1, 138 | 'disable_existing_loggers': False, 139 | 'filters': { 140 | 'require_debug_false': { 141 | '()': 'django.utils.log.RequireDebugFalse' 142 | } 143 | }, 144 | 'handlers': { 145 | 'mail_admins': { 146 | 'level': 'ERROR', 147 | 'filters': ['require_debug_false'], 148 | 'class': 'django.utils.log.AdminEmailHandler' 149 | } 150 | }, 151 | 'loggers': { 152 | 'django.request': { 153 | 'handlers': ['mail_admins'], 154 | 'level': 'ERROR', 155 | 'propagate': True, 156 | }, 157 | } 158 | } 159 | 160 | # Heroku deployment code 161 | # Parse database configuration from $DATABASE_URL 162 | import dj_database_url 163 | DATABASES['default'] = dj_database_url.config() 164 | 165 | # Honor the 'X-Forwarded-Proto' header for request.is_secure() 166 | SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') 167 | 168 | # Allow all host headers 169 | ALLOWED_HOSTS = ['*'] 170 | 171 | # Static asset configuration 172 | import os 173 | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) 174 | STATIC_ROOT = 'staticfiles' 175 | STATIC_URL = '/static/' 176 | 177 | STATICFILES_DIRS = ( 178 | os.path.join(BASE_DIR, 'static'), 179 | ) 180 | 181 | # If local dev machine, check for local settings 182 | if bool(os.environ.get('LOCAL_DEV', False)): 183 | try: 184 | execfile('smilecounter/local_settings.py') 185 | except: 186 | print "File local_settings.py not found" 187 | -------------------------------------------------------------------------------- /smilecounter/static/css/bootstrap-responsive.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.3.2 3 | * 4 | * Copyright 2013 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world by @mdo and @fat. 9 | */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@-ms-viewport{width:device-width}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:inherit!important}.hidden-print{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .nav>li>a:focus,.nav-collapse .dropdown-menu a:hover,.nav-collapse .dropdown-menu a:focus{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .nav>li>a:focus,.navbar-inverse .nav-collapse .dropdown-menu a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:focus{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} 10 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /smilecounter/static/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap.js by @fat & @mdo 3 | * Copyright 2013 Twitter, Inc. 4 | * http://www.apache.org/licenses/LICENSE-2.0.txt 5 | */ 6 | !function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(".dropdown-backdrop").remove(),e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||("ontouchstart"in document.documentElement&&e('