├── .gitignore ├── LICENSE.txt ├── Procfile ├── README.md ├── engine ├── __init__.py ├── admin.py ├── apps.py ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ └── fetchsongs.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_auto_20160621_1617.py │ ├── 0003_auto_20160621_1620.py │ └── __init__.py ├── models.py ├── tests.py ├── urls.py └── views.py ├── manage.py ├── playlister ├── __init__.py ├── settings.py ├── static │ ├── css │ │ ├── index.css │ │ ├── jquery-ui.css │ │ ├── plot.css │ │ └── sift.css │ └── js │ │ ├── index.js │ │ ├── jquery-ui.min.js │ │ ├── jquery.js │ │ ├── npm.js │ │ ├── plot.js │ │ └── sift.js ├── templates │ ├── index.html │ ├── plot.html │ └── sift.html ├── urls.py └── wsgi.py ├── requirements.txt └── spot ├── __init__.py ├── analysis.py ├── keys.py ├── migrations └── __init__.py ├── pl.py └── pltest.py /.gitignore: -------------------------------------------------------------------------------- 1 | venv 2 | *.pyc 3 | .env 4 | .cache* 5 | .cache 6 | test.py 7 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Ryan Finley 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn playlister.wsgi --log-file - 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Plot your Music 2 | - Webapp that helps visualize a user's public playlists on spotify 3 | - You can compare song features or just plot the playlist sorted 4 | - PCA and t-SNE plots available to attempt to group similar songs 5 | 6 | ## Filter your Music 7 | - Refine your playlists by limiting features. 8 | - Sort the playlist based on features or similarity to other songs. 9 | 10 | ##### Features ([*source*](https://developer.spotify.com/web-api/get-audio-features/)) 11 | - **acousticness**: A confidence measure from 0 to 100 of whether the track is acoustic. 100 represents high confidence the track is acoustic. 12 | - **danceability**: Describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0 is least danceable and 100 is most danceable. 13 | - **energy**: Energy is a measure from 0 to 100 and represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute include dynamic range, perceived loudness, timbre, onset rate, and general entropy. 14 | - **instrumentalness**: Predicts whether a track contains no vocals. "Ooh" and "aah" sounds are treated as instrumental in this context. Rap or spoken word tracks are clearly "vocal". The closer the instrumentalness value is to 100, the greater likelihood the track contains no vocal content. Values above 50 are intended to represent instrumental tracks, but confidence is higher as the value approaches 100. 15 | - **loudness**: The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of tracks. Loudness is the quality of a sound that is the primary psychological correlate of physical strength (amplitude). Values typical range between -60 and 0 db. 16 | - **speechiness**: Detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 100 the attribute value. Values above 66 describe tracks that are probably made entirely of spoken words. Values between 33 and 66 describe tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 33 most likely represent music and other non-speech-like tracks. 17 | - **tempo**: The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration. 18 | - **valence**: A measure from 0 to 100 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while tracks with low valence sound more negative (e.g. sad, depressed, angry). 19 | - **popularity**: The value will be between 0 and 100, with 100 being the most popular. The popularity is calculated from the popularity of the song on spotify. 20 | - **duration**: Length of the track in seconds. 21 | - **sort**: Only available on x, sorts whatever y-values are selected in ascending order. 22 | 23 | #### Other Features 24 | - **PCA**: Principle Component Analysis - A dimension reduction algorithm which attempts to better group together similar songs. 25 | - **tSNE**: t-Distributed Stochastic Neighbor Embedding - A machine learning dimension reduction algorithm, similar to PCA and may provide superior grouping. 26 | -------------------------------------------------------------------------------- /engine/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafin/Spotify-Visualizations/f23bf128d9b7fe93bd64064afaff90f03d4d1f34/engine/__init__.py -------------------------------------------------------------------------------- /engine/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | import models 4 | 5 | # Register your models here. 6 | admin.site.register(models.Playlist) 7 | admin.site.register(models.Song) -------------------------------------------------------------------------------- /engine/apps.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from django.apps import AppConfig 4 | 5 | 6 | class EngineConfig(AppConfig): 7 | name = 'engine' 8 | -------------------------------------------------------------------------------- /engine/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafin/Spotify-Visualizations/f23bf128d9b7fe93bd64064afaff90f03d4d1f34/engine/management/__init__.py -------------------------------------------------------------------------------- /engine/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafin/Spotify-Visualizations/f23bf128d9b7fe93bd64064afaff90f03d4d1f34/engine/management/commands/__init__.py -------------------------------------------------------------------------------- /engine/management/commands/fetchsongs.py: -------------------------------------------------------------------------------- 1 | from django.core.management.base import BaseCommand 2 | from spot.pl import store_db 3 | 4 | class Command(BaseCommand): 5 | help = "Stores songs and playlist specified by first argument into database" 6 | 7 | def add_arguments(self, parser): 8 | parser.add_argument('playlist',nargs='+', type=str) 9 | 10 | def handle(self, *args, **options): 11 | playlist = ' '.join(options['playlist']) 12 | store_db(playlist) 13 | -------------------------------------------------------------------------------- /engine/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.6 on 2016-06-21 18:13 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='Playlist', 18 | fields=[ 19 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 20 | ('title', models.CharField(default='', max_length=100)), 21 | ('pid', models.CharField(default='', max_length=40)), 22 | ], 23 | options={ 24 | 'ordering': ('title',), 25 | }, 26 | ), 27 | migrations.CreateModel( 28 | name='Song', 29 | fields=[ 30 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 31 | ('sid', models.CharField(default='', max_length=40)), 32 | ('title', models.CharField(default='', max_length=100)), 33 | ('artist', models.CharField(default='', max_length=100)), 34 | ('danceability', models.DecimalField(decimal_places=1, max_digits=4)), 35 | ('energy', models.DecimalField(decimal_places=1, max_digits=4)), 36 | ('key', models.DecimalField(decimal_places=0, max_digits=2)), 37 | ('loudness', models.DecimalField(decimal_places=3, max_digits=6)), 38 | ('mode', models.DecimalField(decimal_places=0, max_digits=1)), 39 | ('speechiness', models.DecimalField(decimal_places=3, max_digits=6)), 40 | ('acousticness', models.DecimalField(decimal_places=4, max_digits=7)), 41 | ('instrumentalness', models.DecimalField(decimal_places=4, max_digits=7)), 42 | ('valence', models.DecimalField(decimal_places=3, max_digits=6)), 43 | ('tempo', models.DecimalField(decimal_places=3, max_digits=6)), 44 | ('duration', models.DecimalField(decimal_places=0, max_digits=6)), 45 | ('popularity', models.DecimalField(decimal_places=0, max_digits=3)), 46 | ('preview_url', models.CharField(default='', max_length=120)), 47 | ('cover_url', models.CharField(default='', max_length=120)), 48 | ('release_date', models.DateField()), 49 | ], 50 | options={ 51 | 'ordering': ('title',), 52 | }, 53 | ), 54 | migrations.AddField( 55 | model_name='playlist', 56 | name='songs', 57 | field=models.ManyToManyField(to='engine.Song'), 58 | ), 59 | ] 60 | -------------------------------------------------------------------------------- /engine/migrations/0002_auto_20160621_1617.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.6 on 2016-06-21 21:17 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('engine', '0001_initial'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='song', 17 | name='acousticness', 18 | field=models.DecimalField(decimal_places=1, max_digits=4), 19 | ), 20 | migrations.AlterField( 21 | model_name='song', 22 | name='instrumentalness', 23 | field=models.DecimalField(decimal_places=1, max_digits=4), 24 | ), 25 | migrations.AlterField( 26 | model_name='song', 27 | name='loudness', 28 | field=models.DecimalField(decimal_places=1, max_digits=4), 29 | ), 30 | migrations.AlterField( 31 | model_name='song', 32 | name='speechiness', 33 | field=models.DecimalField(decimal_places=1, max_digits=4), 34 | ), 35 | migrations.AlterField( 36 | model_name='song', 37 | name='tempo', 38 | field=models.DecimalField(decimal_places=1, max_digits=4), 39 | ), 40 | migrations.AlterField( 41 | model_name='song', 42 | name='valence', 43 | field=models.DecimalField(decimal_places=1, max_digits=4), 44 | ), 45 | ] 46 | -------------------------------------------------------------------------------- /engine/migrations/0003_auto_20160621_1620.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.6 on 2016-06-21 21:20 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('engine', '0002_auto_20160621_1617'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='song', 17 | name='tempo', 18 | field=models.DecimalField(decimal_places=0, max_digits=4), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /engine/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafin/Spotify-Visualizations/f23bf128d9b7fe93bd64064afaff90f03d4d1f34/engine/migrations/__init__.py -------------------------------------------------------------------------------- /engine/models.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from django.db import models 4 | 5 | class Song(models.Model): 6 | sid = models.CharField(default='', max_length = 40) 7 | title = models.CharField(default='', max_length = 100) 8 | artist = models.CharField(default='', max_length = 100) 9 | danceability = models.DecimalField(max_digits=4, decimal_places=1) 10 | energy = models.DecimalField(max_digits=4, decimal_places=1) 11 | key = models.DecimalField(max_digits=2, decimal_places=0) 12 | loudness = models.DecimalField(max_digits=4, decimal_places=1) 13 | mode = models.DecimalField(max_digits=1, decimal_places=0) 14 | speechiness = models.DecimalField(max_digits=4, decimal_places=1) 15 | acousticness = models.DecimalField(max_digits=4, decimal_places=1) 16 | instrumentalness = models.DecimalField(max_digits=4, decimal_places=1) 17 | valence = models.DecimalField(max_digits=4, decimal_places=1) 18 | tempo = models.DecimalField(max_digits=4, decimal_places=0) 19 | duration = models.DecimalField(max_digits=6, decimal_places=0) 20 | popularity = models.DecimalField(max_digits=3, decimal_places=0) 21 | # new features 22 | preview_url = models.CharField(default='', max_length = 120) 23 | cover_url = models.CharField(default='', max_length = 120) 24 | # new album features 25 | release_date = models.DateField() 26 | 27 | 28 | def __unicode__(self): 29 | return "{} - {}".format(self.title, self.artist) 30 | 31 | class Meta: 32 | ordering = ('title',) 33 | 34 | class Playlist(models.Model): 35 | songs = models.ManyToManyField(Song) 36 | title = models.CharField(default='', max_length = 100) 37 | pid = models.CharField(default='', max_length = 40) 38 | 39 | def __unicode__(self): 40 | return self.title 41 | 42 | class Meta: 43 | ordering = ('title',) -------------------------------------------------------------------------------- /engine/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /engine/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url 2 | 3 | from . import views 4 | 5 | urlpatterns = [ 6 | url(r'^$', views.index, name='index'), 7 | url(r'^sift/(?P[-\w]+)/(?P[-\w]+)$', views.sift, name='sift'), 8 | url(r'^plot/(?P[-\w]+)/(?P[-\w]+)$', views.plot, name='plot'), 9 | url(r'^getsongs/$', views.getsongs, name='getsongs'), 10 | url(r'^getplaylists/$', views.getplaylists, name='getplaylists'), 11 | url(r'^newplaylist/$', views.newplaylist, name='newplaylist'), 12 | url(r'^authorize_plot/$', views.authorize_plot, name='authorize_plot'), 13 | url(r'^authorize_sift/$', views.authorize_sift, name='authorize_sift') 14 | ] -------------------------------------------------------------------------------- /engine/views.py: -------------------------------------------------------------------------------- 1 | from django.http import JsonResponse, HttpResponseRedirect 2 | from django.shortcuts import render_to_response 3 | from django.core.urlresolvers import reverse 4 | 5 | from urllib import unquote 6 | 7 | #spotify tools 8 | from spot import pl 9 | from spot import keys 10 | 11 | import json 12 | from json import loads as dict #converts json back to dictionary 13 | 14 | #generate serializer for retrieving db data 15 | from django.core import serializers 16 | json_serializer = serializers.get_serializer("json")() 17 | 18 | import models 19 | 20 | from django.views.decorators.csrf import ensure_csrf_cookie 21 | @ensure_csrf_cookie 22 | 23 | def index(request): 24 | s_auth_url = keys.auth_url(1) 25 | p_auth_url = keys.auth_url(0) 26 | return render_to_response('index.html', {'p_auth_url': p_auth_url, 's_auth_url': s_auth_url}) 27 | 28 | def plot(request, token, username): 29 | return render_to_response('plot.html', {'token': token, 'name': username}) 30 | 31 | def sift(request, token, username): 32 | return render_to_response('sift.html', {'token': token, 'name': username}) 33 | 34 | def getsongs(request): 35 | '''returns json response of given playlist title''' 36 | username = request.GET.get('username', '') 37 | title = unquote(request.GET.get('title', '')) 38 | token = request.GET.get('token','') 39 | #if title is a list of titles instead of just 1 40 | if '~[' in title: 41 | titles = title.split('~[') 42 | songs = [] 43 | for title in titles: 44 | songs += pl.pl_data(title, username, token)['songs'] 45 | songs = {"songs":songs} 46 | else: 47 | songs = pl.pl_data(title, username, token) 48 | #json_songs = json_serializer.serialize(songs, ensure_ascii=True) 49 | return JsonResponse(songs, safe=False ) 50 | 51 | def getplaylists(request): 52 | '''returns json response of given playlist title''' 53 | #playlists = models.Playlist.objects.all() 54 | username = request.GET.get('username', '') 55 | token = request.GET.get('token', '') 56 | playlists = pl.get_playlists(username, token) 57 | #json_playlists = json_serializer.serialize(playlists, ensure_ascii=True) 58 | return JsonResponse(playlists, safe=False) 59 | 60 | def newplaylist(request): 61 | 62 | if request.is_ajax(): 63 | if request.method == 'POST': 64 | title = request.POST.get("title","") 65 | songs = request.POST.get("songs","") 66 | songs = songs[1:-1] 67 | songs = songs.replace('"', '') 68 | #reauthorize and get username 69 | token = request.POST.get("token","") 70 | sp = keys.get_access(token) 71 | username = sp.current_user()['id'] 72 | pl.new_playlist(title, songs) 73 | return JsonResponse({"success":"yes"}) 74 | 75 | def authorize_plot(request): 76 | code = request.GET.get('code', '') 77 | token = keys.get_token(code, 0) 78 | #get username 79 | sp = keys.get_access(token) 80 | username = sp.current_user()['id'] 81 | 82 | url = reverse('plot', args=(), kwargs={'token': token, 'username': username}) 83 | return HttpResponseRedirect(url) 84 | 85 | def authorize_sift(request): 86 | code = request.GET.get('code', '') 87 | token = keys.get_token(code, 1) 88 | #get username 89 | sp = keys.get_access(token) 90 | username = sp.current_user()['id'] 91 | 92 | url = reverse('sift', args=(), kwargs={'token': token, 'username': username}) 93 | return HttpResponseRedirect(url) 94 | -------------------------------------------------------------------------------- /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", "playlister.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /playlister/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafin/Spotify-Visualizations/f23bf128d9b7fe93bd64064afaff90f03d4d1f34/playlister/__init__.py -------------------------------------------------------------------------------- /playlister/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for playlister project. 3 | 4 | Generated by 'django-admin startproject' using Django 1.9.2. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.9/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/1.9/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'a+0*=3pw@apu)n7y5@@067th0(sj-dfy!(dvlvu-1yc8ubx-y1' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = ['*'] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'playlister', 41 | 'spot', 42 | 'engine' 43 | ] 44 | 45 | MIDDLEWARE_CLASSES = [ 46 | 'django.middleware.security.SecurityMiddleware', 47 | 'django.contrib.sessions.middleware.SessionMiddleware', 48 | 'django.middleware.common.CommonMiddleware', 49 | 'django.middleware.csrf.CsrfViewMiddleware', 50 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 51 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 52 | 'django.contrib.messages.middleware.MessageMiddleware', 53 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 54 | ] 55 | 56 | ROOT_URLCONF = 'playlister.urls' 57 | 58 | TEMPLATES = [ 59 | { 60 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 61 | 'DIRS': [], 62 | 'APP_DIRS': True, 63 | 'OPTIONS': { 64 | 'context_processors': [ 65 | 'django.template.context_processors.debug', 66 | 'django.template.context_processors.request', 67 | 'django.contrib.auth.context_processors.auth', 68 | 'django.contrib.messages.context_processors.messages', 69 | 'django.core.context_processors.request', 70 | ], 71 | }, 72 | }, 73 | ] 74 | 75 | WSGI_APPLICATION = 'playlister.wsgi.application' 76 | 77 | 78 | # Database 79 | # https://docs.djangoproject.com/en/1.9/ref/settings/#databases 80 | 81 | DATABASES = { 82 | 'default': { 83 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', 84 | 'NAME': 'playlister', 85 | 'USER': 'rafin', 86 | 'PASSWORD': 'password', 87 | 'HOST': 'localhost', 88 | 'PORT': '', 89 | } 90 | } 91 | 92 | 93 | # Password validation 94 | # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators 95 | 96 | AUTH_PASSWORD_VALIDATORS = [ 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 102 | }, 103 | { 104 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 105 | }, 106 | { 107 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 108 | }, 109 | ] 110 | 111 | 112 | # Internationalization 113 | # https://docs.djangoproject.com/en/1.9/topics/i18n/ 114 | 115 | LANGUAGE_CODE = 'en-us' 116 | 117 | TIME_ZONE = 'America/Chicago' 118 | 119 | USE_I18N = True 120 | 121 | USE_L10N = True 122 | 123 | USE_TZ = True 124 | 125 | 126 | # Static files (CSS, JavaScript, Images) 127 | # https://docs.djangoproject.com/en/1.9/howto/static-files/ 128 | PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) 129 | 130 | STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles') 131 | STATIC_URL = '/static/' 132 | 133 | STATICFILES_DIRS = ( 134 | os.path.join(PROJECT_ROOT, 'static'), 135 | ) 136 | STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' 137 | 138 | #Update databse configuration with $DATABASE_URL 139 | import dj_database_url 140 | db_from_env = dj_database_url.config(conn_max_age=500) 141 | DATABASES['default'].update(db_from_env) 142 | 143 | 144 | -------------------------------------------------------------------------------- /playlister/static/css/index.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --accent-color: #2A2D34; 3 | --bg-color: #FFF; 4 | --red: #DE3633; 5 | --blue: #57D2AD; 6 | } 7 | 8 | html { 9 | height: 100%; 10 | } 11 | body { 12 | font-family: "Roboto", "Helvetica Neue", sans-serif; 13 | margin: 0px; 14 | padding: 0px; 15 | height: 100%; 16 | background-color: var(--bg-color); 17 | position: relati 18 | height: 100%; 19 | } 20 | 21 | #title { 22 | background-color: var(--bg-color); 23 | color: var(--accent-color); 24 | padding: 8px 0px; 25 | font-weight: bold; 26 | font-size: 30px; 27 | text-align: center; 28 | /*border-bottom: 5px solid #DB5461;*/ 29 | border-radius: 0px 0px 5px 5px; 30 | } 31 | 32 | .button { 33 | -webkit-transition-duration: 0.1s; /* Safari */ 34 | transition-duration: 0.1s; 35 | display: block; 36 | text-align: center; 37 | padding: 4px 8px; 38 | text-decoration: none; 39 | font-size: 20px; 40 | margin: auto; 41 | margin-top: 40px; 42 | width: 200px; 43 | border-bottom: 3px solid #3C4C75; 44 | color: var(--accent-color); 45 | border-color: var(--blue); 46 | } 47 | 48 | .button:hover { 49 | border-color: var(--bg-color); 50 | } 51 | 52 | p { 53 | text-align: center; 54 | color: var(--accent-color); 55 | margin: auto; 56 | margin-top: 10px; 57 | max-width: 200px; 58 | font-size: 14px; 59 | } 60 | 61 | /* Footer */ 62 | 63 | #footerholder { 64 | font-size: 14px; 65 | background: none repeat scroll 0 0 transparent; 66 | bottom: 5px; 67 | position: fixed; 68 | text-align: center; 69 | width: 100%; 70 | } 71 | 72 | #footer { 73 | max-height: 100%; 74 | max-width: 500px; 75 | } 76 | 77 | #github_link { 78 | text-decoration: none; 79 | color: #000; 80 | } 81 | 82 | #github_link:hover { 83 | color: #7C6BD3; 84 | cursor: pointer; 85 | } 86 | -------------------------------------------------------------------------------- /playlister/static/css/jquery-ui.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.12.0 - 2016-07-08 2 | * http://jqueryui.com 3 | * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css 4 | * Copyright jQuery Foundation and other contributors; Licensed MIT */ 5 | /* Layout helpers 6 | ----------------------------------*/ 7 | .ui-helper-hidden { 8 | display: none; 9 | } 10 | .ui-helper-hidden-accessible { 11 | border: 0; 12 | clip: rect(0 0 0 0); 13 | height: 1px; 14 | margin: -1px; 15 | overflow: hidden; 16 | padding: 0; 17 | position: absolute; 18 | width: 1px; 19 | } 20 | .ui-helper-reset { 21 | margin: 0; 22 | padding: 0; 23 | border: 0; 24 | outline: 0; 25 | line-height: 1.3; 26 | text-decoration: none; 27 | font-size: 100%; 28 | list-style: none; 29 | } 30 | .ui-helper-clearfix:before, 31 | .ui-helper-clearfix:after { 32 | content: ""; 33 | display: table; 34 | border-collapse: collapse; 35 | } 36 | .ui-helper-clearfix:after { 37 | clear: both; 38 | } 39 | .ui-helper-zfix { 40 | width: 100%; 41 | height: 100%; 42 | top: 0; 43 | left: 0; 44 | position: absolute; 45 | opacity: 0; 46 | filter:Alpha(Opacity=0); /* support: IE8 */ 47 | } 48 | 49 | .ui-front { 50 | z-index: 100; 51 | } 52 | 53 | 54 | /* Interaction Cues 55 | ----------------------------------*/ 56 | .ui-state-disabled { 57 | cursor: default !important; 58 | pointer-events: none; 59 | } 60 | 61 | 62 | /* Icons 63 | ----------------------------------*/ 64 | .ui-icon { 65 | display: inline-block; 66 | vertical-align: middle; 67 | margin-top: -.25em; 68 | position: relative; 69 | text-indent: -99999px; 70 | overflow: hidden; 71 | background-repeat: no-repeat; 72 | } 73 | 74 | .ui-widget-icon-block { 75 | left: 50%; 76 | margin-left: -8px; 77 | display: block; 78 | } 79 | 80 | /* Misc visuals 81 | ----------------------------------*/ 82 | 83 | /* Overlays */ 84 | .ui-widget-overlay { 85 | position: fixed; 86 | top: 0; 87 | left: 0; 88 | width: 100%; 89 | height: 100%; 90 | } 91 | .ui-accordion .ui-accordion-header { 92 | display: block; 93 | cursor: pointer; 94 | position: relative; 95 | margin: 2px 0 0 0; 96 | padding: .5em .5em .5em .7em; 97 | font-size: 100%; 98 | } 99 | .ui-accordion .ui-accordion-content { 100 | padding: 1em 2.2em; 101 | border-top: 0; 102 | overflow: auto; 103 | } 104 | .ui-autocomplete { 105 | position: absolute; 106 | top: 0; 107 | left: 0; 108 | cursor: default; 109 | } 110 | .ui-menu { 111 | list-style: none; 112 | padding: 0; 113 | margin: 0; 114 | display: block; 115 | outline: 0; 116 | } 117 | .ui-menu .ui-menu { 118 | position: absolute; 119 | } 120 | .ui-menu .ui-menu-item { 121 | margin: 0; 122 | cursor: pointer; 123 | /* support: IE10, see #8844 */ 124 | list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); 125 | } 126 | .ui-menu .ui-menu-item-wrapper { 127 | position: relative; 128 | padding: 3px 1em 3px .4em; 129 | } 130 | .ui-menu .ui-menu-divider { 131 | margin: 5px 0; 132 | height: 0; 133 | font-size: 0; 134 | line-height: 0; 135 | border-width: 1px 0 0 0; 136 | } 137 | .ui-menu .ui-state-focus, 138 | .ui-menu .ui-state-active { 139 | margin: -1px; 140 | } 141 | 142 | /* icon support */ 143 | .ui-menu-icons { 144 | position: relative; 145 | } 146 | .ui-menu-icons .ui-menu-item-wrapper { 147 | padding-left: 2em; 148 | } 149 | 150 | /* left-aligned */ 151 | .ui-menu .ui-icon { 152 | position: absolute; 153 | top: 0; 154 | bottom: 0; 155 | left: .2em; 156 | margin: auto 0; 157 | } 158 | 159 | /* right-aligned */ 160 | .ui-menu .ui-menu-icon { 161 | left: auto; 162 | right: 0; 163 | } 164 | .ui-button { 165 | padding: .4em 1em; 166 | display: inline-block; 167 | position: relative; 168 | line-height: normal; 169 | margin-right: .1em; 170 | cursor: pointer; 171 | vertical-align: middle; 172 | text-align: center; 173 | -webkit-user-select: none; 174 | -moz-user-select: none; 175 | -ms-user-select: none; 176 | user-select: none; 177 | 178 | /* Support: IE <= 11 */ 179 | overflow: visible; 180 | } 181 | 182 | .ui-button, 183 | .ui-button:link, 184 | .ui-button:visited, 185 | .ui-button:hover, 186 | .ui-button:active { 187 | text-decoration: none; 188 | } 189 | 190 | /* to make room for the icon, a width needs to be set here */ 191 | .ui-button-icon-only { 192 | width: 2em; 193 | box-sizing: border-box; 194 | text-indent: -9999px; 195 | white-space: nowrap; 196 | } 197 | 198 | /* no icon support for input elements */ 199 | input.ui-button.ui-button-icon-only { 200 | text-indent: 0; 201 | } 202 | 203 | /* button icon element(s) */ 204 | .ui-button-icon-only .ui-icon { 205 | position: absolute; 206 | top: 50%; 207 | left: 50%; 208 | margin-top: -8px; 209 | margin-left: -8px; 210 | } 211 | 212 | .ui-button.ui-icon-notext .ui-icon { 213 | padding: 0; 214 | width: 2.1em; 215 | height: 2.1em; 216 | text-indent: -9999px; 217 | white-space: nowrap; 218 | 219 | } 220 | 221 | input.ui-button.ui-icon-notext .ui-icon { 222 | width: auto; 223 | height: auto; 224 | text-indent: 0; 225 | white-space: normal; 226 | padding: .4em 1em; 227 | } 228 | 229 | /* workarounds */ 230 | /* Support: Firefox 5 - 40 */ 231 | input.ui-button::-moz-focus-inner, 232 | button.ui-button::-moz-focus-inner { 233 | border: 0; 234 | padding: 0; 235 | } 236 | .ui-controlgroup { 237 | vertical-align: middle; 238 | display: inline-block; 239 | } 240 | .ui-controlgroup > .ui-controlgroup-item { 241 | float: left; 242 | margin-left: 0; 243 | margin-right: 0; 244 | } 245 | .ui-controlgroup > .ui-controlgroup-item:focus, 246 | .ui-controlgroup > .ui-controlgroup-item.ui-visual-focus { 247 | z-index: 9999; 248 | } 249 | .ui-controlgroup-vertical > .ui-controlgroup-item { 250 | display: block; 251 | float: none; 252 | width: 100%; 253 | margin-top: 0; 254 | margin-bottom: 0; 255 | text-align: left; 256 | } 257 | .ui-controlgroup-vertical .ui-controlgroup-item { 258 | box-sizing: border-box; 259 | } 260 | .ui-controlgroup .ui-controlgroup-label { 261 | padding: .4em 1em; 262 | } 263 | .ui-controlgroup .ui-controlgroup-label span { 264 | font-size: 80%; 265 | } 266 | .ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item { 267 | border-left: none; 268 | } 269 | .ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item { 270 | border-top: none; 271 | } 272 | .ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { 273 | border-right: none; 274 | } 275 | .ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { 276 | border-bottom: none; 277 | } 278 | 279 | /* Spinner specific style fixes */ 280 | .ui-controlgroup-vertical .ui-spinner-input { 281 | 282 | /* Support: IE8 only, Android < 4.4 only */ 283 | width: 75%; 284 | width: calc( 100% - 2.4em ); 285 | } 286 | .ui-controlgroup-vertical .ui-spinner .ui-spinner-up { 287 | border-top-style: solid; 288 | } 289 | 290 | .ui-checkboxradio-label .ui-icon-background { 291 | box-shadow: inset 1px 1px 1px #ccc; 292 | border-radius: .12em; 293 | border: none; 294 | } 295 | .ui-checkboxradio-radio-label .ui-icon-background { 296 | width: 16px; 297 | height: 16px; 298 | border-radius: 1em; 299 | overflow: visible; 300 | border: none; 301 | } 302 | .ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, 303 | .ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { 304 | background-image: none; 305 | width: 8px; 306 | height: 8px; 307 | border-width: 4px; 308 | border-style: solid; 309 | } 310 | .ui-checkboxradio-disabled { 311 | pointer-events: none; 312 | } 313 | .ui-datepicker { 314 | width: 17em; 315 | padding: .2em .2em 0; 316 | display: none; 317 | } 318 | .ui-datepicker .ui-datepicker-header { 319 | position: relative; 320 | padding: .2em 0; 321 | } 322 | .ui-datepicker .ui-datepicker-prev, 323 | .ui-datepicker .ui-datepicker-next { 324 | position: absolute; 325 | top: 2px; 326 | width: 1.8em; 327 | height: 1.8em; 328 | } 329 | .ui-datepicker .ui-datepicker-prev-hover, 330 | .ui-datepicker .ui-datepicker-next-hover { 331 | top: 1px; 332 | } 333 | .ui-datepicker .ui-datepicker-prev { 334 | left: 2px; 335 | } 336 | .ui-datepicker .ui-datepicker-next { 337 | right: 2px; 338 | } 339 | .ui-datepicker .ui-datepicker-prev-hover { 340 | left: 1px; 341 | } 342 | .ui-datepicker .ui-datepicker-next-hover { 343 | right: 1px; 344 | } 345 | .ui-datepicker .ui-datepicker-prev span, 346 | .ui-datepicker .ui-datepicker-next span { 347 | display: block; 348 | position: absolute; 349 | left: 50%; 350 | margin-left: -8px; 351 | top: 50%; 352 | margin-top: -8px; 353 | } 354 | .ui-datepicker .ui-datepicker-title { 355 | margin: 0 2.3em; 356 | line-height: 1.8em; 357 | text-align: center; 358 | } 359 | .ui-datepicker .ui-datepicker-title select { 360 | font-size: 1em; 361 | margin: 1px 0; 362 | } 363 | .ui-datepicker select.ui-datepicker-month, 364 | .ui-datepicker select.ui-datepicker-year { 365 | width: 45%; 366 | } 367 | .ui-datepicker table { 368 | width: 100%; 369 | font-size: .9em; 370 | border-collapse: collapse; 371 | margin: 0 0 .4em; 372 | } 373 | .ui-datepicker th { 374 | padding: .7em .3em; 375 | text-align: center; 376 | font-weight: bold; 377 | border: 0; 378 | } 379 | .ui-datepicker td { 380 | border: 0; 381 | padding: 1px; 382 | } 383 | .ui-datepicker td span, 384 | .ui-datepicker td a { 385 | display: block; 386 | padding: .2em; 387 | text-align: right; 388 | text-decoration: none; 389 | } 390 | .ui-datepicker .ui-datepicker-buttonpane { 391 | background-image: none; 392 | margin: .7em 0 0 0; 393 | padding: 0 .2em; 394 | border-left: 0; 395 | border-right: 0; 396 | border-bottom: 0; 397 | } 398 | .ui-datepicker .ui-datepicker-buttonpane button { 399 | float: right; 400 | margin: .5em .2em .4em; 401 | cursor: pointer; 402 | padding: .2em .6em .3em .6em; 403 | width: auto; 404 | overflow: visible; 405 | } 406 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { 407 | float: left; 408 | } 409 | 410 | /* with multiple calendars */ 411 | .ui-datepicker.ui-datepicker-multi { 412 | width: auto; 413 | } 414 | .ui-datepicker-multi .ui-datepicker-group { 415 | float: left; 416 | } 417 | .ui-datepicker-multi .ui-datepicker-group table { 418 | width: 95%; 419 | margin: 0 auto .4em; 420 | } 421 | .ui-datepicker-multi-2 .ui-datepicker-group { 422 | width: 50%; 423 | } 424 | .ui-datepicker-multi-3 .ui-datepicker-group { 425 | width: 33.3%; 426 | } 427 | .ui-datepicker-multi-4 .ui-datepicker-group { 428 | width: 25%; 429 | } 430 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, 431 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { 432 | border-left-width: 0; 433 | } 434 | .ui-datepicker-multi .ui-datepicker-buttonpane { 435 | clear: left; 436 | } 437 | .ui-datepicker-row-break { 438 | clear: both; 439 | width: 100%; 440 | font-size: 0; 441 | } 442 | 443 | /* RTL support */ 444 | .ui-datepicker-rtl { 445 | direction: rtl; 446 | } 447 | .ui-datepicker-rtl .ui-datepicker-prev { 448 | right: 2px; 449 | left: auto; 450 | } 451 | .ui-datepicker-rtl .ui-datepicker-next { 452 | left: 2px; 453 | right: auto; 454 | } 455 | .ui-datepicker-rtl .ui-datepicker-prev:hover { 456 | right: 1px; 457 | left: auto; 458 | } 459 | .ui-datepicker-rtl .ui-datepicker-next:hover { 460 | left: 1px; 461 | right: auto; 462 | } 463 | .ui-datepicker-rtl .ui-datepicker-buttonpane { 464 | clear: right; 465 | } 466 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { 467 | float: left; 468 | } 469 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, 470 | .ui-datepicker-rtl .ui-datepicker-group { 471 | float: right; 472 | } 473 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, 474 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { 475 | border-right-width: 0; 476 | border-left-width: 1px; 477 | } 478 | 479 | /* Icons */ 480 | .ui-datepicker .ui-icon { 481 | display: block; 482 | text-indent: -99999px; 483 | overflow: hidden; 484 | background-repeat: no-repeat; 485 | left: .5em; 486 | top: .3em; 487 | } 488 | .ui-dialog { 489 | position: absolute; 490 | top: 0; 491 | left: 0; 492 | padding: .2em; 493 | outline: 0; 494 | } 495 | .ui-dialog .ui-dialog-titlebar { 496 | padding: .4em 1em; 497 | position: relative; 498 | } 499 | .ui-dialog .ui-dialog-title { 500 | float: left; 501 | margin: .1em 0; 502 | white-space: nowrap; 503 | width: 90%; 504 | overflow: hidden; 505 | text-overflow: ellipsis; 506 | } 507 | .ui-dialog .ui-dialog-titlebar-close { 508 | position: absolute; 509 | right: .3em; 510 | top: 50%; 511 | width: 20px; 512 | margin: -10px 0 0 0; 513 | padding: 1px; 514 | height: 20px; 515 | } 516 | .ui-dialog .ui-dialog-content { 517 | position: relative; 518 | border: 0; 519 | padding: .5em 1em; 520 | background: none; 521 | overflow: auto; 522 | } 523 | .ui-dialog .ui-dialog-buttonpane { 524 | text-align: left; 525 | border-width: 1px 0 0 0; 526 | background-image: none; 527 | margin-top: .5em; 528 | padding: .3em 1em .5em .4em; 529 | } 530 | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { 531 | float: right; 532 | } 533 | .ui-dialog .ui-dialog-buttonpane button { 534 | margin: .5em .4em .5em 0; 535 | cursor: pointer; 536 | } 537 | .ui-dialog .ui-resizable-n { 538 | height: 2px; 539 | top: 0; 540 | } 541 | .ui-dialog .ui-resizable-e { 542 | width: 2px; 543 | right: 0; 544 | } 545 | .ui-dialog .ui-resizable-s { 546 | height: 2px; 547 | bottom: 0; 548 | } 549 | .ui-dialog .ui-resizable-w { 550 | width: 2px; 551 | left: 0; 552 | } 553 | .ui-dialog .ui-resizable-se, 554 | .ui-dialog .ui-resizable-sw, 555 | .ui-dialog .ui-resizable-ne, 556 | .ui-dialog .ui-resizable-nw { 557 | width: 7px; 558 | height: 7px; 559 | } 560 | .ui-dialog .ui-resizable-se { 561 | right: 0; 562 | bottom: 0; 563 | } 564 | .ui-dialog .ui-resizable-sw { 565 | left: 0; 566 | bottom: 0; 567 | } 568 | .ui-dialog .ui-resizable-ne { 569 | right: 0; 570 | top: 0; 571 | } 572 | .ui-dialog .ui-resizable-nw { 573 | left: 0; 574 | top: 0; 575 | } 576 | .ui-draggable .ui-dialog-titlebar { 577 | cursor: move; 578 | } 579 | .ui-draggable-handle { 580 | -ms-touch-action: none; 581 | touch-action: none; 582 | } 583 | .ui-resizable { 584 | position: relative; 585 | } 586 | .ui-resizable-handle { 587 | position: absolute; 588 | font-size: 0.1px; 589 | display: block; 590 | -ms-touch-action: none; 591 | touch-action: none; 592 | } 593 | .ui-resizable-disabled .ui-resizable-handle, 594 | .ui-resizable-autohide .ui-resizable-handle { 595 | display: none; 596 | } 597 | .ui-resizable-n { 598 | cursor: n-resize; 599 | height: 7px; 600 | width: 100%; 601 | top: -5px; 602 | left: 0; 603 | } 604 | .ui-resizable-s { 605 | cursor: s-resize; 606 | height: 7px; 607 | width: 100%; 608 | bottom: -5px; 609 | left: 0; 610 | } 611 | .ui-resizable-e { 612 | cursor: e-resize; 613 | width: 7px; 614 | right: -5px; 615 | top: 0; 616 | height: 100%; 617 | } 618 | .ui-resizable-w { 619 | cursor: w-resize; 620 | width: 7px; 621 | left: -5px; 622 | top: 0; 623 | height: 100%; 624 | } 625 | .ui-resizable-se { 626 | cursor: se-resize; 627 | width: 12px; 628 | height: 12px; 629 | right: 1px; 630 | bottom: 1px; 631 | } 632 | .ui-resizable-sw { 633 | cursor: sw-resize; 634 | width: 9px; 635 | height: 9px; 636 | left: -5px; 637 | bottom: -5px; 638 | } 639 | .ui-resizable-nw { 640 | cursor: nw-resize; 641 | width: 9px; 642 | height: 9px; 643 | left: -5px; 644 | top: -5px; 645 | } 646 | .ui-resizable-ne { 647 | cursor: ne-resize; 648 | width: 9px; 649 | height: 9px; 650 | right: -5px; 651 | top: -5px; 652 | } 653 | .ui-progressbar { 654 | height: 2em; 655 | text-align: left; 656 | overflow: hidden; 657 | } 658 | .ui-progressbar .ui-progressbar-value { 659 | margin: -1px; 660 | height: 100%; 661 | } 662 | .ui-progressbar .ui-progressbar-overlay { 663 | background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); 664 | height: 100%; 665 | filter: alpha(opacity=25); /* support: IE8 */ 666 | opacity: 0.25; 667 | } 668 | .ui-progressbar-indeterminate .ui-progressbar-value { 669 | background-image: none; 670 | } 671 | .ui-selectable { 672 | -ms-touch-action: none; 673 | touch-action: none; 674 | } 675 | .ui-selectable-helper { 676 | position: absolute; 677 | z-index: 100; 678 | border: 1px dotted black; 679 | } 680 | .ui-selectmenu-menu { 681 | padding: 0; 682 | margin: 0; 683 | position: absolute; 684 | top: 0; 685 | left: 0; 686 | display: none; 687 | } 688 | .ui-selectmenu-menu .ui-menu { 689 | overflow: auto; 690 | overflow-x: hidden; 691 | padding-bottom: 1px; 692 | } 693 | .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { 694 | font-size: 1em; 695 | font-weight: bold; 696 | line-height: 1.5; 697 | padding: 2px 0.4em; 698 | margin: 0.5em 0 0 0; 699 | height: auto; 700 | border: 0; 701 | } 702 | .ui-selectmenu-open { 703 | display: block; 704 | } 705 | .ui-selectmenu-text { 706 | display: block; 707 | margin-right: 20px; 708 | overflow: hidden; 709 | text-overflow: ellipsis; 710 | } 711 | .ui-selectmenu-button.ui-button { 712 | text-align: left; 713 | white-space: nowrap; 714 | width: 14em; 715 | } 716 | .ui-selectmenu-icon.ui-icon { 717 | float: right; 718 | margin-top: 0; 719 | } 720 | .ui-slider { 721 | position: relative; 722 | text-align: left; 723 | } 724 | .ui-slider .ui-slider-handle { 725 | position: absolute; 726 | z-index: 2; 727 | width: 1.2em; 728 | height: 1.2em; 729 | cursor: default; 730 | -ms-touch-action: none; 731 | touch-action: none; 732 | } 733 | .ui-slider .ui-slider-range { 734 | position: absolute; 735 | z-index: 1; 736 | font-size: .7em; 737 | display: block; 738 | border: 0; 739 | background-position: 0 0; 740 | } 741 | 742 | /* support: IE8 - See #6727 */ 743 | .ui-slider.ui-state-disabled .ui-slider-handle, 744 | .ui-slider.ui-state-disabled .ui-slider-range { 745 | filter: inherit; 746 | } 747 | 748 | .ui-slider-horizontal { 749 | height: .8em; 750 | } 751 | .ui-slider-horizontal .ui-slider-handle { 752 | top: -.3em; 753 | margin-left: -.6em; 754 | } 755 | .ui-slider-horizontal .ui-slider-range { 756 | top: 0; 757 | height: 100%; 758 | } 759 | .ui-slider-horizontal .ui-slider-range-min { 760 | left: 0; 761 | } 762 | .ui-slider-horizontal .ui-slider-range-max { 763 | right: 0; 764 | } 765 | 766 | .ui-slider-vertical { 767 | width: .8em; 768 | height: 100px; 769 | } 770 | .ui-slider-vertical .ui-slider-handle { 771 | left: -.3em; 772 | margin-left: 0; 773 | margin-bottom: -.6em; 774 | } 775 | .ui-slider-vertical .ui-slider-range { 776 | left: 0; 777 | width: 100%; 778 | } 779 | .ui-slider-vertical .ui-slider-range-min { 780 | bottom: 0; 781 | } 782 | .ui-slider-vertical .ui-slider-range-max { 783 | top: 0; 784 | } 785 | .ui-sortable-handle { 786 | -ms-touch-action: none; 787 | touch-action: none; 788 | } 789 | .ui-spinner { 790 | position: relative; 791 | display: inline-block; 792 | overflow: hidden; 793 | padding: 0; 794 | vertical-align: middle; 795 | } 796 | .ui-spinner-input { 797 | border: none; 798 | background: none; 799 | color: inherit; 800 | padding: .222em 0; 801 | margin: .2em 0; 802 | vertical-align: middle; 803 | margin-left: .4em; 804 | margin-right: 2em; 805 | } 806 | .ui-spinner-button { 807 | width: 1.6em; 808 | height: 50%; 809 | font-size: .5em; 810 | padding: 0; 811 | margin: 0; 812 | text-align: center; 813 | position: absolute; 814 | cursor: default; 815 | display: block; 816 | overflow: hidden; 817 | right: 0; 818 | } 819 | /* more specificity required here to override default borders */ 820 | .ui-spinner a.ui-spinner-button { 821 | border-top-style: none; 822 | border-bottom-style: none; 823 | border-right-style: none; 824 | } 825 | .ui-spinner-up { 826 | top: 0; 827 | } 828 | .ui-spinner-down { 829 | bottom: 0; 830 | } 831 | .ui-tabs { 832 | position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ 833 | padding: .2em; 834 | } 835 | .ui-tabs .ui-tabs-nav { 836 | margin: 0; 837 | padding: .2em .2em 0; 838 | } 839 | .ui-tabs .ui-tabs-nav li { 840 | list-style: none; 841 | float: left; 842 | position: relative; 843 | top: 0; 844 | margin: 1px .2em 0 0; 845 | border-bottom-width: 0; 846 | padding: 0; 847 | white-space: nowrap; 848 | } 849 | .ui-tabs .ui-tabs-nav .ui-tabs-anchor { 850 | float: left; 851 | padding: .5em 1em; 852 | text-decoration: none; 853 | } 854 | .ui-tabs .ui-tabs-nav li.ui-tabs-active { 855 | margin-bottom: -1px; 856 | padding-bottom: 1px; 857 | } 858 | .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, 859 | .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, 860 | .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { 861 | cursor: text; 862 | } 863 | .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { 864 | cursor: pointer; 865 | } 866 | .ui-tabs .ui-tabs-panel { 867 | display: block; 868 | border-width: 0; 869 | padding: 1em 1.4em; 870 | background: none; 871 | } 872 | .ui-tooltip { 873 | padding: 8px; 874 | position: absolute; 875 | z-index: 9999; 876 | max-width: 300px; 877 | } 878 | body .ui-tooltip { 879 | border-width: 2px; 880 | } 881 | 882 | /* Component containers 883 | ----------------------------------*/ 884 | .ui-widget { 885 | font-family: Arial,Helvetica,sans-serif; 886 | font-size: 1em; 887 | } 888 | .ui-widget .ui-widget { 889 | font-size: 1em; 890 | } 891 | .ui-widget input, 892 | .ui-widget select, 893 | .ui-widget textarea, 894 | .ui-widget button { 895 | font-family: Arial,Helvetica,sans-serif; 896 | font-size: 1em; 897 | } 898 | .ui-widget.ui-widget-content { 899 | border: 1px solid #c5c5c5; 900 | } 901 | .ui-widget-content { 902 | border: 1px solid #dddddd; 903 | background: #ffffff; 904 | color: #333333; 905 | } 906 | .ui-widget-content a { 907 | color: #333333; 908 | } 909 | .ui-widget-header { 910 | border: 1px solid #dddddd; 911 | background: #e9e9e9; 912 | color: #333333; 913 | font-weight: bold; 914 | } 915 | .ui-widget-header a { 916 | color: #333333; 917 | } 918 | 919 | /* Interaction states 920 | ----------------------------------*/ 921 | .ui-state-default, 922 | .ui-widget-content .ui-state-default, 923 | .ui-widget-header .ui-state-default, 924 | .ui-button, 925 | 926 | /* We use html here because we need a greater specificity to make sure disabled 927 | works properly when clicked or hovered */ 928 | html .ui-button.ui-state-disabled:hover, 929 | html .ui-button.ui-state-disabled:active { 930 | border: 1px solid #c5c5c5; 931 | background: #f6f6f6; 932 | font-weight: normal; 933 | color: #454545; 934 | } 935 | .ui-state-default a, 936 | .ui-state-default a:link, 937 | .ui-state-default a:visited, 938 | a.ui-button, 939 | a:link.ui-button, 940 | a:visited.ui-button, 941 | .ui-button { 942 | color: #454545; 943 | text-decoration: none; 944 | } 945 | .ui-state-hover, 946 | .ui-widget-content .ui-state-hover, 947 | .ui-widget-header .ui-state-hover, 948 | .ui-state-focus, 949 | .ui-widget-content .ui-state-focus, 950 | .ui-widget-header .ui-state-focus, 951 | .ui-button:hover, 952 | .ui-button:focus { 953 | border: 1px solid #cccccc; 954 | background: #ededed; 955 | font-weight: normal; 956 | color: #2b2b2b; 957 | } 958 | .ui-state-hover a, 959 | .ui-state-hover a:hover, 960 | .ui-state-hover a:link, 961 | .ui-state-hover a:visited, 962 | .ui-state-focus a, 963 | .ui-state-focus a:hover, 964 | .ui-state-focus a:link, 965 | .ui-state-focus a:visited, 966 | a.ui-button:hover, 967 | a.ui-button:focus { 968 | color: #2b2b2b; 969 | text-decoration: none; 970 | } 971 | 972 | .ui-visual-focus { 973 | box-shadow: 0 0 3px 1px rgb(94, 158, 214); 974 | } 975 | .ui-state-active, 976 | .ui-widget-content .ui-state-active, 977 | .ui-widget-header .ui-state-active, 978 | a.ui-button:active, 979 | .ui-button:active, 980 | .ui-button.ui-state-active:hover { 981 | border: 1px solid #FFF; 982 | background: #DDD; 983 | font-weight: normal; 984 | color: #ffffff; 985 | } 986 | .ui-icon-background, 987 | .ui-state-active .ui-icon-background { 988 | border: #003eff; 989 | background-color: #ffffff; 990 | } 991 | .ui-state-active a, 992 | .ui-state-active a:link, 993 | .ui-state-active a:visited { 994 | color: #ffffff; 995 | text-decoration: none; 996 | } 997 | 998 | /* Interaction Cues 999 | ----------------------------------*/ 1000 | .ui-state-highlight, 1001 | .ui-widget-content .ui-state-highlight, 1002 | .ui-widget-header .ui-state-highlight { 1003 | border: 1px solid #dad55e; 1004 | background: #fffa90; 1005 | color: #777620; 1006 | } 1007 | .ui-state-checked { 1008 | border: 1px solid #dad55e; 1009 | background: #fffa90; 1010 | } 1011 | .ui-state-highlight a, 1012 | .ui-widget-content .ui-state-highlight a, 1013 | .ui-widget-header .ui-state-highlight a { 1014 | color: #777620; 1015 | } 1016 | .ui-state-error, 1017 | .ui-widget-content .ui-state-error, 1018 | .ui-widget-header .ui-state-error { 1019 | border: 1px solid #f1a899; 1020 | background: #fddfdf; 1021 | color: #5f3f3f; 1022 | } 1023 | .ui-state-error a, 1024 | .ui-widget-content .ui-state-error a, 1025 | .ui-widget-header .ui-state-error a { 1026 | color: #5f3f3f; 1027 | } 1028 | .ui-state-error-text, 1029 | .ui-widget-content .ui-state-error-text, 1030 | .ui-widget-header .ui-state-error-text { 1031 | color: #5f3f3f; 1032 | } 1033 | .ui-priority-primary, 1034 | .ui-widget-content .ui-priority-primary, 1035 | .ui-widget-header .ui-priority-primary { 1036 | font-weight: bold; 1037 | } 1038 | .ui-priority-secondary, 1039 | .ui-widget-content .ui-priority-secondary, 1040 | .ui-widget-header .ui-priority-secondary { 1041 | opacity: .7; 1042 | filter:Alpha(Opacity=70); /* support: IE8 */ 1043 | font-weight: normal; 1044 | } 1045 | .ui-state-disabled, 1046 | .ui-widget-content .ui-state-disabled, 1047 | .ui-widget-header .ui-state-disabled { 1048 | opacity: .35; 1049 | filter:Alpha(Opacity=35); /* support: IE8 */ 1050 | background-image: none; 1051 | } 1052 | .ui-state-disabled .ui-icon { 1053 | filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ 1054 | } 1055 | 1056 | /* Icons 1057 | ----------------------------------*/ 1058 | 1059 | 1060 | /* Misc visuals 1061 | ----------------------------------*/ 1062 | 1063 | /* Corner radius */ 1064 | .ui-corner-all, 1065 | .ui-corner-top, 1066 | .ui-corner-left, 1067 | .ui-corner-tl { 1068 | border-top-left-radius: 3px; 1069 | } 1070 | .ui-corner-all, 1071 | .ui-corner-top, 1072 | .ui-corner-right, 1073 | .ui-corner-tr { 1074 | border-top-right-radius: 3px; 1075 | } 1076 | .ui-corner-all, 1077 | .ui-corner-bottom, 1078 | .ui-corner-left, 1079 | .ui-corner-bl { 1080 | border-bottom-left-radius: 3px; 1081 | } 1082 | .ui-corner-all, 1083 | .ui-corner-bottom, 1084 | .ui-corner-right, 1085 | .ui-corner-br { 1086 | border-bottom-right-radius: 3px; 1087 | } 1088 | 1089 | /* Overlays */ 1090 | .ui-widget-overlay { 1091 | background: #aaaaaa; 1092 | opacity: .003; 1093 | filter: Alpha(Opacity=.3); /* support: IE8 */ 1094 | } 1095 | .ui-widget-shadow { 1096 | -webkit-box-shadow: 0px 0px 5px #666666; 1097 | box-shadow: 0px 0px 5px #666666; 1098 | } 1099 | -------------------------------------------------------------------------------- /playlister/static/css/plot.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --accent-color: #2A2D34; 3 | --bg-color: #F5F5F5; 4 | --red: #DE3633; 5 | --blue: #57D2AD; 6 | } 7 | 8 | 9 | 10 | html{ 11 | background-color: var(--bg-color); 12 | } 13 | body { 14 | margin: 0px; 15 | font-family: 'Roboto', 'Helvetica Neue', sans-serif; 16 | } 17 | 18 | *:focus { 19 | outline: none; 20 | } 21 | 22 | .error { 23 | display: inline; 24 | position: fixed; 25 | margin: 5px; 26 | color: #FF4B4E; 27 | font-size: 12; 28 | } 29 | 30 | 31 | /*------------------------------------- 32 | Header Styles */ 33 | 34 | header { 35 | list-style-type: none; 36 | margin: 0; 37 | padding: 0; 38 | overflow: hidden; 39 | height: 3em; 40 | background-color: var(--bg-color); 41 | color: #2A2D34; 42 | } 43 | 44 | #title { 45 | float: left; 46 | display: inline-block; 47 | text-align: center; 48 | margin: 8px 0px 0px 10px; 49 | text-decoration: none; 50 | color: #2A2D34; 51 | font-size: 14px; 52 | } 53 | 54 | #title a { 55 | font-size: 22px; 56 | text-decoration: none; 57 | color: #2A2D34; 58 | } 59 | 60 | #title a:hover { 61 | color: #DDD; 62 | } 63 | 64 | #stats_toggle { 65 | display: none; 66 | float: right; 67 | position: absolute; 68 | top: 5px; 69 | right: 10px; 70 | color: #000; 71 | font-weight: 900; 72 | cursor: pointer; 73 | } 74 | 75 | #user-input { 76 | display: inline-block; 77 | margin: 10px 0px 0px 20px; 78 | } 79 | 80 | input { 81 | border: none; 82 | border-bottom: 1px solid var(--blue); 83 | font-size: 12px; 84 | color: #2A2D34; 85 | padding: 5px; 86 | background-color: var(--bg-color); 87 | } 88 | 89 | #get_data_button { 90 | display: inline-block; 91 | margin: 10px 0px 0px 5px; 92 | color: #2A2D34; 93 | } 94 | #get_data_button:hover { 95 | font-weight: bold; 96 | color: #000; 97 | } 98 | 99 | #github_link { 100 | text-decoration: none; 101 | float: right; 102 | position: absolute; 103 | top: 13px; 104 | right: 20px; 105 | color: #2A2D34; 106 | } 107 | #github_link:hover { 108 | color: #7C6BD3; 109 | cursor: pointer; 110 | } 111 | 112 | 113 | /*------------------------------------- 114 | Left Side Bar */ 115 | 116 | #graph_bar { 117 | display: none; 118 | float: left; 119 | position: absolute; 120 | width: 100%; 121 | height: 30px; 122 | top: 48px; 123 | left: 0; 124 | z-index: -1; 125 | background-color: var(--bg-color); 126 | border-bottom: 1px solid #DDD; 127 | color: #2A2D34; 128 | } 129 | 130 | #right_aside { 131 | float: right; 132 | position: absolute; 133 | width: 0px; 134 | top: 78px; 135 | bottom: 0; 136 | right: 0; 137 | height: auto; 138 | z-index: -1; 139 | border-left: 1px solid #DDD; 140 | background-color: var(--bg-color); 141 | overflow-y: scroll; 142 | } 143 | 144 | #pl_selections { 145 | margin-left: 5px; 146 | height: 30px; 147 | } 148 | 149 | .select { 150 | display: inline; 151 | padding: 5px; 152 | } 153 | 154 | #playlist_select { 155 | width: 170px; 156 | } 157 | 158 | #first_select { 159 | margin-left: 10px; 160 | } 161 | 162 | select { 163 | background-color: var(--bg-color); 164 | color: #2A2D34; 165 | font-size: 15px; 166 | border: none; 167 | background-image: none; 168 | -webkit-appearance: none; 169 | padding: 5px; 170 | } 171 | 172 | #go_button { 173 | display: inline-block; 174 | text-align: center; 175 | padding-top: 5px; 176 | font-weight: bold; 177 | } 178 | 179 | #go_button:hover, 180 | #get_data_button:hover { 181 | font-weight: normal; 182 | cursor: pointer; 183 | } 184 | 185 | /*------------------------------------- 186 | Options/Stats Bar */ 187 | #more_options { 188 | position: static; 189 | width: 100%; 190 | margin: 0px; 191 | } 192 | .side_button { 193 | postion: relative; 194 | margin: 5px; 195 | padding: 5px; 196 | text-align: center; 197 | border-bottom: 1px solid var(--blue); 198 | cursor: pointer; 199 | } 200 | 201 | .side_button:hover { 202 | border-color: var(--bg-color); 203 | } 204 | 205 | #pca_table { 206 | margin-left: 5px; 207 | font-size: 13px; 208 | color: #333; 209 | text-align: right; 210 | }; 211 | 212 | #stats { 213 | position: static; 214 | margin: 0px; 215 | } 216 | 217 | #stats div { 218 | position: relative; 219 | margin: 5px; 220 | width: 190px; 221 | } 222 | 223 | #stats b { 224 | font-size: 16px; 225 | } 226 | 227 | #stats div tr { 228 | text-align: left; 229 | font-size: 13px; 230 | color: #2A2D34; 231 | } 232 | 233 | #stats div table { 234 | width: 190px; 235 | margin: 0; 236 | } 237 | 238 | #stats div tr td { 239 | width: 100px; 240 | text-align: right; 241 | } 242 | 243 | 244 | /*------------------------------------- 245 | Main/Plot*/ 246 | 247 | main { 248 | float: right; 249 | position: absolute; 250 | height: auto; 251 | right: 0px; 252 | left: 0px; 253 | top: 79px; 254 | bottom: 0px; 255 | padding: 0; 256 | z-index: -2; 257 | } 258 | 259 | .plot { 260 | margin: 0; 261 | padding: 0; 262 | bottom: 0; 263 | background-color: #fff; 264 | } 265 | 266 | .axis path, 267 | .axis line { 268 | fill: none; 269 | stroke: #DDD; 270 | shape-rendering: crispEdges; 271 | } 272 | 273 | .axis text { 274 | font-size: 11px; 275 | } 276 | 277 | div.tooltip { 278 | position: absolute; 279 | text-align: center; 280 | width: 150px; 281 | height: autp; 282 | padding: 0px; 283 | border: 0px; 284 | font-size: 12px; 285 | pointer-events: none; 286 | } 287 | 288 | /*------------------------------------- 289 | loading display*/ 290 | .loading { 291 | display: none; 292 | position: fixed; 293 | top: 50%; 294 | left: 50%; 295 | margin-left: -50px; 296 | margin-top: -50px; 297 | text-align:center; 298 | z-index:1234; 299 | overflow: auto; 300 | width: 100px; 301 | height: 102px; 302 | } 303 | -------------------------------------------------------------------------------- /playlister/static/css/sift.css: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------- 2 | * Generated by Animista on 2017-3-17 21:57:9 3 | * http://animista.net 4 | * T: @cssanimista 5 | * ---------------------------------------------- */ 6 | 7 | @-webkit-keyframes shadow-drop-center{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0 0 5px 0 rgba(0,0,0,.35)}}@keyframes shadow-drop-center{0%{box-shadow:0 0 0 0 transparent}100%{box-shadow:0 0 5px 0 rgba(0,0,0,.35)}} 8 | 9 | 10 | 11 | :root { 12 | --bg-color: #F0F0F0; 13 | --left-color: #FFFFFF; 14 | --accent-color: #2A2D34; 15 | --fg-color: #F0F5F5; 16 | --red: #50C39F; 17 | /* --blue: #50C39F; 18 | --red: #464646;*/ 19 | --blue: #6B6B6B; 20 | } 21 | 22 | body { 23 | font-family: "Roboto", "Helvetica Neue", sans-serif; 24 | background-color: var(--bg-color); 25 | } 26 | 27 | *:focus { 28 | outline: none; 29 | } 30 | . 31 | main { 32 | padding-bottom: 10px; 33 | background-color: var(--bg-color); 34 | margin-bottom: 0; 35 | padding: 0px; 36 | } 37 | 38 | section { 39 | background-color: var(--left-color); 40 | } 41 | 42 | .box { 43 | padding: 5px 10px 5px 10px; 44 | } 45 | 46 | #results-group { 47 | border: none; 48 | background-color: var(--bg-color); 49 | } 50 | 51 | .error { 52 | width: 80%; 53 | max-width: 200px; 54 | margin: auto; 55 | color: var(--red); 56 | text-align: center; 57 | } 58 | 59 | #title { 60 | background-color: var(--bg-color); 61 | color: var(--accent-color); 62 | padding: 6px 0px; 63 | font-size: 20px; 64 | margin: 0 0 10px 8px; 65 | } 66 | 67 | #title a { 68 | color: var(--accent-color); 69 | text-decoration: none; 70 | font-size: 30px; 71 | } 72 | 73 | #title a:hover { 74 | font-weight: bold; 75 | } 76 | 77 | #left-column { 78 | float: left; 79 | margin: auto; 80 | width: 298px; 81 | background-color: var(--left-color); 82 | /* border: 1px solid #ddd;*/ 83 | padding-top: 5px; 84 | padding-bottom: 10px; 85 | -webkit-animation: shadow-drop-center 0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) both; 86 | -moz-animation: shadow-drop-center 0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) both; 87 | animation: shadow-drop-center 0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) both; 88 | } 89 | 90 | .group-label { 91 | color: var(--blue); 92 | font-size: 12px; 93 | padding-top: 5px; 94 | padding-left: 15px; 95 | font-weight: 100; 96 | } 97 | 98 | /* input styles */ 99 | .input { 100 | display: inline-block; 101 | margin: 0 3px 0 3px; 102 | padding-left: 7px; 103 | width: 140px; 104 | border-bottom: 1px solid var(--accent-color); 105 | } 106 | 107 | input { 108 | border: none; 109 | font-size: 12px; 110 | color: var(--accent-color); 111 | padding: 0; 112 | margin: none; 113 | background-color: var(--background-color); 114 | } 115 | 116 | /* select styles */ 117 | 118 | .percent50 { 119 | width: 50%; 120 | } 121 | 122 | select { 123 | color: var(--accent-color); 124 | font-size: 12px; 125 | border: none; 126 | background-color: var(--background-color); 127 | background-image: none; 128 | width: 100%; 129 | display: inline-block; 130 | } 131 | 132 | #playlist-group .select { 133 | display: inline-block; 134 | } 135 | 136 | /* button styles */ 137 | .button { 138 | -webkit-transition-duration: 0.1s; /*Safari*/ 139 | transition-duration: 0.1s; 140 | color: var(--red); 141 | /* background-color: var(--red);*/ 142 | cursor: pointer; 143 | border-radius: 5px; 144 | float: right; 145 | } 146 | 147 | .button:hover { 148 | color: #76FBCD; 149 | } 150 | 151 | /* toggle styles */ 152 | .toggle { 153 | font-size: 12px; 154 | color: #6ADCB5; 155 | cursor: pointer; 156 | } 157 | 158 | .active .toggle { 159 | color: var(--red); 160 | } 161 | 162 | .sort-row .select select { 163 | color: #c5c5c5; 164 | } 165 | .active .select select { 166 | color: var(--accent-color); 167 | } 168 | 169 | .same-line { 170 | display: inline-block; 171 | } 172 | 173 | /* playlist select styles */ 174 | #playlist-group, 175 | #filter-group, 176 | #sort-group, 177 | #results-group, 178 | #save-group { 179 | display: none; 180 | } 181 | 182 | #pl-title { 183 | white-space: nowrap; 184 | overflow: hidden; 185 | padding: 10px 0px 10px 0px; 186 | } 187 | 188 | /* Apply button styles */ 189 | .apply-button { 190 | text-align: center; 191 | left: 50%; 192 | right: 50%; 193 | display: block; 194 | margin-top: 5px; 195 | float: none; 196 | } 197 | 198 | /* filter styles */ 199 | 200 | #preset-table { 201 | padding-left: 5px; 202 | width: 280px; 203 | } 204 | 205 | #preset-table td { 206 | padding-right: 5px; 207 | color: var(--red); 208 | text-align: center; 209 | cursor: pointer; 210 | } 211 | 212 | #preset-table td:hover { 213 | color: #76FBCD; 214 | } 215 | 216 | #preset-table td:first-child { 217 | border: none; 218 | font-weight: bold; 219 | color: #000; 220 | } 221 | 222 | #slider-table { 223 | font-size: 12px; 224 | } 225 | 226 | .slider { 227 | margin-left: 10px; 228 | width: 95%; 229 | } 230 | 231 | .range { 232 | font-size: 11px; 233 | width: 100%; 234 | } 235 | 236 | /* Sort styles */ 237 | 238 | #sort-table { 239 | table-layout: fixed; 240 | } 241 | 242 | #sort-table tr td { 243 | width: 145px; 244 | } 245 | 246 | #sort-table tr td:first-child { 247 | width: 110px; 248 | } 249 | 250 | #sort-table tr { 251 | height: 21px; 252 | } 253 | 254 | 255 | /* results styles */ 256 | 257 | #right-column { 258 | float: right; 259 | width: calc(100% - 310px); 260 | min-width: 200px; 261 | margin-left: 10px; 262 | } 263 | 264 | #song-list-div { 265 | max-width: 100%; 266 | min-width: 200px; 267 | margin-top: 10px; 268 | } 269 | 270 | #song-list { 271 | color: var(--accent-color); 272 | padding: 6px; 273 | } 274 | 275 | #song-list tr td { 276 | padding: 0px 0px 5px 0px; 277 | } 278 | #song-list tr td:first-child { 279 | color: #000; 280 | padding: 0px 15px 5px 0px; 281 | } 282 | 283 | /* Footer */ 284 | #footer { 285 | max-width: 100%; 286 | bottom: 15px; 287 | } 288 | 289 | p { 290 | color: #666; 291 | margin-top: 10px; 292 | max-width: 500px; 293 | font-size: 14px; 294 | } 295 | 296 | 297 | #github_link { 298 | text-decoration: none; 299 | float: right; 300 | position: absolute; 301 | top: 25px; 302 | right: 20px; 303 | color: #2A2D34; 304 | } 305 | #github_link:hover { 306 | color: #7C6BD3; 307 | cursor: pointer; 308 | } 309 | 310 | /** slider styles */ 311 | .ui-slider-horizontal { 312 | height: .4em; 313 | } 314 | 315 | .ui-slider .ui-slider-handle { 316 | width: .8em; 317 | height: .8em; 318 | } 319 | 320 | .ui-state-default, 321 | .ui-widget-content .ui-state-default, 322 | .ui-widget-header .ui-state-default, 323 | .ui-button, 324 | html .ui-button.ui-state-disabled:hover, 325 | html .ui-button.ui-state-disabled:active { 326 | border: 1px solid #c5c5c5; 327 | background: var(--bg-color); 328 | } 329 | 330 | .ui-widget-header { 331 | background: #c5c5c5; 332 | border: none; 333 | } 334 | 335 | .ui-widget-content, 336 | .ui-widget.ui-widget-content{ 337 | border: none; 338 | } 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | -------------------------------------------------------------------------------- /playlister/static/js/index.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | p_auth_url = p_auth_url.replace(/&/g, "&") 3 | s_auth_url = s_auth_url.replace(/&/g, "&") 4 | $('#plot').attr("href", p_auth_url) 5 | $('#sift').attr("href", s_auth_url) 6 | }) 7 | -------------------------------------------------------------------------------- /playlister/static/js/jquery.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v3.0.0 | (c) jQuery Foundation | jquery.org/license */ 2 | !function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.0.0",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return a&&"[object Object]"===k.call(a)?(b=e(a))?(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n):!0:!1},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;d>f;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;return"string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a)?(d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e):void 0},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"===c||r.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\x00-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\x00"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[0>c?c+b:c]}),even:pa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e)}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,e>i&&ya(a.slice(i,e)),f>e&&ya(a=a.slice(e)),f>e&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;d>b;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;d>b;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(f>b)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(1>=b&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){ 3 | return j.call(r(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:X.test(c)?JSON.parse(c):c}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),Z(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=Z(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthf;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ba(d)&&(e[f]=fa(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;g>f;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ga(this,!0)},hide:function(){return ga(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ba(this)?r(this).show():r(this).hide()})}});var ha=/^(?:checkbox|radio)$/i,ia=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;d>c;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var na=/<|&#?\w+;/;function oa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;o>n;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(na.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ia.exec(f)||["",""])[1].toLowerCase(),i=ka[h]||ka._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;cc;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?r(e,this).index(i)>-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ga(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ha.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ha(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;m>l;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,la(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ea),l=0;i>l;l++)j=h[l],ja.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ba,""),k))}return a}function Ia(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(la(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&ma(la(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(xa,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;e>d;d++)Ga(f[d],g[d]);if(b)if(c)for(f=f||la(a),g=g||la(h),d=0,e=f.length;e>d;d++)Fa(f[d],g[d]);else Fa(a,h);return g=la(h,"script"),g.length>0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(la(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(la(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;f>=g;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ja=/^margin/,Ka=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),La=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",pa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,pa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Ma(a,b,c){var d,e,f,g,h=a.style;return c=c||La(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ka.test(g)&&Ja.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Na(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Oa=/^(none|table(?!-c[ea]).+)/,Pa={position:"absolute",visibility:"hidden",display:"block"},Qa={letterSpacing:"0",fontWeight:"400"},Ra=["Webkit","Moz","ms"],Sa=d.createElement("div").style;function Ta(a){if(a in Sa)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ra.length;while(c--)if(a=Ra[c]+b,a in Sa)return a}function Ua(a,b,c){var d=_.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Va(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=r.css(a,c+aa[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+aa[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+aa[f]+"Width",!0,e))):(g+=r.css(a,"padding"+aa[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+aa[f]+"Width",!0,e)));return g}function Wa(a,b,c){var d,e=!0,f=La(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),0>=d||null==d){if(d=Ma(a,b,f),(0>d||null==d)&&(d=a.style[b]),Ka.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Va(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ma(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=_.exec(c))&&e[1]&&(c=da(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Ma(a,b,d)),"normal"===e&&b in Qa&&(e=Qa[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){return c?!Oa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Wa(a,b,d):ca(a,Pa,function(){return Wa(a,b,d)}):void 0},set:function(a,c,d){var e,f=d&&La(a),g=d&&Va(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=_.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ua(a,c,g)}}}),r.cssHooks.marginLeft=Na(o.reliableMarginLeft,function(a,b){return b?(parseFloat(Ma(a,"marginLeft"))||a.getBoundingClientRect().left-ca(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+aa[d]+b]=f[d]||f[d-2]||f[0];return e}},Ja.test(a)||(r.cssHooks[a+b].set=Ua)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=La(a),e=b.length;e>g;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function eb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ba(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],$a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ga([a],!0),j=a.style.display||j,k=r.css(a,"display"),ga([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ga([a],!0),m.done(function(){p||ga([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=db(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function fb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function gb(a,b,c){var d,e,f=0,g=gb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Ya||bb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Ya||bb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(fb(k,j.opts.specialEasing);g>f;f++)if(d=gb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,db,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(gb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return da(c.elem,a,_.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;e>d;d++)c=a[d],gb.tweeners[c]=gb.tweeners[c]||[],gb.tweeners[c].unshift(b)},prefilters:[eb],prefilter:function(a,b){b?gb.prefilters.unshift(a):gb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:e.duration="number"==typeof e.duration?e.duration:e.duration in r.fx.speeds?r.fx.speeds[e.duration]:r.fx.speeds._default,null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ba).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=gb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&_a.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(cb(b,!0),a,d,e)}}),r.each({slideDown:cb("show"),slideUp:cb("hide"),slideToggle:cb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Ya=r.now();b1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c); 4 | }}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){return r.isArray(b)?a.checked=r.inArray(r(a).val(),b)>-1:void 0}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?r.event.trigger(a,b,c,!0):void 0}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",0>b&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;return o.cors||Pb&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" 17 | 18 | 19 | 20 |
Plotify
21 | 22 |
23 | 24 |
25 | Plot your Music 26 |

Visualize playlists by plotting their attributes.

27 |
28 | 29 |
30 | Filter your Music 31 |

Refine your playlists by limiting song attributes.

32 |
33 | 34 |
35 | 43 |
44 | 45 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /playlister/templates/plot.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Plot your Music 10 | {% load staticfiles %} 11 | 12 | 13 | 16 | 17 | 18 | 19 |
20 |
Plotify Plot your Music
21 | 22 |
Get Playlists
23 | 24 | github 25 | 26 |
27 |
28 |
29 |
30 | 33 |
34 | : 35 |
36 | 54 |
55 | vs 56 |
57 | 75 |
76 |
Go
77 |
More Options
78 |
79 |
80 |
81 |
82 | Loading 83 |
84 |
85 |
86 |
87 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /playlister/templates/sift.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Filter your Music 10 | {% load staticfiles %} 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 |
21 |
Plotify Filter your Music
22 | 23 | github 24 | 25 |
26 | 27 |
28 |
30 | Username
31 |
32 |
33 | 34 | 35 |
36 |
37 | Retrieve Playlists 38 |
39 |
40 |
41 |
42 |
44 | Playlist
45 |
46 |
47 | 50 |
51 |
52 | Retrieve Songs 53 |
54 |
55 |
56 | 57 |
58 |
60 | Filter
61 |
62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
PresetsExerciseRelaxingAcoustic
70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 |
Danceability0 to 100
Energy0 to 100
Loudness-60 to 0
Speechiness0 to 100
Acousticness0 to 100
Instrumentalness0 to 100
Valence0 to 100
Popularity0 to 100
87 |
88 | Apply Filter 89 |
90 |
91 |
92 | 93 |
94 |
96 | Sort
97 |
98 | 99 | 100 | 101 | 116 | 122 | 123 | 124 | 125 | 130 | 136 | 137 | 138 | 139 | 145 | 146 | 149 |
by Feature 102 | 115 | 117 | 121 |
by Similarity 126 | 129 | 131 | 135 |
by Title Length 140 | 144 |
150 |
151 | Apply Sort 152 |
153 |
154 |
155 | 156 |
157 |
159 | Save
160 |
161 |
162 | 163 |
164 |
165 | Save Playlist 166 |
167 |
168 |
169 |
170 | 171 |
172 |
173 |
174 | 175 |
176 |
177 |
178 |
179 | 180 | 181 | 189 |
190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /playlister/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import url, include 2 | from django.contrib import admin 3 | 4 | urlpatterns = [ 5 | url(r'^admin/', include(admin.site.urls)), 6 | url(r'^', include('engine.urls')), 7 | ] 8 | -------------------------------------------------------------------------------- /playlister/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for playlister project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "playlister.settings") 13 | 14 | from django.core.wsgi import get_wsgi_application 15 | from whitenoise.django import DjangoWhiteNoise 16 | 17 | application = get_wsgi_application() 18 | application = DjangoWhiteNoise(application) 19 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | cycler==0.10.0 2 | dj-database-url==0.4.1 3 | Django==1.9.8 4 | gunicorn==19.6.0 5 | numpy==1.10.2 6 | pandas==0.13.0 7 | psycopg2==2.6.1 8 | pyparsing==2.1.4 9 | python-dateutil==2.4.1 10 | pytz==2016.6.1 11 | requests==2.10.0 12 | scikit-learn==0.18.1 13 | scipy==0.13.2 14 | six==1.10.0 15 | spotipy==2.3.8 16 | whitenoise==3.2 17 | -------------------------------------------------------------------------------- /spot/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafin/Spotify-Visualizations/f23bf128d9b7fe93bd64064afaff90f03d4d1f34/spot/__init__.py -------------------------------------------------------------------------------- /spot/analysis.py: -------------------------------------------------------------------------------- 1 | import pl as spotify 2 | import pandas as pd 3 | import numpy as np 4 | import scipy.stats 5 | from sklearn.manifold import TSNE 6 | from sklearn.preprocessing import scale 7 | 8 | def dict_to_frame(playlist): 9 | pl_frame = pd.DataFrame(playlist) 10 | raw_data = pl_frame[['energy', 'speechiness', 'acousticness', 11 | 'danceability', 'loudness', 'valence', 12 | 'instrumentalness']] 13 | return raw_data 14 | 15 | def simple_stats(playlist): 16 | ''' outputs basic statitics for given playlist 17 | such as average value for each feature 18 | ''' 19 | pl_frame = dict_to_frame(playlist) 20 | means = pl_frame.mean().to_dict() 21 | means_list = [] 22 | for key, value in means.iteritems(): 23 | means_list.append([key, round(value, 1)]) 24 | return means_list 25 | 26 | def confidence_interval(songs, confidence=.9999): 27 | ''' experimental bound generator for sifter 28 | ''' 29 | pl_frame = dict_to_frame(songs) 30 | n = len(pl_frame) 31 | m, se = np.mean(pl_frame), scipy.stats.sem(pl_frame) 32 | h = se * scipy.stats.t._ppf((1+confidence)/2., n-1) 33 | uppers = (m+h).to_dict() 34 | lowers = (m-h).to_dict() 35 | keys = ['energy', 'speechiness', 'acousticness', 36 | 'danceability', 'loudness', 'valence', 37 | 'instrumentalness'] 38 | set = [] 39 | for key in keys: 40 | if key == 'popularity': 41 | set.append([0, 100]) 42 | continue 43 | set.append([round(lowers[key], 0),round(uppers[key], 0)]) 44 | return set 45 | 46 | def pca(playlist): 47 | ''' Principle Component Analysis implementation 48 | ''' 49 | pl_frame = pd.DataFrame(playlist) 50 | features = ['energy', 'speechiness', 'acousticness', 51 | 'danceability', 'loudness', 'valence', 52 | 'instrumentalness'] 53 | data = pl_frame[features].T.as_matrix() 54 | ## computing d-dimensional mean vector 55 | mean = [] 56 | for row in data: 57 | mean.append(np.mean(row)) 58 | mean_vector = np.array([mean]).T 59 | size = len(mean_vector) 60 | 61 | ## computing the scatter matrix 62 | scatter_matrix = np.zeros((size,size)) 63 | for i in range(data.shape[1]): 64 | scatter_matrix += (data[:,i].reshape(size,1) - mean_vector).dot((data[:,i].reshape(size,1) - mean_vector).T) 65 | 66 | ## computing eigenvectors and coor. eigenvalues with scatter .. 67 | eig_val_sc, eig_vec_sc = np.linalg.eig(scatter_matrix) 68 | for i in range(len(eig_val_sc)): 69 | eigvec_sc = eig_vec_sc[:,i].reshape(1,size).T 70 | 71 | ## Sorting Eignevectors by Decreasing eigenvalues 72 | eig_pairs = [(np.abs(eig_val_sc[i]), eig_vec_sc[:,i]) for i in range(len(eig_val_sc))] 73 | eig_pairs.sort(key = lambda x: x[0], reverse=True) 74 | print eig_pairs 75 | 76 | ## store two largest eigenvectors for display 77 | vector1 = [round(n, 2) for n in eig_pairs[0][1].tolist()] 78 | vector2 = [round(n, 2) for n in eig_pairs[1][1].tolist()] 79 | weights = map(list, zip(features, vector1, vector2)) 80 | 81 | 82 | ## Choosing k eigenvectors with the largest eigenvalues 83 | matrix_w = np.hstack((eig_pairs[0][1].reshape(size,1), eig_pairs[1][1].reshape(size,1))) 84 | 85 | ## Transforming the samples onto the new subspace 86 | transformed = matrix_w.T.dot(data) 87 | trasnformed = scale(transformed) 88 | coords = pd.DataFrame(transformed.T) 89 | return {"coords": coords, "weights": weights} 90 | 91 | def merge_pca(songs, pca): 92 | for index, row in pca.iterrows(): 93 | songs[index]['pca1'] = round(row[0], 2) 94 | songs[index]['pca2'] = round(row[1], 2) 95 | return songs 96 | 97 | def tSNE(playlist): 98 | ''' t-distributed stochastic neighbor embedding implementation 99 | (heavier alternate to pca) 100 | ''' 101 | pl_frame = pd.DataFrame(playlist) 102 | features = ['energy', 'speechiness', 'acousticness', 103 | 'danceability', 'loudness', 'valence', 104 | 'instrumentalness'] 105 | data = pl_frame[features].T.as_matrix() 106 | data = scale(data) 107 | data = data.T 108 | data_tsne = TSNE(learning_rate=100, init='pca').fit_transform(data) 109 | data_tsne = scale(data_tsne) 110 | 111 | return pd.DataFrame(data_tsne) 112 | 113 | def merge_tsne(songs, tsne): 114 | for index, row in tsne.iterrows(): 115 | songs[index]['tSNE1'] = round(row[0] * 100, 2) 116 | songs[index]['tSNE2'] = round(row[1] * 100, 2) 117 | return songs 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /spot/keys.py: -------------------------------------------------------------------------------- 1 | import spotipy 2 | import spotipy.util as util 3 | from spotipy.oauth2 import SpotifyOAuth, SpotifyClientCredentials 4 | import os, ast, requests 5 | 6 | #Spotify API keys 7 | scope = "playlist-read-private playlist-modify-private" 8 | #uirs = ["http://localhost:8000/authorize_plot/", "http://localhost:8000/authorize_sift/"] 9 | uirs = ["http://plotify.herokuapp.com/authorize_plot/", "http://plotify.herokuapp.com/authorize_sift/"] 10 | 11 | def keys(): 12 | spotify_keys = os.environ["SPOTIFY_KEYS"] 13 | spotify_keys = ast.literal_eval(spotify_keys) 14 | return spotify_keys[0] 15 | 16 | def auth_url(mode): 17 | key = keys() 18 | sp_oauth = SpotifyOAuth(key["uid"], key["usec"], uirs[mode], scope=scope) 19 | auth_url = sp_oauth.get_authorize_url() 20 | return auth_url 21 | 22 | #set up access 23 | def get_token(code, mode): 24 | key = keys() 25 | sp_oauth = SpotifyOAuth(key["uid"], key["usec"], uirs[mode], scope=scope) 26 | token_info = sp_oauth.get_access_token(code) 27 | if token_info: 28 | return token_info['access_token'] 29 | else: 30 | return None 31 | 32 | def get_access(token=None): 33 | if token: 34 | print "retrieving private access" 35 | return spotipy.Spotify(auth=token) 36 | print "SUCCESS" 37 | else: 38 | print "retrieving public access" 39 | key = keys() 40 | token = SpotifyClientCredentials(client_id=key["uid"], client_secret=key["usec"]).get_access_token() 41 | print token 42 | return spotipy.Spotify(auth=token) 43 | 44 | -------------------------------------------------------------------------------- /spot/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafin/Spotify-Visualizations/f23bf128d9b7fe93bd64064afaff90f03d4d1f34/spot/migrations/__init__.py -------------------------------------------------------------------------------- /spot/pl.py: -------------------------------------------------------------------------------- 1 | from unicodedata import normalize 2 | import datetime 3 | from operator import itemgetter 4 | import keys # local module handling API key 5 | import analysis 6 | 7 | from pprint import pprint 8 | 9 | # set up access with these global vars 10 | sp = None 11 | 12 | 13 | def set_access(token=None): 14 | global sp 15 | global username 16 | # if token == None: 17 | # sp = keys.get_access() 18 | # print "have public access only" 19 | # return 20 | sp = keys.get_access(token) 21 | print "have private access" 22 | 23 | 24 | def to_date(date): 25 | '''converts a string in any day/month/year format 26 | to a datetime object, defaulting to 1/1 if no 27 | month or day is found (year is required) 28 | ''' 29 | year = int(date[0:4]) 30 | month = day = 1 31 | if len(date) > 7: 32 | day = int(date[8:]) 33 | if len(date) > 5: 34 | month = int(date[5:7]) 35 | #return datetime.date(year, month, day) 36 | return year 37 | 38 | 39 | def correct_spaces(string): 40 | '''removes double spaces and beginning and ending 41 | spaces from a string 42 | ''' 43 | string = string.replace(" ", " ") 44 | if string[0] == " ": 45 | string = string[1:] 46 | if string[-1] == " ": 47 | string = string[:-1] 48 | return string 49 | 50 | 51 | def feature(playlist, feature): 52 | '''returns comma separated list (string) of specified feature value 53 | in specifed playlist in order 54 | ''' 55 | ids = [] 56 | for song in playlist['songs']: 57 | ids.append(song[feature]) 58 | return ids 59 | 60 | 61 | def get_playlists(user, token=None): 62 | '''returns list of playlists for user as [name, id],... 63 | --- 1 request per 50 playlists --- 64 | ''' 65 | if token != None: 66 | set_access(token) 67 | else: 68 | set_access() 69 | if(user != ""): 70 | playlists = [] 71 | fifty = "start" 72 | start = 0 73 | print "user = ", user 74 | #to shorten delay, cap at 200 playlists 75 | while (fifty == "start" or len(fifty['items']) == 50) and start < 200: 76 | #monitor 77 | fifty = sp.user_playlists(user, offset=start) 78 | #-------# 79 | playlists += fifty['items'] 80 | print u"retrieved {} playlists".format(len(playlists)) 81 | start += 50 82 | pls = [] 83 | for playlist in playlists: 84 | if playlist['name'] == None: 85 | continue 86 | pname = correct_spaces(playlist['name']) 87 | pid = playlist['id'] 88 | puser = playlist['owner']['id'] 89 | pls.append([pname,pid,puser]) 90 | print "playlists successfully retrieved" 91 | return sorted(pls, key=lambda d: d[0].lower()) 92 | print "username is blank" 93 | return "no user" 94 | 95 | 96 | def get_songs(p_id, p_name, userid): 97 | '''returns songs in playlist as list of dicts 98 | generates data: id, name, artists, popularity, 99 | --- 1 request per 100 songs --- 100 | ''' 101 | hundred = sp.user_playlist_tracks(userid, playlist_id=p_id) 102 | playlist = hundred 103 | start = 0 104 | while len(hundred['items']) >= 100: 105 | start += 100 106 | hundred = sp.user_playlist_tracks(userid, playlist_id=p_id, offset=start) 107 | playlist['items'] += hundred['items'] 108 | print u"retrieved {} songs".format(len(playlist['items'])) 109 | 110 | pl = {'id': p_id, 'name': p_name, 'songs': []} 111 | for track in playlist['items']: 112 | try: 113 | artist = track['track']['artists'][0]['name'] 114 | artist_id = track['track']['artists'][0]['id'] 115 | name = track['track']['name'] 116 | s_id = track['track']['id'] 117 | if s_id == None: 118 | continue 119 | pop = track['track']['popularity'] 120 | if track['track']['preview_url'] != None: 121 | preview = track['track']['preview_url'] 122 | else: 123 | preview = "" 124 | #cover = track['track']['album']['images'][2]['url']) 125 | album_id = track['track']['album']['id'] 126 | song = {'id': s_id, 'name': name, 'artist': artist, 127 | 'popularity': pop, 'preview_url': preview, 128 | 'album_id': album_id, 'artist_id': artist_id} 129 | pl['songs'].append(song) 130 | except: 131 | playlist['items'].remove(track) 132 | print "song discarded" 133 | return pl 134 | 135 | 136 | def existing_playlist(name, username, token=None): 137 | '''return type: Playlist with all Songs loaded 138 | uses the username global var 139 | ''' 140 | playlists = get_playlists(username, token) 141 | playlist_id = user_id = None 142 | for playlist in playlists: 143 | if name == playlist[0]: 144 | playlist_id = playlist[1] 145 | user_id = playlist[2] 146 | if playlist_id: 147 | return get_songs(playlist_id, name, user_id) 148 | print 'ERROR: playlist name invalid' 149 | return '' 150 | 151 | 152 | def clean_data(songs, l_features): 153 | '''sets all class variables for the songs corresponding to each 154 | ''' 155 | playlist = [] 156 | i = 1 157 | for song, features in zip(songs, l_features): 158 | if features == None: 159 | continue 160 | for k,v in features.iteritems(): 161 | if v == None or v == "": 162 | features[k] = 0 163 | song['order'] = i 164 | song['danceability'] = round(features['danceability'] * 100, 2) 165 | song['energy'] = round(features['energy'] * 100, 2) 166 | song['loudness'] = round(features['loudness'], 1) 167 | song['speechiness'] = round(features['speechiness'] * 100, 2) 168 | song['acousticness'] = round((features['acousticness']) * 100, 2) 169 | song['instrumentalness'] = round(features['instrumentalness'] * 100, 2) 170 | song['valence'] = round(features['valence'] * 100, 2) 171 | song['tempo'] = round(features['tempo'], 0) 172 | song['duration'] = round(features['duration_ms'] / 1000, 0) 173 | playlist.append(song) 174 | i += 1 175 | return playlist 176 | 177 | def get_song_features(song_ids): 178 | '''returns json of all song features corresponding to input ids 179 | --- 1 request per 100 songs --- 180 | ''' 181 | print "Getting song features" 182 | features = [] 183 | while(song_ids != None): 184 | print u"have {} song features to retrieve left".format(len(song_ids)) 185 | if len(song_ids) > 100: 186 | hundred = song_ids[0:100] 187 | song_ids = song_ids[100:] 188 | else: 189 | hundred = song_ids 190 | song_ids = None 191 | features += sp.audio_features(hundred) 192 | return features 193 | 194 | 195 | 196 | def get_genres(artist_ids): 197 | '''returns genres for input artist_ids in list of lists 198 | generates data: genres 199 | --- 1 request per 50 songs --- 200 | ''' 201 | artists = [] 202 | while(artist_ids != None): 203 | print len(artist_ids) 204 | if len(artist_ids) > 50: 205 | fifty = artist_ids[0:50] 206 | artist_ids = artist_ids[50:] 207 | else: 208 | fifty = artist_ids 209 | artist_ids = None 210 | artists += sp.artists(fifty)['artists'] 211 | sorted_genres = {} 212 | genres = [] 213 | for artist in artists: 214 | genres.append(artist['genres']) 215 | for genre in artist['genres']: 216 | sorted_genres[genre] = (sorted_genres.get(genre, 0) + 1) 217 | sorted_genres = sorted(sorted_genres.items(), key=itemgetter(1), 218 | reverse=True) 219 | return genres, sorted_genres 220 | 221 | def pl_data(pl_name, username, token=None): 222 | '''returns Dict of specified playlist with all songs and features 223 | ''' 224 | playlist = existing_playlist(pl_name, username, token) 225 | if playlist == "": 226 | return "" 227 | 228 | features = get_song_features(feature(playlist,'id')) 229 | 230 | songs = clean_data(playlist['songs'], features) 231 | means = analysis.simple_stats(songs) 232 | 233 | pca_data = analysis.pca(songs) 234 | tsne_data = analysis.tSNE(songs) ## DEBUG 235 | songs = analysis.merge_pca(songs, pca_data['coords']) 236 | songs = analysis.merge_tsne(songs, tsne_data) 237 | 238 | return {'songs': songs, 'means': means,'pcaweights': pca_data['weights']} 239 | 240 | 241 | def new_playlist(playlist_name, ids): 242 | '''create playlist 243 | ''' 244 | 245 | username = sp.current_user()['id'] 246 | playlist = sp.user_playlist_create(username, playlist_name) 247 | pid = playlist['id'] 248 | ids = ids.split(",") 249 | while(ids != None): 250 | if len(ids) > 100: 251 | hundred = ids[0:100] 252 | ids = ids[100:] 253 | else: 254 | hundred = ids 255 | ids = None 256 | sp.user_playlist_add_tracks(username, pid, hundred) 257 | 258 | -------------------------------------------------------------------------------- /spot/pltest.py: -------------------------------------------------------------------------------- 1 | import pl 2 | import analysis 3 | 4 | def main(): 5 | 6 | 7 | if __name__ == '__main__': 8 | main() --------------------------------------------------------------------------------