diff --git a/.gitignore b/.gitignore index ed297de..f4d81aa 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,12 @@ etc/* apps/* cloth/lib/* static/ + +static/admin/* +static/css/* +static/js/* +static/media/ node_modules/ dump/ -ltmo/media \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..656545c --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/jsLinters/jshint.xml b/.idea/jsLinters/jshint.xml new file mode 100644 index 0000000..763153c --- /dev/null +++ b/.idea/jsLinters/jshint.xml @@ -0,0 +1,71 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/js.xml b/.idea/libraries/js.xml new file mode 100644 index 0000000..8ddfdf9 --- /dev/null +++ b/.idea/libraries/js.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..89f6201 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,95 @@ +module.exports = function(grunt) { + 'use strict'; + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + sass: { + options: { + includePaths: [ + './node_modules/bootstrap-sass/assets/stylesheets', + './node_modules/font-awesome/scss/' + ] + }, + dist: { + options: { + outputStyle: 'compressed' + }, + files: { + './static/css/style.css': './cloth/scss/style.scss' + } + } + }, + copy: { + main: { + files: [ + { + flatten:true, + cwd: './node_modules/font-awesome/fonts/', + src: ['*.*'], + dest: './static/fonts/', + expand: true + }, + { + flatten:true, + cwd: './cloth/img/', + src: ['*.png', '*.jpg', '*.gif'], + dest: './static/img/', + expand: true + }, + ] + } + }, + webpack: { + main: { + entry: { + main: "./cloth/main.js", + }, + output: { + path: "./static/js", + publicPath: "/static/js", + filename: "main.js", + + }, + module: { + loaders: [ + { test: /\.jsx?$/, exclude: /node_modules/, loader: "babel" } + ] + }, + }, + }, + watch: { + scss: { + files: [ + //watched files + './cloth/*.scss', + ], + tasks: ['sass'], + }, + js : { + files: [ + './cloth/**/*.jsx', + './cloth/**/*.js', + './cloth/*.js', + ], + tasks: ['copy:main', 'webpack:main'], + }, + config: { + files: [ + 'Gruntfile.js', + 'bower.json', + 'package.json' + ], + tasks: ['copy', 'sass', 'webpack'], + } + } + }); + // Plugin loading + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-webpack'); + grunt.loadNpmTasks('grunt-sass'); + + // Task definition + grunt.registerTask('build', ['copy', 'sass', 'webpack']); + grunt.registerTask('default', ['build', 'watch']); + +}; \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index a188dc5..9bb9c25 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ +include requirements.txt recursive-include ltmo/static/ * recursive-include ltmo/templates/ * exclude ltmo/local_settings.py diff --git a/README.md b/README.md new file mode 100644 index 0000000..79dcb5e --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +¿Qué es lo que observa? +============= + +Este repositorio contiene tanto el código del sitio. + +Asumimos una máquina en algún linux corriendo alguna versión reciente de python. +Debería andar en cualquier lado que python sea instalable. + +El sitio está hecho en [django](http://djangoproject.com) y tiene muy pocas dependencias, la mejor manera de tener una instancia corriendo es: + +### para desarrollo: + + $ virtualenv ltmo + $ source ltmo/bin/activate + (ltmo)$ cd /path/to/clone + (ltmo)$ pip install -r requirements.txt + (ltmo)$ python setup.py develop + (ltmo)$ ltmo migrate + (ltmo)$ ltmo runserver + +Una instancia queda corriendo en http://localhost:8000. + +### frontend + +Usamos un toolchain que consta de [npm](http://npm.io), [grunt](http://grunt.io), [bower](http://bower.io). Se instala más o menos así: + + $ cd /path/to/clone + $ npm install # descarga dependencias de desarrollo. + $ bower install # descarga bibliotecas para el cliente. + $ grunt # observa cambios en una serie de archivos y ejecuta acciones. + +Esto resulta en una carpeta `static` en la raíz de tu copia local. + +### para producción: + + $ pip install ltmo # sudo si es necesario. + +Vea [[notas de instalación|Deployment]] para saber como instalarlo en un servidor en particular. + + + +## ¿Y qué pasa con el resto? + +Todo lo que envíes con spill se manda a ltmo.com.ar ahí vamos a ir agregando cosas a medida que tengamos más tiempo para perder aceite. + +No sabemos muy bien de que se trata todo esto pero somos lo que hacemos + + +[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/tutuca/ltmo/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/README.mkd b/README.mkd deleted file mode 100644 index 036f24d..0000000 --- a/README.mkd +++ /dev/null @@ -1,33 +0,0 @@ -¿Qué es lo que observa? -============= -Nunca hay suficiente redundancia para garantizar la continuidad de la información. - -Este es un experimento, una herramienta para evitar perder cosas que en algún momento nos resultaron interesantes. -Hay un [script de linea de comandos](http://github.com/etnalubma/spill) con el que envías cosas a algo que se parece a un blog y está hosteado en http://ltmo.com.ar/ - -Este repositorio contiene tanto el código del sitio. - -El sitio está hecho en [django](http://djangoproject.com) y tiene muy pocas dependencias, la mejor manera de tener una instancia corriendo es con pip - - $ pip install -r requirements.txt -E ltmo_venv - -Si no tenés pip y virtualenv (por qué no???): - - $ sudo easy_install pip - $ sudo easy_install virtualenv - -Ahora sólo debés sincronizar la base de datos y correr el sitio: - - $ ./manage.py syncdb - $ ./manage.py runserver - -¿Y qué pasa con el resto? ---------------- - -Todo lo que envíes con spill se manda a ltmo.com.ar ahí vamos a ir agregando cosas a medida que tengamos más tiempo para perder aceite. - -No sabemos muy bien de que se trata todo esto pero somos lo que hacemos - - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/tutuca/ltmo/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - diff --git a/banners/__init__.py b/banners/__init__.py new file mode 100644 index 0000000..eff2b26 --- /dev/null +++ b/banners/__init__.py @@ -0,0 +1 @@ +default_app_config = 'banners.apps.BannersAppConfig' \ No newline at end of file diff --git a/banners/admin.py b/banners/admin.py new file mode 100644 index 0000000..fd473f9 --- /dev/null +++ b/banners/admin.py @@ -0,0 +1,5 @@ +from django.contrib import admin +from . import models +# Add your admin site registrations here, eg. +# from banners.models import Author +admin.site.register(models.Banner) diff --git a/banners/apps.py b/banners/apps.py new file mode 100644 index 0000000..000ecae --- /dev/null +++ b/banners/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class BannersAppConfig(AppConfig): + name = 'banners' + verbose_name = 'Banner' diff --git a/banners/migrations/0001_initial.py b/banners/migrations/0001_initial.py new file mode 100644 index 0000000..c4de856 --- /dev/null +++ b/banners/migrations/0001_initial.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import taggit.managers + + +class Migration(migrations.Migration): + + dependencies = [ + ('taggit', '0002_auto_20141128_0837'), + ] + + operations = [ + migrations.CreateModel( + name='Banner', + fields=[ + ('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')), + ('code', models.TextField(blank=True, null=True, max_length=1024)), + ('clicks', models.PositiveIntegerField(blank=True, default=0)), + ('views', models.PositiveIntegerField(blank=True, default=0)), + ], + ), + migrations.CreateModel( + name='TemplateBanner', + fields=[ + ('banner_ptr', models.OneToOneField(parent_link=True, to='banners.Banner', auto_created=True, serialize=False, primary_key=True)), + ('image', models.ImageField(upload_to='banners', null=True)), + ('url', models.URLField(blank=True)), + ('template', models.CharField(default='banner.html', max_length=70)), + ], + bases=('banners.banner',), + ), + migrations.AddField( + model_name='banner', + name='slot', + field=taggit.managers.TaggableManager(verbose_name='Tags', to='taggit.Tag', through='taggit.TaggedItem', help_text='A comma-separated list of tags.'), + ), + ] diff --git a/ltmo/management/__init__.py b/banners/migrations/__init__.py similarity index 100% rename from ltmo/management/__init__.py rename to banners/migrations/__init__.py diff --git a/banners/models.py b/banners/models.py new file mode 100644 index 0000000..ac0f1fb --- /dev/null +++ b/banners/models.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- + +from django.db import models +from taggit.managers import TaggableManager +from django.template.loader import render_to_string +from django.template.defaultfilters import slugify +from django.template import Context, Template + + +class Banner(models.Model): + code = models.TextField(max_length=1024, blank=True, null=True) + slot = TaggableManager() + clicks = models.PositiveIntegerField(default=0, blank=True) + views = models.PositiveIntegerField(default=0, blank=True) + + def __unicode__(self): + return "Banner #%s on %s" % (self.pk, self.slot) + + def render_code(self): + template = Template(self.code) + return template.render(Context({'object': self, })) + + +class TemplateBanner(Banner): + image = models.ImageField(upload_to='banners', null=True) + url = models.URLField(blank=True) + template = models.CharField(max_length=70, default='banner.html') + + def __unicode__(self): + return "%s" % (slugify(self.pk, self.slot),) + + def show_in_list(self): + self.views += 1 + return render_to_string( + self.template, + { + 'object': self, + } + ) diff --git a/ltmo/management/commands/__init__.py b/banners/templates/__init__.py similarity index 100% rename from ltmo/management/commands/__init__.py rename to banners/templates/__init__.py diff --git a/ltmo/templates/banner.html b/banners/templates/banner.html similarity index 100% rename from ltmo/templates/banner.html rename to banners/templates/banner.html diff --git a/ltmo/templates/single.html b/banners/templates/single.html similarity index 100% rename from ltmo/templates/single.html rename to banners/templates/single.html diff --git a/ltmo/templates/slot.html b/banners/templates/slot.html similarity index 61% rename from ltmo/templates/slot.html rename to banners/templates/slot.html index 8ec1f50..ea3a300 100644 --- a/ltmo/templates/slot.html +++ b/banners/templates/slot.html @@ -1,4 +1,3 @@ {% for banner in banners %} -{{banner.code|safe}} +{{banner.code|safe}} {% endfor %} - diff --git a/ltmo/migrations/__init__.py b/banners/templatetags/__init__.py similarity index 100% rename from ltmo/migrations/__init__.py rename to banners/templatetags/__init__.py diff --git a/banners/templatetags/banner_tags.py b/banners/templatetags/banner_tags.py new file mode 100644 index 0000000..346d2e9 --- /dev/null +++ b/banners/templatetags/banner_tags.py @@ -0,0 +1,22 @@ +from django import template +from banners.models import Banner +from random import choice +register = template.Library() + + +@register.inclusion_tag('single.html') +def pop_slot(slot): + banner = None + banners = Banner.objects.filter(slot__name=slot) + if banners: + banner = choice(banners) + return {'banner': banner} + + +@register.inclusion_tag('slot.html') +def lookup_banners(slot): + try: + banners = Banner.objects.filter(slot__name__icontains=slot) + except Banner.DoesNotExists: + banners = None + return {'banners': banners} diff --git a/banners/views.py b/banners/views.py new file mode 100644 index 0000000..60f00ef --- /dev/null +++ b/banners/views.py @@ -0,0 +1 @@ +# Create your views here. diff --git a/ltmo/sass/_pygments.scss b/cloth/_pygments.scss similarity index 100% rename from ltmo/sass/_pygments.scss rename to cloth/_pygments.scss diff --git a/ltmo/sass/_solarized.scss b/cloth/_solarized.scss similarity index 100% rename from ltmo/sass/_solarized.scss rename to cloth/_solarized.scss diff --git a/ltmo/sass/_base.scss b/cloth/_variables.scss similarity index 83% rename from ltmo/sass/_base.scss rename to cloth/_variables.scss index b687aaa..0a1116c 100644 --- a/ltmo/sass/_base.scss +++ b/cloth/_variables.scss @@ -1,28 +1,13 @@ -$base03: #010204; -$base02: #4D2219; -$base01: #586e75; -$base00: #657b83; -$base0: #AFDE9C; -$base1: #E8F7EE; -$base2: #eee8d5; -$base3: #fdf6e3; -$yellow: #b58900; -$orange: #cb4b16; -$red: #dc322f; -$magenta: #d33682; -$violet: #6c71c4; -$blue: #268bd2; -$cyan: #2aa198; -$green: #859900; -$fg_color: $blue; - +@import 'bootstrap'; +@import 'font-awesome'; +@import 'pygments'; @mixin transition ($time) { -moz-transition: all $time; -webkit-transition: all $time; transition: all $time; } @mixin gradient($color, $direction:top) { - background-image: -webkit-linear-gradient($direction, $color, darken($color, 10%)); + background-image: -webkit-linear-gradient($direction, $color, darken($color, 10%)); background-image: -moz-linear-gradient($direction, $color, darken($color, 10%)); background-image: -ms-linear-gradient($direction, $color, darken($color, 10%)); background-image: -o-linear-gradient($direction, $color, darken($color, 10%)); @@ -38,9 +23,9 @@ $fg_color: $blue; text-shadow: 0 1px 1px #333; margin:0 0.3em; color: $fg; - + &:active { - @include transition(0.1s); + @include transition(0.1s); @include gradient($bg, 'bottom'); } &:hover{ diff --git a/cloth/main.js b/cloth/main.js new file mode 100644 index 0000000..901f842 --- /dev/null +++ b/cloth/main.js @@ -0,0 +1,66 @@ +var $ = require('jquery'), + utils = require('./utils'); + +$(function () { + 'use strict'; + var hash = window.location.hash; + if (hash) { + $(window).scrollTop($(hash).offset().top - 55); + } + + $('.ui-autocomplete-input').on('autocompleteopen', function () { + var autocomplete = $(this).data('autocomplete'), + menu = autocomplete.menu; + menu.activate($.Event({ type: 'mouseenter' }), menu.element.children().first()); + }); + $('#id_tags').on('keydown', function (event) { + // don't navigate away from the field on tab when selecting an item + if (event.keyCode === $.ui.keyCode.TAB && + $(this).data('autocomplete').menu.active) { + event.preventDefault(); + } + }).autocomplete({ + source: function (request, response) { + $.getJSON('/tags/', { + tag_name: utils.extractLast(request.term) + }, response); + }, + search: function () { + var term = utils.extractLast(this.value); + if (term.length < 2) { + return false; + } + }, + focus: function () { + return false; + }, + select: function (event, ui) { + event.preventDefault(); + var terms = split(this.value); + terms.pop(); + terms.push(ui.item.value); + terms.push(''); + this.value = terms.join('', ''); + } + }); + $('.control').on('click', function (event) { + event.preventDefault(); + var target = $(this).attr('href'); + $(target).toggle('blind', 300); + if (target === '#leak-form') { + window.setTimeout(function () { + $('#id_description').focus(); + $('#leak-form').bind('keydown', function (event) { + if (event.keyCode === $.ui.keyCode.ESCAPE) { + $('#leak-form').hide('blind', 500) + .unbind('keydown'); + } + }); + }, 400); + } + }); + utils.setLayout(); + window.setTimeout(function () { + $('#messages .control').click(); + }, 1000); +}); diff --git a/cloth/style.scss b/cloth/style.scss new file mode 100644 index 0000000..878d937 --- /dev/null +++ b/cloth/style.scss @@ -0,0 +1,2 @@ +@import 'variables'; + diff --git a/cloth/utils.js b/cloth/utils.js new file mode 100644 index 0000000..d1cef03 --- /dev/null +++ b/cloth/utils.js @@ -0,0 +1,71 @@ +function viewport() { + var e = window, + a = 'inner'; + if (!('innerWidth' in window)) { + a = 'client'; + e = document.documentElement || document.body; + } + return { width : e[a + 'Width'], height : e[a + 'Height']}; +} + +function setLayout() { + var vp = viewport(), + padding, visible_height, visible_width, + main_img, old_img_width, new_img_width, width_delta; + + padding = $('header').height() * 7; + visible_height = vp.height - padding; + visible_width = $('#main article').width(); + main_img = $('article img')[0]; + if (main_img) { + fit(main_img, false, 15); + } +} +function split(val) { + return val.split(/,\s*/); +} +function extractLast(term) { + return split(term).pop(); +} + + +function fit(selector, to, padding){ + var visible_height, visible_width, + old_height, old_width, + delta, landscape; + padding = padding || 0; + if (to) { + visible_height = $(to).height() - padding; + visible_width = $(to).width() - padding; + } else { + var vp = viewport(); + visible_height = vp.height - padding; + visible_width = vp.width - padding; + + } + $(selector).each(function() { + var $el = $(this); + old_width = $el.width(); + old_height = $el.height(); + landscape = old_width > old_height; + if (landscape) { + $el.css({ + width: Math.floor(visible_height / old_height * old_width), + height: 'auto' + }); + } else { + $el.css({ + height: visible_height, + width: 'auto' + }); + } + /* delta = (visible_width - $el.width())/2; + $(this).css('margin-left', delta); */ + }); + +} + +module.exports.fit = fit; +module.exports.viewport = viewport; +module.exports.setLayout = setLayout; +module.exports.extractLast = extractLast; \ No newline at end of file diff --git a/developer_requirements.txt b/developer_requirements.txt new file mode 100644 index 0000000..e903ce8 --- /dev/null +++ b/developer_requirements.txt @@ -0,0 +1,3 @@ +-r requirements.txt +ipdb==0.8 +django-debug-toolbar \ No newline at end of file diff --git a/leaks/__init__.py b/leaks/__init__.py new file mode 100644 index 0000000..8a066ef --- /dev/null +++ b/leaks/__init__.py @@ -0,0 +1 @@ +default_app_config = 'leaks.apps.LeakAppConfig' diff --git a/leaks/admin.py b/leaks/admin.py new file mode 100644 index 0000000..d22e986 --- /dev/null +++ b/leaks/admin.py @@ -0,0 +1,8 @@ +from django.contrib import admin +from leaks.models import Leak + +class LeakAdmin(admin.ModelAdmin): + list_display = ('__unicode__', 'tags', 'author', 'created') + list_filter = ('author', 'created') + +admin.site.register(Leak, LeakAdmin) diff --git a/leaks/apps.py b/leaks/apps.py new file mode 100644 index 0000000..cd50b99 --- /dev/null +++ b/leaks/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class LeakAppConfig(AppConfig): + name = 'leaks' + verbose_name = 'Oil Leaks' diff --git a/ltmo/feeds.py b/leaks/feeds.py similarity index 94% rename from ltmo/feeds.py rename to leaks/feeds.py index 71118b2..94e6e92 100644 --- a/ltmo/feeds.py +++ b/leaks/feeds.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from django.contrib.syndication.views import Feed -from ltmo.models import Leak +from leaks.models import Leak class LeakFeed(Feed): title = "Recientemente derramado" diff --git a/ltmo/forms.py b/leaks/forms.py similarity index 82% rename from ltmo/forms.py rename to leaks/forms.py index 301f030..20cb719 100644 --- a/ltmo/forms.py +++ b/leaks/forms.py @@ -1,33 +1,29 @@ from django import forms -from tagging.forms import TagField - -from ltmo.models import Leak from django.contrib.auth.models import User +from leaks.models import Leak + class LeakForm(forms.ModelForm): - tags = TagField(required=True) author = forms.CharField(widget=forms.HiddenInput, required=True) class Meta: model = Leak exclude = ['rendered','metadata'] -from django import forms - class RegisterForm(forms.Form): - + #XXX: Should not be here. honeypot = forms.CharField(widget=forms.HiddenInput, required=False) username = forms.SlugField() email = forms.EmailField() - - + + def clean_username(self): data = self.cleaned_data['username'] try: user = User.objects.get(username=data) except User.DoesNotExist: user = None - + if user is not None: raise forms.ValidationError("El usuario ya existe") diff --git a/ltmo/templatetags/__init__.py b/leaks/management/__init__.py similarity index 100% rename from ltmo/templatetags/__init__.py rename to leaks/management/__init__.py diff --git a/leaks/management/commands/__init__.py b/leaks/management/commands/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ltmo/management/commands/update.py b/leaks/management/commands/update.py similarity index 100% rename from ltmo/management/commands/update.py rename to leaks/management/commands/update.py diff --git a/ltmo/management/commands/updateleaks.py b/leaks/management/commands/updateleaks.py similarity index 83% rename from ltmo/management/commands/updateleaks.py rename to leaks/management/commands/updateleaks.py index 74c8a1a..4d6d9a9 100644 --- a/ltmo/management/commands/updateleaks.py +++ b/leaks/management/commands/updateleaks.py @@ -6,10 +6,10 @@ class Command(BaseCommand): def handle(self, *args, **options): for leak in Leak.objects.all(): - + try: leak.save() except Exception as e: self.stdout.write(e.message+'\n') else: - self.stdout.write('Saving leak %s \n' %leak.id) \ No newline at end of file + self.stdout.write('Saving leak %s \n' %leak.id) \ No newline at end of file diff --git a/leaks/management/management/__init__.py b/leaks/management/management/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/leaks/management/management/commands/__init__.py b/leaks/management/management/commands/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/leaks/management/management/commands/update.py b/leaks/management/management/commands/update.py new file mode 100644 index 0000000..3cff3af --- /dev/null +++ b/leaks/management/management/commands/update.py @@ -0,0 +1,13 @@ +from django.core.management.base import BaseCommand, CommandError +from ltmo.models import Leak + +class Command(BaseCommand): + """docstring for Command""" + def handle(self, *args, **kwargs): + leaks = Leak.objects.all() + for l in leaks: + self.stderr.write("Updating %s" % l.pk) + try: + l.save() + except (Exception, ) as e: + self.stderr.write('%s' %e) diff --git a/leaks/management/management/commands/updateleaks.py b/leaks/management/management/commands/updateleaks.py new file mode 100644 index 0000000..4d6d9a9 --- /dev/null +++ b/leaks/management/management/commands/updateleaks.py @@ -0,0 +1,15 @@ +from django.core.management.base import BaseCommand +from ltmo.models import Leak + +class Command(BaseCommand): + help = 'Updates leaks saving every leak available.' + + def handle(self, *args, **options): + for leak in Leak.objects.all(): + + try: + leak.save() + except Exception as e: + self.stdout.write(e.message+'\n') + else: + self.stdout.write('Saving leak %s \n' %leak.id) \ No newline at end of file diff --git a/ltmo/mdx_urlize.py b/leaks/mdx_urlize.py similarity index 63% rename from ltmo/mdx_urlize.py rename to leaks/mdx_urlize.py index c01f5eb..940bd1a 100644 --- a/ltmo/mdx_urlize.py +++ b/leaks/mdx_urlize.py @@ -3,47 +3,12 @@ Inspired by Django's urlize function. Positive examples: - ->>> import markdown ->>> md = markdown.Markdown(extensions=['urlize']) - ->>> md.convert('http://example.com/') -u'

http://example.com/

' - ->>> md.convert('go to http://example.com') -u'

go to http://example.com

' - ->>> md.convert('example.com') -u'

example.com

' - ->>> md.convert('example.net') -u'

example.net

' - ->>> md.convert('www.example.us') -u'

www.example.us

' - ->>> md.convert('(www.example.us/path/?name=val)') -u'

(www.example.us/path/?name=val)

' - ->>> md.convert('go to now!') -u'

go to http://example.com now!

' - ->>> md.convert('http://example.com/abc.png') -u'' - -Negative examples: - ->>> md.convert('del.icio.us') -u'

del.icio.us

' - """ import markdown import urllib import os -from StringIO import StringIO from hashlib import sha1 -from PIL import Image from django.conf import settings from markdown.util import etree, AtomicString @@ -58,8 +23,6 @@ ]) def process_image(image_url): - - file_type = guess_type(image_url) ext = file_type[0].split('/')[1] image_name = '.'.join((sha1(image_url).hexdigest()[:6], ext)) @@ -68,19 +31,19 @@ def process_image(image_url): if not os.path.exists(image_path): from ipdb import set_trace; set_trace() urllib.urlretrieve(image_url, image_path) - + return '/'.join((settings.UPLOAD_URL, image_name)) class UrlizePattern(markdown.inlinepatterns.Pattern): """ Return a link Element given an autolink (`http://example/com`). """ def handleMatch(self, m): url = m.group(2) - + if url.startswith('<'): url = url[1:-1] - + text = url - + if not url.split('://')[0] in ('http','https','ftp'): if '@' in url and not '/' in url: url = 'mailto:' + url @@ -101,11 +64,9 @@ class UrlizeExtension(markdown.Extension): def extendMarkdown(self, md, md_globals): """ Replace autolink with UrlizePattern """ + md.registerExtension(self) md.inlinePatterns['urlize'] = UrlizePattern(URLIZE_RE, md) def makeExtension(configs=None): + if configs is None: configs = {} return UrlizeExtension(configs=configs) - -if __name__ == "__main__": - import doctest - doctest.testmod() diff --git a/leaks/mdx_video.py b/leaks/mdx_video.py new file mode 100644 index 0000000..fde11f1 --- /dev/null +++ b/leaks/mdx_video.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python + +""" +Embeds web videos using URLs. For instance, if a URL to an youtube video is +found in the text submitted to markdown and it isn't enclosed in parenthesis +like a normal link in markdown, then the URL will be swapped with a embedded +youtube video. + +All resulting HTML is XHTML Strict compatible. +""" + +import markdown +from markdown.util import etree + +version = "0.1.6" + +class VideoExtension(markdown.Extension): + def __init__(self, configs): + self.config = { + 'bliptv_width': ['480', 'Width for Blip.tv videos'], + 'bliptv_height': ['300', 'Height for Blip.tv videos'], + 'dailymotion_width': ['480', 'Width for Dailymotion videos'], + 'dailymotion_height': ['405', 'Height for Dailymotion videos'], + 'gametrailers_width': ['480', 'Width for Gametrailers videos'], + 'gametrailers_height': ['392', 'Height for Gametrailers videos'], + 'metacafe_width': ['498', 'Width for Metacafe videos'], + 'metacafe_height': ['423', 'Height for Metacafe videos'], + 'veoh_width': ['410', 'Width for Veoh videos'], + 'veoh_height': ['341', 'Height for Veoh videos'], + 'vimeo_width': ['400', 'Width for Vimeo videos'], + 'vimeo_height': ['321', 'Height for Vimeo videos'], + 'yahoo_width': ['512', 'Width for Yahoo! videos'], + 'yahoo_height': ['322', 'Height for Yahoo! videos'], + 'youtube_width': ['425', 'Width for Youtube videos'], + 'youtube_height': ['344', 'Height for Youtube videos'], + } + + # Override defaults with user settings + for key, value in configs: + self.setConfig(key, value) + + def add_inline(self, md, name, klass, re): + pattern = klass(re) + pattern.md = md + pattern.ext = self + md.inlinePatterns.add(name, pattern, "\S+.flv)') + self.add_inline(md, 'dailymotion', Dailymotion, + r'([^(]|^)http://www\.dailymotion\.com/(?P\S+)') + self.add_inline(md, 'gametrailers', Gametrailers, + r'([^(]|^)http://www.gametrailers.com/video/[a-z0-9-]+/(?P\d+)') + self.add_inline(md, 'metacafe', Metacafe, + r'([^(]|^)http://www\.metacafe\.com/watch/(?P\S+)/') + self.add_inline(md, 'veoh', Veoh, + r'([^(]|^)http://www\.veoh\.com/\S*(#watch%3D|watch/)(?P\w+)') + self.add_inline(md, 'vimeo', Vimeo, + r'([^(]|^)http://(www.|)vimeo\.com/(?P\d+)\S*') + self.add_inline(md, 'yahoo', Yahoo, + r'([^(]|^)http://video\.yahoo\.com/watch/(?P\d+)/(?P\d+)') + # http://www.youtube.com/watch?v=R2fwHjLvvk4&feature=rec-LGOUT-exp_stronger_r2-2r-1-HM + # http://www.youtube.com/v/0Xfh5iBBh4Y?fs=1&hl=en_US + self.add_inline(md, 'youtube', Youtube, + r'([^("\']|^)http://www\.youtube\.com/(?:watch\?\S*v=|v\/)(?P[A-Za-z0-9_&=-]+)\S*') + +class Bliptv(markdown.inlinepatterns.Pattern): + def handleMatch(self, m): + url = 'http://blip.tv/scripts/flash/showplayer.swf?file=http://blip.tv/file/get/%s' % m.group('bliptvfile') + width = self.ext.config['bliptv_width'][0] + height = self.ext.config['bliptv_height'][0] + return flash_object(url, width, height) + +class Dailymotion(markdown.inlinepatterns.Pattern): + def handleMatch(self, m): + url = 'http://www.dailymotion.com/swf/%s' % m.group('dailymotionid').split('/')[-1] + width = self.ext.config['dailymotion_width'][0] + height = self.ext.config['dailymotion_height'][0] + return flash_object(url, width, height) + +class Gametrailers(markdown.inlinepatterns.Pattern): + def handleMatch(self, m): + url = 'http://www.gametrailers.com/remote_wrap.php?mid=%s' % \ + m.group('gametrailersid').split('/')[-1] + width = self.ext.config['gametrailers_width'][0] + height = self.ext.config['gametrailers_height'][0] + return flash_object(url, width, height) + +class Metacafe(markdown.inlinepatterns.Pattern): + def handleMatch(self, m): + url = 'http://www.metacafe.com/fplayer/%s.swf' % m.group('metacafeid') + width = self.ext.config['metacafe_width'][0] + height = self.ext.config['metacafe_height'][0] + return flash_object(url, width, height) + +class Veoh(markdown.inlinepatterns.Pattern): + def handleMatch(self, m): + url = 'http://www.veoh.com/videodetails2.swf?permalinkId=%s' % m.group('veohid') + width = self.ext.config['veoh_width'][0] + height = self.ext.config['veoh_height'][0] + return flash_object(url, width, height) + +class Vimeo(markdown.inlinepatterns.Pattern): + def handleMatch(self, m): + url = 'http://vimeo.com/moogaloop.swf?clip_id=%s&server=vimeo.com' % m.group('vimeoid') + width = self.ext.config['vimeo_width'][0] + height = self.ext.config['vimeo_height'][0] + return flash_object(url, width, height) + +class Yahoo(markdown.inlinepatterns.Pattern): + def handleMatch(self, m): + url = "http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" + width = self.ext.config['yahoo_width'][0] + height = self.ext.config['yahoo_height'][0] + obj = flash_object(url, width, height) + param = etree.Element('param') + param.set('name', 'flashVars') + param.set('value', "id=%s&vid=%s" % (m.group('yahooid'), + m.group('yahoovid'))) + obj.append(param) + return obj + +class Youtube(markdown.inlinepatterns.Pattern): + def handleMatch(self, m): + url = 'http://www.youtube.com/v/%s' % m.group('youtubeargs') + width = self.ext.config['youtube_width'][0] + height = self.ext.config['youtube_height'][0] + return flash_object(url, width, height) + +def flash_object(url, width, height): + obj = etree.Element('object') + obj.set('type', 'application/x-shockwave-flash') + obj.set('width', width) + obj.set('height', height) + obj.set('data', url) + param = etree.Element('param') + param.set('name', 'movie') + param.set('value', url) + obj.append(param) + param = etree.Element('param') + param.set('name', 'wmode') + param.set('value', 'opaque') + obj.append(param) + param = etree.Element('param') + param.set('name', 'allowFullScreen') + param.set('value', 'true') + obj.append(param) + #param = etree.Element('param') + #param.set('name', 'allowScriptAccess') + #param.set('value', 'sameDomain') + #obj.append(param) + return obj + +def makeExtension(configs=None) : + if configs is None: configs = {} + return VideoExtension(configs=configs) diff --git a/leaks/migrations/0001_initial.py b/leaks/migrations/0001_initial.py new file mode 100644 index 0000000..53c0e84 --- /dev/null +++ b/leaks/migrations/0001_initial.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import taggit.managers + + +class Migration(migrations.Migration): + + dependencies = [ + ('taggit', '0002_auto_20141128_0837'), + ] + + operations = [ + migrations.CreateModel( + name='Leak', + fields=[ + ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), + ('slug', models.SlugField(null=True, blank=True, editable=False)), + ('title', models.CharField(max_length=126, null=True, blank=True)), + ('description', models.TextField()), + ('rendered', models.TextField(null=True, blank=True, editable=False)), + ('author', models.CharField(max_length=20, default='anon')), + ('created', models.DateTimeField(auto_now_add=True)), + ('changed', models.DateTimeField(auto_now=True)), + ('metadata', models.TextField(null=True, default='', blank=True)), + ('tags', taggit.managers.TaggableManager(to='taggit.Tag', help_text='A comma-separated list of tags.', through='taggit.TaggedItem', verbose_name='Tags')), + ], + ), + ] diff --git a/leaks/migrations/__init__.py b/leaks/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/leaks/models.py b/leaks/models.py new file mode 100644 index 0000000..5b58346 --- /dev/null +++ b/leaks/models.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +from django.db import models +from taggit.managers import TaggableManager +from django.contrib.auth.models import User +from django.template.defaultfilters import slugify +from markdown import markdown +from leaks.mdx_urlize import makeExtension as make_urlize +from leaks.mdx_video import makeExtension as make_video + + +class Leak(models.Model): + slug = models.SlugField(editable=False, blank=True, null=True) + title = models.CharField(max_length=126, blank=True, null=True) + description = models.TextField() + rendered = models.TextField(null=True, blank=True, editable=False) + author = models.CharField(max_length=20, default='anon') + created = models.DateTimeField(auto_now_add=True, editable=False) + changed = models.DateTimeField(auto_now=True, editable=False) + tags = TaggableManager() + metadata = models.TextField(default='', null=True, blank=True) + + def __unicode__(self): + return self.title or u'sin título' + + def get_user(self): + try: + user = User.objects.get(username=self.author) + except User.DoesNotExist: + user = None + return user + + @models.permalink + def get_absolute_url(self): + return ('leak_detail', [self.id]) + + def save(self, *args, **kwargs): + self.rendered = markdown( + self.description, + [make_urlize(), make_video(), 'codehilite'] + ) + self.slug = '%s-%s' % (slugify(self.title[:30]) or 'sin-titulo', self.pk) + super(Leak, self).save(*args, **kwargs) diff --git a/leaks/serializers.py b/leaks/serializers.py new file mode 100644 index 0000000..60d9ffc --- /dev/null +++ b/leaks/serializers.py @@ -0,0 +1,7 @@ +from rest_framework import serializers +from .models import Leak + + +class LeakSerializer(serializers.ModelSerializer): + class Meta: + model = Leak diff --git a/leaks/templatetags/__init__.py b/leaks/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ltmo/templatetags/gravatar.py b/leaks/templatetags/gravatar.py similarity index 99% rename from ltmo/templatetags/gravatar.py rename to leaks/templatetags/gravatar.py index 6c10bfb..2bc35cc 100644 --- a/ltmo/templatetags/gravatar.py +++ b/leaks/templatetags/gravatar.py @@ -27,6 +27,5 @@ def gravatar(email, size=50, rating='g', default=None): hash = hashlib.md5(email).hexdigest() url = 'http://www.gravatar.com/avatar/%s?s=%s&r=%s' % ( hash, size, rating) - - return """avatar""" % (url, size, size) + return """avatar""" % (url, size, size) diff --git a/leaks/tests.py b/leaks/tests.py new file mode 100644 index 0000000..a28d525 --- /dev/null +++ b/leaks/tests.py @@ -0,0 +1,138 @@ +from django.test import TestCase +from leaks.models import Leak +import markdown + + +class TestLeak(TestCase): + def setUp(self): + self.mock_content = { + 'title': 'This is a test leak', + 'description': '**some** [Markdown](http://markdown.org) text.', + 'author': 'pindonga' + } + self.expected_content = { + 'title': 'This is a test leak', + 'description': '**some** [Markdown](http://markdown.org) text.', + 'author': 'pindonga', + 'rendered': u'''

some Markdown text.

''' + } + self.leak = Leak.objects.create(**self.mock_content) + + def test_markdown_ok(self): + self.assertEquals(self.leak.rendered, self.expected_content['rendered']) + + +class TestUrlize(TestCase): + def setUp(self): + self.md = markdown.Markdown(extensions=['urlize']) + + def test_convert(self): + self.assertEqual(self.md.convert('http://example.com/'), + '

http://example.com/

', ) + + self.assertEqual(self.md.convert('go to http://example.com'), + u'

go to http://example.com

') + + self.assertEqual(self.md.convert('example.com'), + u'

example.com') + + self.assertEqual(self.md.convert('example.net'), + u'

example.net') + + self.assertEqual(self.md.convert('www.example.us'), + u'

www.example.us

') + + self.assertEqual(self.md.convert('(www.example.us/path/?name=val)'), + u'

(www.example.us/pat)h/?name=val)

') + + self.assertEqual(self.md.convert('go to now!'), + u'

go to http://example.com now!

)') + + self.assertEqual(self.md.convert('http://example.com/abc.png'), + u'') + + self.assertEqual(self.md.convert('del.icio.us'), + u'

del.icio.us

') + + +class TestVideo(TestCase): + def setUp(self): + self.md = markdown.Markdown(extensions=['video']) + + def test_video(self): + s = "http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/" + self.assertEqual(self.md.convert(s), + u'

') + + # Test Metacafe with arguments + self.assertEqual(self.md.convert(s), + u'

') + + self.assertEqual(self.md.convert("[Metacafe link](http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/)"), + u'

Metacafe link

') + + self.assertEqual(self.md.convert("\\http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/"), + u'

\\\\http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/

') + + self.assertEqual(self.md.convert("`http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/`"), + u'

http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/

') + + # Test Youtube + self.assertEqual(self.md.convert("http://www.youtube.com/watch?v=u1mA-0w8XPo&hd=1&fs=1&feature=PlayList&p=34C6046F7FEACFD3&playnext=1&playnext_from=PL&index=1"), + u'

') + + + # Test Youtube with argument + + self.assertEqual(markdown.markdown(s, extensions=['video(youtube_width=200,youtube_height=100)']), + u'

') + + # Test Youtube Link + + self.assertEqual(self.md.convert("[Youtube link](http://www.youtube.com/watch?v=u1mA-0w8XPo&feature=PlayList&p=34C6046F7FEACFD3&playnext=1&playnext_from=PL&index=1)"), + u'

Youtube link

') + + # Test HTML Youtube Link + + self.assertEqual(self.md.convert('Here is a link to a YouTube movie.'), + u'

Here is a link to a YouTube movie.

') + + # Test Dailymotion + self.assertEqual(self.md.convert("http://www.dailymotion.com/relevance/search/ut2004/video/x3kv65_ut2004-ownage_videogames"), + u'

') + + # Test Dailymotion again (Dailymotion and their crazy URLs) + self.assertEqual(self.md.convert("http://www.dailymotion.com/us/video/x8qak3_iron-man-vs-bruce-lee_fun"), + u'

') + + # Test Yahoo! Video + self.assertEqual(self.md.convert("http://video.yahoo.com/watch/1981791/4769603"), + u'

') + + # Test Veoh Video + self.assertEqual(self.md.convert("http://www.veoh.com/search/videos/q/mario#watch%3De129555XxCZanYD"), + u'

') + + # Test Veoh Video Again (More fun URLs) + self.assertEqual(self.md.convert("http://www.veoh.com/group/BigCatRescuers#watch%3Dv16771056hFtSBYEr"), + u'

') + + # Test Veoh Video Yet Again (Even more fun URLs) + self.assertEqual(self.md.convert("http://www.veoh.com/browse/videos/category/anime/watch/v181645607JyXPWcQ"), + u'

') + # Test Vimeo Video + self.assertEqual(self.md.convert("http://www.vimeo.com/1496152"), + u'

') + + # Test Vimeo Video with some GET values + + self.assertEqual(self.md.convert("http://vimeo.com/1496152?test=test"), + u'

') + + # Test Blip.tv + self.assertEqual(self.md.convert("http://blip.tv/file/get/Pycon-PlenarySprintIntro563.flv"), + u'

') + + # Test Gametrailers + self.assertEqual(self.md.convert("http://www.gametrailers.com/video/console-comparison-borderlands/58079"), + u'

') diff --git a/ltmo/views.py b/leaks/views.py similarity index 77% rename from ltmo/views.py rename to leaks/views.py index ae62256..fb71ccd 100644 --- a/ltmo/views.py +++ b/leaks/views.py @@ -6,11 +6,13 @@ from django.contrib.auth.models import User from django.http import HttpResponse from django.shortcuts import redirect, get_object_or_404, render -from tagging.models import Tag from django.contrib.auth.decorators import login_required -from ltmo.forms import LeakForm, RegisterForm -from ltmo.models import Leak - +from taggit.models import Tag +from rest_framework import viewsets +from rest_framework.permissions import IsAuthenticatedOrReadOnly +from .forms import LeakForm, RegisterForm +from .models import Leak +from .serializers import LeakSerializer def index(request): try: @@ -32,17 +34,15 @@ def index(request): def edit(request, id=None): if id: leak = get_object_or_404(Leak, pk=id) - form = LeakForm(instance=leak) + form = LeakForm(request.POST or None, instance=leak) else: - form = LeakForm(initial={'author':request.user.username}) leak = None + form = LeakForm(request.POST or None, initial={'author':request.user}) + + if form.is_valid(): + leak = form.save() + return redirect(leak.get_absolute_url()) - if request.method == 'POST': - form = LeakForm(request.POST, instance=leak) - if form.is_valid(): - leak = form.save() - return redirect(leak.get_absolute_url()) - return render( request, 'leak_form.html', @@ -64,13 +64,13 @@ def leak_detail(request, id=None): 'object': leak, } ) - + def by_tag(request, tag_name=None): queryset = Leak.objects.all().order_by('tags') form = LeakForm() if tag_name: - queryset = queryset.filter(tags__icontains=tag_name) + queryset = queryset.filter(tags__name__contains=tag_name) return render( request, @@ -88,10 +88,10 @@ def tags(request): if tag_name: queryset = queryset.filter(name__istartswith=tag_name) return HttpResponse( - json.dumps([x.name for x in queryset]), + json.dumps([x.name for x in queryset]), mimetype="application/json" ) - + def user_profile(request, username=None): if username is not None: author = get_object_or_404(User, username=username) @@ -124,10 +124,15 @@ def register(request,): return redirect('/') return render( - request, + request, 'register.html', { 'form': form, } ) +class LeakViewset(viewsets.ModelViewSet): + queryset = Leak.objects.all() + serializer_class = LeakSerializer + permission_classes = (IsAuthenticatedOrReadOnly, ) + paginate_by = 100 diff --git a/ltmo/config.rb b/ltmo/config.rb deleted file mode 100644 index 61d4481..0000000 --- a/ltmo/config.rb +++ /dev/null @@ -1,23 +0,0 @@ -# Require any additional compass plugins here. - -# Set this to the root of your project when deployed: -http_path = "/" -css_dir = "static/css" -sass_dir = "sass" -images_dir = "static/img" -javascripts_dir = "static/js" - -# You can select your preferred output style here (can be overridden via the command line): -output_style = :compact - -# To enable relative paths to assets via compass helper functions. Uncomment: -relative_assets = true - -# To disable debugging comments that display the original location of your selectors. Uncomment: -line_comments = false - -# If you prefer the indented syntax, you might want to regenerate this -# project again passing --syntax sass, or you can uncomment this: -# preferred_syntax = :sass -# and then run: -# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass diff --git a/ltmo/manage.py b/ltmo/manage.py index a7c847d..d4109c1 100755 --- a/ltmo/manage.py +++ b/ltmo/manage.py @@ -6,7 +6,7 @@ def do_manage(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ltmo.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv) - + if __name__ == "__main__": do_manage() diff --git a/ltmo/mdx_video.py b/ltmo/mdx_video.py deleted file mode 100644 index 9e61d74..0000000 --- a/ltmo/mdx_video.py +++ /dev/null @@ -1,285 +0,0 @@ -#!/usr/bin/env python - -""" -Embeds web videos using URLs. For instance, if a URL to an youtube video is -found in the text submitted to markdown and it isn't enclosed in parenthesis -like a normal link in markdown, then the URL will be swapped with a embedded -youtube video. - -All resulting HTML is XHTML Strict compatible. - ->>> import markdown - -Test Metacafe - ->>> s = "http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/" ->>> markdown.markdown(s, ['video']) -u'

' - - -Test Metacafe with arguments - ->>> markdown.markdown(s, ['video(metacafe_width=500,metacafe_height=425)']) -u'

' - - -Test Link To Metacafe - ->>> s = "[Metacafe link](http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/)" ->>> markdown.markdown(s, ['video']) -u'

Metacafe link

' - - -Test Markdown Escaping - ->>> s = "\\http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/" ->>> markdown.markdown(s, ['video']) -u'

\\\\http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/

' ->>> s = "`http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/`" ->>> markdown.markdown(s, ['video']) -u'

http://www.metacafe.com/watch/yt-tZMsrrQCnx8/pycon_2008_django_sprint_room/

' - - -Test Youtube - ->>> s = "http://www.youtube.com/watch?v=u1mA-0w8XPo&hd=1&fs=1&feature=PlayList&p=34C6046F7FEACFD3&playnext=1&playnext_from=PL&index=1" ->>> markdown.markdown(s, ['video']) -u'

' - - -Test Youtube with argument - ->>> markdown.markdown(s, ['video(youtube_width=200,youtube_height=100)']) -u'

' - - -Test Youtube Link - ->>> s = "[Youtube link](http://www.youtube.com/watch?v=u1mA-0w8XPo&feature=PlayList&p=34C6046F7FEACFD3&playnext=1&playnext_from=PL&index=1)" ->>> markdown.markdown(s, ['video']) -u'

Youtube link

' - - -Test HTML Youtube Link - ->>> s = 'Here is a link to a YouTube movie.' ->>> markdown.markdown(s, ['video']) -u'

Here is a link to a YouTube movie.

' - - -Test Dailymotion - ->>> s = "http://www.dailymotion.com/relevance/search/ut2004/video/x3kv65_ut2004-ownage_videogames" ->>> markdown.markdown(s, ['video']) -u'

' - - -Test Dailymotion again (Dailymotion and their crazy URLs) - ->>> s = "http://www.dailymotion.com/us/video/x8qak3_iron-man-vs-bruce-lee_fun" ->>> markdown.markdown(s, ['video']) -u'

' - - -Test Yahoo! Video - ->>> s = "http://video.yahoo.com/watch/1981791/4769603" ->>> markdown.markdown(s, ['video']) -u'

' - - -Test Veoh Video - ->>> s = "http://www.veoh.com/search/videos/q/mario#watch%3De129555XxCZanYD" ->>> markdown.markdown(s, ['video']) -u'

' - - -Test Veoh Video Again (More fun URLs) - ->>> s = "http://www.veoh.com/group/BigCatRescuers#watch%3Dv16771056hFtSBYEr" ->>> markdown.markdown(s, ['video']) -u'

' - - -Test Veoh Video Yet Again (Even more fun URLs) - ->>> s = "http://www.veoh.com/browse/videos/category/anime/watch/v181645607JyXPWcQ" ->>> markdown.markdown(s, ['video']) -u'

' - - -Test Vimeo Video - ->>> s = "http://www.vimeo.com/1496152" ->>> markdown.markdown(s, ['video']) -u'

' - -Test Vimeo Video with some GET values - ->>> s = "http://vimeo.com/1496152?test=test" ->>> markdown.markdown(s, ['video']) -u'

' - -Test Blip.tv - ->>> s = "http://blip.tv/file/get/Pycon-PlenarySprintIntro563.flv" ->>> markdown.markdown(s, ['video']) -u'

' - -Test Gametrailers - ->>> s = "http://www.gametrailers.com/video/console-comparison-borderlands/58079" ->>> markdown.markdown(s, ['video']) -u'

' -""" - -import markdown -from markdown.util import etree - -version = "0.1.6" - -class VideoExtension(markdown.Extension): - def __init__(self, configs): - self.config = { - 'bliptv_width': ['480', 'Width for Blip.tv videos'], - 'bliptv_height': ['300', 'Height for Blip.tv videos'], - 'dailymotion_width': ['480', 'Width for Dailymotion videos'], - 'dailymotion_height': ['405', 'Height for Dailymotion videos'], - 'gametrailers_width': ['480', 'Width for Gametrailers videos'], - 'gametrailers_height': ['392', 'Height for Gametrailers videos'], - 'metacafe_width': ['498', 'Width for Metacafe videos'], - 'metacafe_height': ['423', 'Height for Metacafe videos'], - 'veoh_width': ['410', 'Width for Veoh videos'], - 'veoh_height': ['341', 'Height for Veoh videos'], - 'vimeo_width': ['400', 'Width for Vimeo videos'], - 'vimeo_height': ['321', 'Height for Vimeo videos'], - 'yahoo_width': ['512', 'Width for Yahoo! videos'], - 'yahoo_height': ['322', 'Height for Yahoo! videos'], - 'youtube_width': ['425', 'Width for Youtube videos'], - 'youtube_height': ['344', 'Height for Youtube videos'], - } - - # Override defaults with user settings - for key, value in configs: - self.setConfig(key, value) - - def add_inline(self, md, name, klass, re): - pattern = klass(re) - pattern.md = md - pattern.ext = self - md.inlinePatterns.add(name, pattern, "\S+.flv)') - self.add_inline(md, 'dailymotion', Dailymotion, - r'([^(]|^)http://www\.dailymotion\.com/(?P\S+)') - self.add_inline(md, 'gametrailers', Gametrailers, - r'([^(]|^)http://www.gametrailers.com/video/[a-z0-9-]+/(?P\d+)') - self.add_inline(md, 'metacafe', Metacafe, - r'([^(]|^)http://www\.metacafe\.com/watch/(?P\S+)/') - self.add_inline(md, 'veoh', Veoh, - r'([^(]|^)http://www\.veoh\.com/\S*(#watch%3D|watch/)(?P\w+)') - self.add_inline(md, 'vimeo', Vimeo, - r'([^(]|^)http://(www.|)vimeo\.com/(?P\d+)\S*') - self.add_inline(md, 'yahoo', Yahoo, - r'([^(]|^)http://video\.yahoo\.com/watch/(?P\d+)/(?P\d+)') - # http://www.youtube.com/watch?v=R2fwHjLvvk4&feature=rec-LGOUT-exp_stronger_r2-2r-1-HM - # http://www.youtube.com/v/0Xfh5iBBh4Y?fs=1&hl=en_US - self.add_inline(md, 'youtube', Youtube, - r'([^("\']|^)http://www\.youtube\.com/(?:watch\?\S*v=|v\/)(?P[A-Za-z0-9_&=-]+)\S*') - -class Bliptv(markdown.inlinepatterns.Pattern): - def handleMatch(self, m): - url = 'http://blip.tv/scripts/flash/showplayer.swf?file=http://blip.tv/file/get/%s' % m.group('bliptvfile') - width = self.ext.config['bliptv_width'][0] - height = self.ext.config['bliptv_height'][0] - return flash_object(url, width, height) - -class Dailymotion(markdown.inlinepatterns.Pattern): - def handleMatch(self, m): - url = 'http://www.dailymotion.com/swf/%s' % m.group('dailymotionid').split('/')[-1] - width = self.ext.config['dailymotion_width'][0] - height = self.ext.config['dailymotion_height'][0] - return flash_object(url, width, height) - -class Gametrailers(markdown.inlinepatterns.Pattern): - def handleMatch(self, m): - url = 'http://www.gametrailers.com/remote_wrap.php?mid=%s' % \ - m.group('gametrailersid').split('/')[-1] - width = self.ext.config['gametrailers_width'][0] - height = self.ext.config['gametrailers_height'][0] - return flash_object(url, width, height) - -class Metacafe(markdown.inlinepatterns.Pattern): - def handleMatch(self, m): - url = 'http://www.metacafe.com/fplayer/%s.swf' % m.group('metacafeid') - width = self.ext.config['metacafe_width'][0] - height = self.ext.config['metacafe_height'][0] - return flash_object(url, width, height) - -class Veoh(markdown.inlinepatterns.Pattern): - def handleMatch(self, m): - url = 'http://www.veoh.com/videodetails2.swf?permalinkId=%s' % m.group('veohid') - width = self.ext.config['veoh_width'][0] - height = self.ext.config['veoh_height'][0] - return flash_object(url, width, height) - -class Vimeo(markdown.inlinepatterns.Pattern): - def handleMatch(self, m): - url = 'http://vimeo.com/moogaloop.swf?clip_id=%s&server=vimeo.com' % m.group('vimeoid') - width = self.ext.config['vimeo_width'][0] - height = self.ext.config['vimeo_height'][0] - return flash_object(url, width, height) - -class Yahoo(markdown.inlinepatterns.Pattern): - def handleMatch(self, m): - url = "http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" - width = self.ext.config['yahoo_width'][0] - height = self.ext.config['yahoo_height'][0] - obj = flash_object(url, width, height) - param = etree.Element('param') - param.set('name', 'flashVars') - param.set('value', "id=%s&vid=%s" % (m.group('yahooid'), - m.group('yahoovid'))) - obj.append(param) - return obj - -class Youtube(markdown.inlinepatterns.Pattern): - def handleMatch(self, m): - url = 'http://www.youtube.com/v/%s' % m.group('youtubeargs') - width = self.ext.config['youtube_width'][0] - height = self.ext.config['youtube_height'][0] - return flash_object(url, width, height) - -def flash_object(url, width, height): - obj = etree.Element('object') - obj.set('type', 'application/x-shockwave-flash') - obj.set('width', width) - obj.set('height', height) - obj.set('data', url) - param = etree.Element('param') - param.set('name', 'movie') - param.set('value', url) - obj.append(param) - param = etree.Element('param') - param.set('name', 'wmode') - param.set('value', 'opaque') - obj.append(param) - param = etree.Element('param') - param.set('name', 'allowFullScreen') - param.set('value', 'true') - obj.append(param) - #param = etree.Element('param') - #param.set('name', 'allowScriptAccess') - #param.set('value', 'sameDomain') - #obj.append(param) - return obj - -def makeExtension(configs=None) : - return VideoExtension(configs=configs) - -if __name__ == "__main__": - import doctest - doctest.testmod() diff --git a/ltmo/migrations/0001_initial.py b/ltmo/migrations/0001_initial.py deleted file mode 100644 index 7bde476..0000000 --- a/ltmo/migrations/0001_initial.py +++ /dev/null @@ -1,47 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding model 'Leak' - db.create_table('ltmo_leak', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50, db_index=True)), - ('title', self.gf('django.db.models.fields.CharField')(max_length=126, null=True, blank=True)), - ('description', self.gf('django.db.models.fields.TextField')()), - ('author', self.gf('django.db.models.fields.CharField')(default='Anonymous', max_length=20)), - ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('changed', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - ('tags', self.gf('tagging.fields.TagField')(default='random')), - ('metadata', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('ltmo', ['Leak']) - - - def backwards(self, orm): - - # Deleting model 'Leak' - db.delete_table('ltmo_leak') - - - models = { - 'ltmo.leak': { - 'Meta': {'object_name': 'Leak'}, - 'author': ('django.db.models.fields.CharField', [], {'default': "'Anonymous'", 'max_length': '20'}), - 'changed': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'metadata': ('django.db.models.fields.TextField', [], {}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}), - 'tags': ('tagging.fields.TagField', [], {'default': "'random'"}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '126', 'null': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['ltmo'] diff --git a/ltmo/migrations/0002_auto__add_field_leak_rendered.py b/ltmo/migrations/0002_auto__add_field_leak_rendered.py deleted file mode 100644 index f84b763..0000000 --- a/ltmo/migrations/0002_auto__add_field_leak_rendered.py +++ /dev/null @@ -1,37 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'Leak.rendered' - db.add_column('ltmo_leak', 'rendered', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - - def backwards(self, orm): - - # Deleting field 'Leak.rendered' - db.delete_column('ltmo_leak', 'rendered') - - - models = { - 'ltmo.leak': { - 'Meta': {'object_name': 'Leak'}, - 'author': ('django.db.models.fields.CharField', [], {'default': "'Anonymous'", 'max_length': '20'}), - 'changed': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'metadata': ('django.db.models.fields.TextField', [], {}), - 'rendered': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}), - 'tags': ('tagging.fields.TagField', [], {'default': "'random'"}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '126', 'null': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['ltmo'] diff --git a/ltmo/migrations/0003_auto__chg_field_leak_slug__del_unique_leak_slug__chg_field_leak_metada.py b/ltmo/migrations/0003_auto__chg_field_leak_slug__del_unique_leak_slug__chg_field_leak_metada.py deleted file mode 100644 index 8f1e845..0000000 --- a/ltmo/migrations/0003_auto__chg_field_leak_slug__del_unique_leak_slug__chg_field_leak_metada.py +++ /dev/null @@ -1,49 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Removing unique constraint on 'Leak', fields ['slug'] - db.delete_unique('ltmo_leak', ['slug']) - - # Changing field 'Leak.slug' - db.alter_column('ltmo_leak', 'slug', self.gf('django.db.models.fields.SlugField')(max_length=50, null=True)) - - # Changing field 'Leak.metadata' - db.alter_column('ltmo_leak', 'metadata', self.gf('django.db.models.fields.TextField')(null=True)) - - - def backwards(self, orm): - - # Changing field 'Leak.slug' - db.alter_column('ltmo_leak', 'slug', self.gf('django.db.models.fields.SlugField')(default='random', max_length=50, unique=True)) - - # Adding unique constraint on 'Leak', fields ['slug'] - db.create_unique('ltmo_leak', ['slug']) - - # Changing field 'Leak.metadata' - db.alter_column('ltmo_leak', 'metadata', self.gf('django.db.models.fields.TextField')(default='{}')) - - - models = { - 'ltmo.leak': { - 'Meta': {'object_name': 'Leak'}, - 'author': ('django.db.models.fields.CharField', [], {'default': "'Anonymous'", 'max_length': '20'}), - 'changed': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'metadata': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}), - 'rendered': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '50', 'null': 'True', 'blank': 'True'}), - 'tags': ('tagging.fields.TagField', [], {}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '126', 'null': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['ltmo'] diff --git a/ltmo/migrations/0004_auto__chg_field_leak_author.py b/ltmo/migrations/0004_auto__chg_field_leak_author.py deleted file mode 100644 index 3f48b55..0000000 --- a/ltmo/migrations/0004_auto__chg_field_leak_author.py +++ /dev/null @@ -1,83 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Renaming column for 'Leak.author' to match new field type. - db.rename_column('ltmo_leak', 'author', 'author_id') - # Changing field 'Leak.author' - db.alter_column('ltmo_leak', 'author_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)) - - # Adding index on 'Leak', fields ['author'] - db.create_index('ltmo_leak', ['author_id']) - - - def backwards(self, orm): - - # Removing index on 'Leak', fields ['author'] - db.delete_index('ltmo_leak', ['author_id']) - - # Renaming column for 'Leak.author' to match new field type. - db.rename_column('ltmo_leak', 'author_id', 'author') - # Changing field 'Leak.author' - db.alter_column('ltmo_leak', 'author', self.gf('django.db.models.fields.CharField')(max_length=20)) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'ltmo.leak': { - 'Meta': {'object_name': 'Leak'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), - 'changed': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'metadata': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}), - 'rendered': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '50', 'null': 'True', 'blank': 'True'}), - 'tags': ('tagging.fields.TagField', [], {}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '126', 'null': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['ltmo'] diff --git a/ltmo/migrations/0005_auto__chg_field_leak_title.py b/ltmo/migrations/0005_auto__chg_field_leak_title.py deleted file mode 100644 index e56a98f..0000000 --- a/ltmo/migrations/0005_auto__chg_field_leak_title.py +++ /dev/null @@ -1,73 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'Leak.title' - db.alter_column('ltmo_leak', 'title', self.gf('django.db.models.fields.CharField')(max_length=126)) - - - def backwards(self, orm): - - # Changing field 'Leak.title' - db.alter_column('ltmo_leak', 'title', self.gf('django.db.models.fields.CharField')(max_length=126, null=True)) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'ltmo.leak': { - 'Meta': {'object_name': 'Leak'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), - 'changed': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'metadata': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}), - 'rendered': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '50', 'null': 'True', 'blank': 'True'}), - 'tags': ('tagging.fields.TagField', [], {}), - 'title': ('django.db.models.fields.CharField', [], {'default': "'sin-titulo'", 'max_length': '126'}) - } - } - - complete_apps = ['ltmo'] diff --git a/ltmo/models.py b/ltmo/models.py index 8d820c9..e69de29 100644 --- a/ltmo/models.py +++ b/ltmo/models.py @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -from django.db import models -from tagging.fields import TagField -from tagging.utils import parse_tag_input -from django.contrib.auth.models import User -from django.contrib import admin -from django.template.defaultfilters import slugify -from markdown import markdown - - - -class Leak(models.Model): - slug = models.SlugField(editable=False, blank=True, null=True) - title = models.CharField(max_length=126, blank=True, null=True) - description = models.TextField() - rendered = models.TextField(null=True, blank=True, editable = False) - author = models.SlugField(max_length=20, default='anon') - created = models.DateTimeField(auto_now_add=True, editable = False) - changed = models.DateTimeField(auto_now=True, editable = False) - tags = TagField() - metadata = models.TextField(default='', null=True, blank=True) - - def __unicode__(self): - return self.title or u'sin título' - - def get_user(self): - try: - user = User.objects.get(username=self.author) - except User.DoesNotExist: - user = None - return user - - @models.permalink - def get_absolute_url(self): - return ('leak_detail', [self.id]) - - def save(self, *args, **kwargs): - self.rendered = markdown( - self.description, - ['ltmo.mdx_urlize', 'ltmo.mdx_video', 'codehilite'] - ) - self.tags = ','.join([slugify(x) for x in parse_tag_input(self.tags)]) - self.slug = '%s-%s' %(slugify(self.title[:30]) or 'sin-titulo', self.pk) - super(Leak, self).save(*args, **kwargs) - -class LeakAdmin(admin.ModelAdmin): - list_display = ('__unicode__', 'tags','author', 'created') - list_filter = ('author', 'created') - -admin.site.register(Leak, LeakAdmin) diff --git a/ltmo/sass/_fonts.scss b/ltmo/sass/_fonts.scss deleted file mode 100644 index 8144726..0000000 --- a/ltmo/sass/_fonts.scss +++ /dev/null @@ -1,271 +0,0 @@ -/*! - * Font Awesome 3.0.2 - * the iconic font designed for use with Twitter Bootstrap - * ------------------------------------------------------- - * The full suite of pictographic icons, examples, and documentation - * can be found at: http://fortawesome.github.com/Font-Awesome/ - * - * License - * ------------------------------------------------------- - * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL - * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - - * http://opensource.org/licenses/mit-license.html - * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ - * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: - * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" - * - * Contact - * ------------------------------------------------------- - * Email: dave@davegandy.com - * Twitter: http://twitter.com/fortaweso_me - * Work: Lead Product Designer @ http://kyruus.com - */ - -$fontAwesomePath: "../fonts" !default; -$borderColor: #eee; -$iconMuted: #eee; -@mixin border-radius($radius) { -webkit-border-radius: $radius; -moz-border-radius: $radius; border-radius: $radius; } - - -@font-face { - font-family: 'FontAwesome'; - src: url('#{$fontAwesomePath}/fontawesome-webfont.eot?v=3.0.1'); - src: url('#{$fontAwesomePath}/fontawesome-webfont.eot?#iefix&v=3.0.1') format("embedded-opentype"), - url('#{$fontAwesomePath}/fontawesome-webfont.woff?v=3.0.1') format("woff"), - url('#{$fontAwesomePath}/fontawesome-webfont.ttf?v=3.0.1') format("truetype"); - font-weight: normal; - font-style: normal; -} - -/* Font Awesome styles - ------------------------------------------------------- */ -[class^="icon-"], -[class*=" icon-"] { - font-family: FontAwesome; - font-weight: normal; - font-style: normal; - text-decoration: inherit; - -webkit-font-smoothing: antialiased; - - /* sprites.less reset */ - display: inline; - width: auto; - height: auto; - line-height: normal; - vertical-align: baseline; - background-image: none; - background-position: 0% 0%; - background-repeat: repeat; - margin-top: 0; -} - -/* more sprites.less reset */ -.icon-white, -.nav-pills > .active > a > [class^="icon-"], -.nav-pills > .active > a > [class*=" icon-"], -.nav-list > .active > a > [class^="icon-"], -.nav-list > .active > a > [class*=" icon-"], -.navbar-inverse .nav > .active > a > [class^="icon-"], -.navbar-inverse .nav > .active > a > [class*=" icon-"], -.dropdown-menu > li > a:hover > [class^="icon-"], -.dropdown-menu > li > a:hover > [class*=" icon-"], -.dropdown-menu > .active > a > [class^="icon-"], -.dropdown-menu > .active > a > [class*=" icon-"], -.dropdown-submenu:hover > a > [class^="icon-"], -.dropdown-submenu:hover > a > [class*=" icon-"] { - background-image: none; -} - -[class^="icon-"]:before, -[class*=" icon-"]:before { - text-decoration: inherit; - display: inline-block; - speak: none; -} - -/* makes sure icons active on rollover in links */ -a { - [class^="icon-"], - [class*=" icon-"] { - display: inline-block; - } -} - -/* makes the font 33% larger relative to the icon container */ -.icon-large:before { - vertical-align: -10%; - font-size: 1.3333333333333333em; -} - -.btn, .nav { - [class^="icon-"], - [class*=" icon-"] { - display: inline; - /* keeps button heights with and without icons the same */ - &.icon-large { line-height: .9em; } - &.icon-spin { display: inline-block; } - } -} - -.nav-tabs, .nav-pills { - [class^="icon-"], - [class*=" icon-"] { - /* keeps button heights with and without icons the same */ - &, &.icon-large { line-height: .9em; } - } -} - -li, .nav li { - [class^="icon-"], - [class*=" icon-"] { - display: inline-block; - width: 1.25em; - text-align: center; - &.icon-large { - /* increased font size for icon-large */ - width: 1.5625em; - } - } -} - -ul.icons { - list-style-type: none; - text-indent: -.75em; - - li { - [class^="icon-"], - [class*=" icon-"] { - width: .75em; - } - } -} - -.icon-muted { - color: $iconMuted; -} - -// Icon Borders -// ------------------------- - -.icon-border { - border: solid 1px $borderColor; - padding: .2em .25em .15em; - @include border-radius(3px); -} - -// Icon Sizes -// ------------------------- - -.icon-2x { - font-size: 2em; - &.icon-border { - border-width: 2px; - @include border-radius(4px); - } -} -.icon-3x { - font-size: 3em; - &.icon-border { - border-width: 3px; - @include border-radius(5px); - } -} -.icon-4x { - font-size: 4em; - &.icon-border { - border-width: 4px; - @include border-radius(6px); - } -} - -// Floats -// ------------------------- - -// Quick floats -.pull-right { float: right; } -.pull-left { float: left; } - -[class^="icon-"], -[class*=" icon-"] { - &.pull-left { - margin-right: .3em; - } - &.pull-right { - margin-left: .3em; - } -} - -.btn { - [class^="icon-"], - [class*=" icon-"] { - &.pull-left, &.pull-right { - &.icon-2x { margin-top: .18em; } - } - &.icon-spin.icon-large { line-height: .8em; } - } -} - -.btn.btn-small { - [class^="icon-"], - [class*=" icon-"] { - &.pull-left, &.pull-right { - &.icon-2x { margin-top: .25em; } - } - } -} - -.btn.btn-large { - [class^="icon-"], - [class*=" icon-"] { - margin-top: 0; // overrides bootstrap default - &.pull-left, &.pull-right { - &.icon-2x { margin-top: .05em; } - } - &.pull-left.icon-2x { margin-right: .2em; } - &.pull-right.icon-2x { margin-left: .2em; } - } -} - - -.icon-spin { - display: inline-block; - -moz-animation: spin 2s infinite linear; - -o-animation: spin 2s infinite linear; - -webkit-animation: spin 2s infinite linear; - animation: spin 2s infinite linear; -} - -@-moz-keyframes spin { - 0% { -moz-transform: rotate(0deg); } - 100% { -moz-transform: rotate(359deg); } -} -@-webkit-keyframes spin { - 0% { -webkit-transform: rotate(0deg); } - 100% { -webkit-transform: rotate(359deg); } -} -@-o-keyframes spin { - 0% { -o-transform: rotate(0deg); } - 100% { -o-transform: rotate(359deg); } -} -@-ms-keyframes spin { - 0% { -ms-transform: rotate(0deg); } - 100% { -ms-transform: rotate(359deg); } -} -@keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(359deg); } -} - -@-moz-document url-prefix() { - .icon-spin { height: .9em; } - .btn .icon-spin { height: auto; } - .icon-spin.icon-large { height: 1.25em; } - .btn .icon-spin.icon-large { height: .75em; } -} -.icon-user:before { content: "\f021"; } -.icon-home:before { content: "\f022"; } -.icon-tag:before { content: "\f023"; } -.icon-tint:before { content: "\f024"; } -.icon-question-sign:before { content: "\f025"; } -.icon-angle-left:before { content: "\f026"; } -.icon-angle-right:before { content: "\f027"; } diff --git a/ltmo/sass/fontawesome.scss b/ltmo/sass/fontawesome.scss deleted file mode 100644 index 384ee77..0000000 --- a/ltmo/sass/fontawesome.scss +++ /dev/null @@ -1,270 +0,0 @@ -/*! - * Font Awesome 3.0.2 - * the iconic font designed for use with Twitter Bootstrap - * ------------------------------------------------------- - * The full suite of pictographic icons, examples, and documentation - * can be found at: http://fortawesome.github.com/Font-Awesome/ - * - * License - * ------------------------------------------------------- - * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL - * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - - * http://opensource.org/licenses/mit-license.html - * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ - * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: - * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" - * - * Contact - * ------------------------------------------------------- - * Email: dave@davegandy.com - * Twitter: http://twitter.com/fortaweso_me - * Work: Lead Product Designer @ http://kyruus.com - */ - -$fontAwesomePath: "" !default; -$borderColor: #eee; -$iconMuted: #eee; -@mixin border-radius($radius) { -webkit-border-radius: $radius; -moz-border-radius: $radius; border-radius: $radius; } - - -@font-face { - font-family: 'FontAwesome'; - src: url('#{$fontAwesomePath}/fontawesome-webfont.eot?v=3.0.1'); - src: url('#{$fontAwesomePath}/fontawesome-webfont.eot?#iefix&v=3.0.1') format("embedded-opentype"), - url('#{$fontAwesomePath}/fontawesome-webfont.woff?v=3.0.1') format("woff"), - url('#{$fontAwesomePath}/fontawesome-webfont.ttf?v=3.0.1') format("truetype"); - font-weight: normal; - font-style: normal; -} - -/* Font Awesome styles - ------------------------------------------------------- */ -[class^="icon-"], -[class*=" icon-"] { - font-family: FontAwesome; - font-weight: normal; - font-style: normal; - text-decoration: inherit; - -webkit-font-smoothing: antialiased; - - /* sprites.less reset */ - display: inline; - width: auto; - height: auto; - line-height: normal; - vertical-align: baseline; - background-image: none; - background-position: 0% 0%; - background-repeat: repeat; - margin-top: 0; -} - -/* more sprites.less reset */ -.icon-white, -.nav-pills > .active > a > [class^="icon-"], -.nav-pills > .active > a > [class*=" icon-"], -.nav-list > .active > a > [class^="icon-"], -.nav-list > .active > a > [class*=" icon-"], -.navbar-inverse .nav > .active > a > [class^="icon-"], -.navbar-inverse .nav > .active > a > [class*=" icon-"], -.dropdown-menu > li > a:hover > [class^="icon-"], -.dropdown-menu > li > a:hover > [class*=" icon-"], -.dropdown-menu > .active > a > [class^="icon-"], -.dropdown-menu > .active > a > [class*=" icon-"], -.dropdown-submenu:hover > a > [class^="icon-"], -.dropdown-submenu:hover > a > [class*=" icon-"] { - background-image: none; -} - -[class^="icon-"]:before, -[class*=" icon-"]:before { - text-decoration: inherit; - display: inline-block; - speak: none; -} - -/* makes sure icons active on rollover in links */ -a { - [class^="icon-"], - [class*=" icon-"] { - display: inline-block; - } -} - -/* makes the font 33% larger relative to the icon container */ -.icon-large:before { - vertical-align: -10%; - font-size: 1.3333333333333333em; -} - -.btn, .nav { - [class^="icon-"], - [class*=" icon-"] { - display: inline; - /* keeps button heights with and without icons the same */ - &.icon-large { line-height: .9em; } - &.icon-spin { display: inline-block; } - } -} - -.nav-tabs, .nav-pills { - [class^="icon-"], - [class*=" icon-"] { - /* keeps button heights with and without icons the same */ - &, &.icon-large { line-height: .9em; } - } -} - -li, .nav li { - [class^="icon-"], - [class*=" icon-"] { - display: inline-block; - width: 1.25em; - text-align: center; - &.icon-large { - /* increased font size for icon-large */ - width: 1.5625em; - } - } -} - -ul.icons { - list-style-type: none; - text-indent: -.75em; - - li { - [class^="icon-"], - [class*=" icon-"] { - width: .75em; - } - } -} - -.icon-muted { - color: $iconMuted; -} - -// Icon Borders -// ------------------------- - -.icon-border { - border: solid 1px $borderColor; - padding: .2em .25em .15em; - @include border-radius(3px); -} - -// Icon Sizes -// ------------------------- - -.icon-2x { - font-size: 2em; - &.icon-border { - border-width: 2px; - @include border-radius(4px); - } -} -.icon-3x { - font-size: 3em; - &.icon-border { - border-width: 3px; - @include border-radius(5px); - } -} -.icon-4x { - font-size: 4em; - &.icon-border { - border-width: 4px; - @include border-radius(6px); - } -} - -// Floats -// ------------------------- - -// Quick floats -.pull-right { float: right; } -.pull-left { float: left; } - -[class^="icon-"], -[class*=" icon-"] { - &.pull-left { - margin-right: .3em; - } - &.pull-right { - margin-left: .3em; - } -} - -.btn { - [class^="icon-"], - [class*=" icon-"] { - &.pull-left, &.pull-right { - &.icon-2x { margin-top: .18em; } - } - &.icon-spin.icon-large { line-height: .8em; } - } -} - -.btn.btn-small { - [class^="icon-"], - [class*=" icon-"] { - &.pull-left, &.pull-right { - &.icon-2x { margin-top: .25em; } - } - } -} - -.btn.btn-large { - [class^="icon-"], - [class*=" icon-"] { - margin-top: 0; // overrides bootstrap default - &.pull-left, &.pull-right { - &.icon-2x { margin-top: .05em; } - } - &.pull-left.icon-2x { margin-right: .2em; } - &.pull-right.icon-2x { margin-left: .2em; } - } -} - - -.icon-spin { - display: inline-block; - -moz-animation: spin 2s infinite linear; - -o-animation: spin 2s infinite linear; - -webkit-animation: spin 2s infinite linear; - animation: spin 2s infinite linear; -} - -@-moz-keyframes spin { - 0% { -moz-transform: rotate(0deg); } - 100% { -moz-transform: rotate(359deg); } -} -@-webkit-keyframes spin { - 0% { -webkit-transform: rotate(0deg); } - 100% { -webkit-transform: rotate(359deg); } -} -@-o-keyframes spin { - 0% { -o-transform: rotate(0deg); } - 100% { -o-transform: rotate(359deg); } -} -@-ms-keyframes spin { - 0% { -ms-transform: rotate(0deg); } - 100% { -ms-transform: rotate(359deg); } -} -@keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(359deg); } -} - -@-moz-document url-prefix() { - .icon-spin { height: .9em; } - .btn .icon-spin { height: auto; } - .icon-spin.icon-large { height: 1.25em; } - .btn .icon-spin.icon-large { height: .75em; } -}.icon-user:before { content: "\f021"; } -.icon-home:before { content: "\f022"; } -.icon-tag:before { content: "\f023"; } -.icon-tint:before { content: "\f024"; } -.icon-question-sign:before { content: "\f025"; } -.icon-angle-left:before { content: "\f026"; } -.icon-angle-right:before { content: "\f027"; } diff --git a/ltmo/sass/style.scss b/ltmo/sass/style.scss deleted file mode 100644 index 14b6ebc..0000000 --- a/ltmo/sass/style.scss +++ /dev/null @@ -1,477 +0,0 @@ -@import "pygments"; -@import "base"; -@import url(http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono); -* { - box-sizing: content-box; -} -.wrapper { - padding: 0.5em 1em; - overflow:overlay; -} -body { - font: 100% "Droid Sans", sans-serif; - background: #EEE; - padding:0; - margin: 0; -} -header, section, footer, article, aside { - display: block; - padding: 0; - margin-bottom: 2em; - -} -header { - width:100%; - padding:0; - margin: 0; - position: fixed; - @include gradient(rgba(255,255,255,0.7)); - top:0; - left: 0; - z-index:9999; - box-shadow: 0 1px 2px #555; - @include gradient(rgba(255,255,255,.7)); - .wrapper { - padding: 0 1em; - } -} - -footer { - clear: both; - padding: 5em 1em 1em; - font-size: 80%; -} -#main{ - margin:4em 0 0; - clear: both; - position: relative; -} -#help { - padding: 1em; - background: white; - width: 25em; - float:none; - position:absolute; - top: 1em; - right:0; - box-shadow: 0 1px 1px #000; - border-radius: 3px; - border: 1px solid #EEE; - background: #FFF; -} -section { - display:block; - text-align:center; - article { - text-align: left; - position:relative; - margin:2em auto; - width:40em; - p { - color: #000; - text-shadow: 0 1px 1px #FFF; - } - } - .leak{ - &:before { - content: ''; - display: inline-block; - height: 100%; - vertical-align: middle; - margin-right: -0.25em; /* Adjusts for spacing */ - } - article { - display: inline-block; - vertical-align: middle; - margin:2em auto 0; - } - } - -} -article img, article object { - display:block; - margin: 0.5em auto; -} - -article object { - max-width: 90%; -} -.slot { - text-align: center; -} -.detail { - text-align: right; - font-size:80%; - display:block; - color: #555; -} -#detail { - position: fixed; - font-size:80%; - bottom:0; - width: 100%; - padding: 0; - left: 0; - margin: 0; - p { - padding: 0 3em; - margin: 0; - - } -} -#metadata { - float:right; - text-align:right; - -} -#tagcloud { - position: absolute; - bottom: 0; - text-align:left; - margin-top: -1em !important; -} -aside { - text-align: left; - width: 20%; - position: absolute; - font-size: 80%; - top: 4em; - right:1em; -} -pre, code { - font: 110% "Droid Sans Mono",monospace; - white-space: pre-wrap; - color:$solarized_base1; -} - -blockquote{ - font: italic 150% "Georgia-MS", Georgia, serif; - width: 70%; - margin: 1em auto; -} - -a{ - border: 1px solid transparent; - text-decoration:none; - color :$fg_color; - &:hover { - text-shadow: 0 -1px 0 #FFF, 0 1px 1px #000; - } -} - -a img{ - border: 0; -} -em { - font: italic 100% "Georgia-MS", Georgia, serif; -} -h1, h2, h3, h1 a, h2 a, h3 a { - font-weight: normal; -} -h1 { - font-weight: normal; -} -h1 .pilcrow { - font-size:70%; - display:none; - vertical-align: top; -} -h1:hover .pilcrow { - display:inline; -} -h2 { - font-size:180%; -} -#wrapper { - margin: 0 auto; - text-align:left; - background: rgba(255, 255, 255, 0.8); - border-radius: 15px 15px 0 0; -} -#logo { - margin:0; - padding: 0.2em 0; - color: #555; - font-size: 1.6em; -} -#banner-header { - float:right; - margin: 0.5em 0; -} -#banner-content { - text-align:center; - width: 730px; - margin: 0 auto; - -} -#banner-aside { - margin-top:15px; -} -#author { - margin:1em 0; -} -#author details { - font-size:13px; - margin: -1.5em 0; - text-align:left; -} -#messages { - text-align:left; - background: #FE9; - border: 1px solid #FC0; - font-size:80%; - margin:0; - padding:0 1em; - position:fixed; - left:0; - top:0; - width:100%; - z-index:100; - list-style:none; -} -#messages li { - padding: 0.25em 2em; - position: relative; -} -#messages .control { - position: absolute; - right: 4em; -} - -.rewind { - position: absolute; - bottom: 5em; - right: 10em; - -} -.banner { - clear: both; - position:relative; - padding: 1em; -} -.gravatar { - float:left; - margin-right:0.5em; -} -.caption { - margin:0; - padding: 1em; - border-color: transparent transparent #EEEEEE; - border-style: solid; - border-width: 0 0 1px; -} -.clear { - display:block; - clear:both; -} -.pager { - display: block; - position: fixed; - top: 0; - padding: 0; - height: 100%; - width:3em; - outline: 0; - strong { - @include transition(0.3s); - position: fixed; - display: block; - padding:2px 5px; - margin-top: 0; - top: 50%; - font-size:2em; - color: rgba(100,100,100, 0.5); - font-size:4em; - } - &:hover strong { - @include transition(0.1s); - font-size:8em; - margin-top:-0.25em; - color: $green; - } - -} -.prev { - left: 1em; -} -.next { - right:1em; -} - -.tags { - background: url(../img/bg-tags.png) left no-repeat; - color: #666666; - font-family: Arial,sans-serif; - font-size: 11px; - line-height: 32px; - margin: 2px 2px 2px 0; - overflow: visible; - padding: 4px 4px 4px 16px; - text-decoration: none; - min-width:30px; - white-space: nowrap; -} - -.hide { - display:none; -} - -nav { - float: right; - font-size:1.5em ; - padding: 0.25em 0.5em; - .user { - font-size:0.5em; - } -} -.session { - font-size: 100%; -} -.session a:hover { - background:transparent; -} -form { - padding: 1em 2em; - margin: 0 1em; - text-align:left; - p { - position:relative; - } - section{ - margin-bottom:1em; - width:50%; - position:relative; - text-align: left; - } -} -.submit { - text-align: right; - padding: 0 1em; - a { - line-height:2.5em; - } -} -#formating-help { - float:right; - width: 30%; - font-size: 80%; - border: 1px solid #FFF; - border-width:1px 0; - border-color: #CCC transparent #FFF; - -} -#formating-help caption { - margin: 0 0 1em -2em; - text-align: left; -} -#formating-help td { - vertical-align: top; - border: 1px solid #FFF; - border-width:1px 0; - border-color: #FFF transparent #CCC; - padding: 0.25em; -} - - -input, -textarea{ - border: 1px solid #000; - font: 1em sans-serif; - padding: 0.25em; - border-radius: 3px; -} -textarea { - font-size:1.5em; - height:5em; - width:20em; -} -input[type='email']:focus, -input[type='password']:focus, -input[type='text']:focus, -textarea:focus{ - border: 1px solid #0C6; - outline:0 !important; - box-shadow: 0 0 2px #FC0; -} -.error input, -.error textarea { - border: 1px solid #C60!important; - box-shadow: 0 0 2px #F00!important; -} -.errorlist{ - @include tooltip(); -} - -label { - display:block; - margin: 0.5em 0 0; - font-size:80%; -} -form span { - font-size:80%; -} -.required label { - font-weight:bold; - color:#C60; -} -input[type='submit'] { - @include button; -} -#leak-form input[type='submit'] { - float:left; -} -#id_title, #id_description { - width: 100%; -} -.ui-autocomplete { - list-style: none; - position:fixed !important; - background: #FFF; - width: 10em; - padding:0; - margin:0; -} -.ui-autocomplete a { - display:block; - font-size:80%; - padding: 0.5em; -} -.ui-state-hover { - background:#0C6; - color:#FFF; -} -#login-form { - float:left; -} -#register-form { - float:left; - width: 40%; - padding:1em; - h3 { - text-align: center; - } -} -#id_description.hover { - border:3px solid #900; - background: #EEE; -} -.hidden-detail { - display:none !important; -} -.login { - display:inline-block; - padding: 0.25em 1em ; - font-weight: bold; - border-radius:3px; - color: white; - &:hover { - text-shadow: none; - } -} -.login.facebook { - @include gradient(#3B5998) - -} -.login.google { - @include gradient(#F90101) -} \ No newline at end of file diff --git a/ltmo/settings.py b/ltmo/settings.py index b9a5eb6..5c5577e 100644 --- a/ltmo/settings.py +++ b/ltmo/settings.py @@ -1,11 +1,13 @@ # -*- coding: utf-8 -*- import os + DEBUG = True TEMPLATE_DEBUG = DEBUG -BASE_DIR = os.path.dirname(__file__) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + ADMINS = ( ('etnalubma', 'francisco.herrero@gmail.com'), @@ -18,25 +20,19 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'ltmo.db'), - 'TEST_NAME': os.path.join(BASE_DIR, 'test_ltmo.db'), + 'NAME': os.path.join(BASE_DIR, 'ltmo.sqlite3'), } } -SOUTH_TESTS_MIGRATE = False - +ALLOWED_HOSTS = [] TIME_ZONE = 'America/Chicago' -LANGUAGE_CODE = 'es-AR' # Using Guarani, Of Course - -SITE_ID = 1 +SECRET_KEY = '7$57#ttr-tzqr*dt$l7vac0xt&1+i=gi^-y8bnsba$i%ci^nrd' +LANGUAGE_CODE = 'es-AR' # Using Guarani, Of Course USE_I18N = True - USE_L10N = True -ROOT_URLCONF = 'ltmo.urls' - MEDIA_ROOT = os.path.join(BASE_DIR, 'media') UPLOAD_DIR = os.path.join(MEDIA_ROOT, 'upload') @@ -45,75 +41,68 @@ MEDIA_URL = '/media/' -ADMIN_MEDIA_PREFIX = '/static/admin/' - -STATIC_ROOT = os.path.join(BASE_DIR, 'static') - STATIC_URL = '/static/' - -# Additional locations of static files -STATICFILES_DIRS = ( -) - -STATICFILES_FINDERS = ( - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', -# 'django.contrib.staticfiles.finders.DefaultStorageFinder', -) +STATIC_ROOT = os.path.join(BASE_DIR, 'staic') AUTH_PROFILE_MODULE = 'auth.User' LOGIN_REDIRECT_URL = '/~' -REGISTRATION_BACKEND = 'registration.backends.default.DefaultBackend' -SOCIAL_AUTH_CREATE_USERS = True -SOCIAL_AUTH_FORCE_RANDOM_USERNAME = False -LOGIN_ERROR_URL = '/login/error/' -SOCIAL_AUTH_ERROR_KEY = 'socialauth_error' -SOCIAL_AUTH_ENABLED_BACKENDS=('facebook', 'google') -SOCIAL_AUTH_COMPLETE_URL_NAME='socialauth_complete' -SOCIAL_AUTH_ASSOCIATE_URL_NAME='associate_complete' -SOCIAL_AUTH_DEFAULT_USERNAME= lambda u: slugify(u) -SOCIAL_AUTH_EXTRA_DATA=False -SOCIAL_AUTH_CHANGE_SIGNAL_ONLY=True -SOCIAL_AUTH_ASSOCIATE_BY_MAIL=True - ACCOUNT_ACTIVATION_DAYS = 2 -SECRET_KEY = '7$57#ttr-tzqr*dt$l7vac0xt&1+i=gi^-y8bnsba$i%ci^nrd' PAGINATION_DEFAULT_WINDOW = 2 - FORCE_LOWERCASE_TAGS = True - AUTHENTICATION_BACKENDS = ( - 'social_auth.backends.facebook.FacebookBackend', - 'social_auth.backends.google.GoogleBackend', + 'social.backends.facebook.FacebookOAuth2', + 'social.backends.google.GoogleOAuth2', 'django.contrib.auth.backends.ModelBackend', ) MIDDLEWARE_CLASSES = ( 'debug_toolbar.middleware.DebugToolbarMiddleware', - 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', - 'pagination.middleware.PaginationMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', ) -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.security.SecurityMiddleware', ) -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.core.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'social_auth.context_processors.social_auth_backends', - 'django.contrib.messages.context_processors.messages', -) +ROOT_URLCONF = 'ltmo.urls' -TEMPLATE_DIRS = ( - 'templates', - os.path.join(BASE_DIR, 'templates') -) +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [ + 'templates', + os.path.join(BASE_DIR, 'templates') + ], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'social.apps.django_app.context_processors.backends', + 'social.apps.django_app.context_processors.login_redirect', + + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'ltmo.wsgi.application' EMAIL_HOST = 'localhost' EMAIL_PORT = 1025 @@ -122,29 +111,28 @@ LOGOUT_URL = '/logout' INSTALLED_APPS = ( - 'django.contrib.auth', 'django.contrib.admin', + 'django.contrib.auth', 'django.contrib.contenttypes', - 'django.contrib.sessions', 'django.contrib.sites', - 'django.contrib.staticfiles', - 'django.contrib.sitemaps', + 'django.contrib.sessions', 'django.contrib.messages', + 'django.contrib.staticfiles', + 'social.apps.django_app.default', + 'rest_framework', 'registration', - 'social_auth', 'debug_toolbar', - 'south', - 'pagination', - 'tagging', - 'banners', - 'ltmo', + 'endless_pagination', + 'taggit', + 'taggit_templatetags', + 'banners.apps.BannersAppConfig', + 'leaks.apps.LeakAppConfig', ) -# XXX: Remove this -# Modify temporarily the session serializer because the json serializer in -# Django 1.6 can't serialize openid.yadis.manager.YadisServiceManager objects -SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' +TAGGIT_TAGCLOUD_MIN = 1.0 +TAGGIT_TAGCLOUD_MAX = 0.6 +SOCIAL_AUTH_CLEAN_USERNAMES = False try: - from local_settings import * + from .local_settings import * except ImportError: pass diff --git a/ltmo/static/css/fontawesome.css b/ltmo/static/css/fontawesome.css deleted file mode 100644 index 364f97a..0000000 --- a/ltmo/static/css/fontawesome.css +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Font Awesome 3.0.2 - * the iconic font designed for use with Twitter Bootstrap - * ------------------------------------------------------- - * The full suite of pictographic icons, examples, and documentation - * can be found at: http://fortawesome.github.com/Font-Awesome/ - * - * License - * ------------------------------------------------------- - * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL - * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - - * http://opensource.org/licenses/mit-license.html - * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ - * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: - * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" - * - * Contact - * ------------------------------------------------------- - * Email: dave@davegandy.com - * Twitter: http://twitter.com/fortaweso_me - * Work: Lead Product Designer @ http://kyruus.com - */ -@font-face { font-family: 'FontAwesome'; src: url("/fontawesome-webfont.eot?v=3.0.1"); src: url("/fontawesome-webfont.eot?#iefix&v=3.0.1") format("embedded-opentype"), url("/fontawesome-webfont.woff?v=3.0.1") format("woff"), url("/fontawesome-webfont.ttf?v=3.0.1") format("truetype"); font-weight: normal; font-style: normal; } - -/* Font Awesome styles ------------------------------------------------------- */ -[class^="icon-"], [class*=" icon-"] { font-family: FontAwesome; font-weight: normal; font-style: normal; text-decoration: inherit; -webkit-font-smoothing: antialiased; /* sprites.less reset */ display: inline; width: auto; height: auto; line-height: normal; vertical-align: baseline; background-image: none; background-position: 0% 0%; background-repeat: repeat; margin-top: 0; } - -/* more sprites.less reset */ -.icon-white, .nav-pills > .active > a > [class^="icon-"], .nav-pills > .active > a > [class*=" icon-"], .nav-list > .active > a > [class^="icon-"], .nav-list > .active > a > [class*=" icon-"], .navbar-inverse .nav > .active > a > [class^="icon-"], .navbar-inverse .nav > .active > a > [class*=" icon-"], .dropdown-menu > li > a:hover > [class^="icon-"], .dropdown-menu > li > a:hover > [class*=" icon-"], .dropdown-menu > .active > a > [class^="icon-"], .dropdown-menu > .active > a > [class*=" icon-"], .dropdown-submenu:hover > a > [class^="icon-"], .dropdown-submenu:hover > a > [class*=" icon-"] { background-image: none; } - -[class^="icon-"]:before, [class*=" icon-"]:before { text-decoration: inherit; display: inline-block; speak: none; } - -/* makes sure icons active on rollover in links */ -a [class^="icon-"], a [class*=" icon-"] { display: inline-block; } - -/* makes the font 33% larger relative to the icon container */ -.icon-large:before { vertical-align: -10%; font-size: 1.3333333333333333em; } - -.btn [class^="icon-"], .btn [class*=" icon-"], .nav [class^="icon-"], .nav [class*=" icon-"] { display: inline; /* keeps button heights with and without icons the same */ } -.btn [class^="icon-"].icon-large, .btn [class*=" icon-"].icon-large, .nav [class^="icon-"].icon-large, .nav [class*=" icon-"].icon-large { line-height: .9em; } -.btn [class^="icon-"].icon-spin, .btn [class*=" icon-"].icon-spin, .nav [class^="icon-"].icon-spin, .nav [class*=" icon-"].icon-spin { display: inline-block; } - -.nav-tabs [class^="icon-"], .nav-tabs [class*=" icon-"], .nav-pills [class^="icon-"], .nav-pills [class*=" icon-"] { /* keeps button heights with and without icons the same */ } -.nav-tabs [class^="icon-"], .nav-tabs [class^="icon-"].icon-large, .nav-tabs [class*=" icon-"], .nav-tabs [class*=" icon-"].icon-large, .nav-pills [class^="icon-"], .nav-pills [class^="icon-"].icon-large, .nav-pills [class*=" icon-"], .nav-pills [class*=" icon-"].icon-large { line-height: .9em; } - -li [class^="icon-"], li [class*=" icon-"], .nav li [class^="icon-"], .nav li [class*=" icon-"] { display: inline-block; width: 1.25em; text-align: center; } -li [class^="icon-"].icon-large, li [class*=" icon-"].icon-large, .nav li [class^="icon-"].icon-large, .nav li [class*=" icon-"].icon-large { /* increased font size for icon-large */ width: 1.5625em; } - -ul.icons { list-style-type: none; text-indent: -0.75em; } -ul.icons li [class^="icon-"], ul.icons li [class*=" icon-"] { width: .75em; } - -.icon-muted { color: #eeeeee; } - -.icon-border { border: solid 1px #eeeeee; padding: .2em .25em .15em; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } - -.icon-2x { font-size: 2em; } -.icon-2x.icon-border { border-width: 2px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } - -.icon-3x { font-size: 3em; } -.icon-3x.icon-border { border-width: 3px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } - -.icon-4x { font-size: 4em; } -.icon-4x.icon-border { border-width: 4px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } - -.pull-right { float: right; } - -.pull-left { float: left; } - -[class^="icon-"].pull-left, [class*=" icon-"].pull-left { margin-right: .3em; } -[class^="icon-"].pull-right, [class*=" icon-"].pull-right { margin-left: .3em; } - -.btn [class^="icon-"].pull-left.icon-2x, .btn [class^="icon-"].pull-right.icon-2x, .btn [class*=" icon-"].pull-left.icon-2x, .btn [class*=" icon-"].pull-right.icon-2x { margin-top: .18em; } -.btn [class^="icon-"].icon-spin.icon-large, .btn [class*=" icon-"].icon-spin.icon-large { line-height: .8em; } - -.btn.btn-small [class^="icon-"].pull-left.icon-2x, .btn.btn-small [class^="icon-"].pull-right.icon-2x, .btn.btn-small [class*=" icon-"].pull-left.icon-2x, .btn.btn-small [class*=" icon-"].pull-right.icon-2x { margin-top: .25em; } - -.btn.btn-large [class^="icon-"], .btn.btn-large [class*=" icon-"] { margin-top: 0; } -.btn.btn-large [class^="icon-"].pull-left.icon-2x, .btn.btn-large [class^="icon-"].pull-right.icon-2x, .btn.btn-large [class*=" icon-"].pull-left.icon-2x, .btn.btn-large [class*=" icon-"].pull-right.icon-2x { margin-top: .05em; } -.btn.btn-large [class^="icon-"].pull-left.icon-2x, .btn.btn-large [class*=" icon-"].pull-left.icon-2x { margin-right: .2em; } -.btn.btn-large [class^="icon-"].pull-right.icon-2x, .btn.btn-large [class*=" icon-"].pull-right.icon-2x { margin-left: .2em; } - -.icon-spin { display: inline-block; -moz-animation: spin 2s infinite linear; -o-animation: spin 2s infinite linear; -webkit-animation: spin 2s infinite linear; animation: spin 2s infinite linear; } - -@-moz-keyframes spin { 0% { -moz-transform: rotate(0deg); } - 100% { -moz-transform: rotate(359deg); } } - -@-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } - 100% { -webkit-transform: rotate(359deg); } } - -@-o-keyframes spin { 0% { -o-transform: rotate(0deg); } - 100% { -o-transform: rotate(359deg); } } - -@-ms-keyframes spin { 0% { -ms-transform: rotate(0deg); } - 100% { -ms-transform: rotate(359deg); } } - -@keyframes spin { 0% { transform: rotate(0deg); } - 100% { transform: rotate(359deg); } } - -@-moz-document url-prefix() { .icon-spin { height: .9em; } - .btn .icon-spin { height: auto; } - .icon-spin.icon-large { height: 1.25em; } - .btn .icon-spin.icon-large { height: .75em; } } - -.icon-user:before { content: "\f021"; } - -.icon-home:before { content: "\f022"; } - -.icon-tag:before { content: "\f023"; } - -.icon-tint:before { content: "\f024"; } - -.icon-question-sign:before { content: "\f025"; } - -.icon-angle-left:before { content: "\f026"; } - -.icon-angle-right:before { content: "\f027"; } diff --git a/ltmo/static/css/style.css b/ltmo/static/css/style.css deleted file mode 100644 index e8589c7..0000000 --- a/ltmo/static/css/style.css +++ /dev/null @@ -1,211 +0,0 @@ -@import url(http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono); -.codehilite { background-color: #002b36; padding: 0.5em 2em; margin: 0 -2em; border-radius: 3px; } -.codehilite .ge { font-style: italic; } -.codehilite .gs { font-weight: bold; } -.codehilite .hll { background-color: #073642; } -.codehilite .err { border: 1px solid #dc322f; } -.codehilite .gr { color: #dc322f; } -.codehilite .gd { color: #dc322f; } -.codehilite .gi { color: #859900; } -.codehilite .o, .codehilite .p { color: #657b83; } -.codehilite .go { color: #839496; } -.codehilite .w { color: #93a1a1; } -.codehilite .nd { color: #586e75; font-weight: bold; } -.codehilite .cm, .codehilite .c1, .codehilite .c { color: #2aa198; font-style: italic; } -.codehilite .cs { color: #2aa198; background-color: #073642; } -.codehilite .gh, .codehilite .nt { color: #cb4b16; font-weight: bold; } -.codehilite .nf { color: #d33682; } -.codehilite .m, .codehilite .mf, .codehilite .mh, .codehilite .mi, .codehilite .mo, .codehilite .il { color: #b58900; } -.codehilite .s, .codehilite .sh, .codehilite .s2, .codehilite .s1, .codehilite .sc, .codehilite .sb { color: #859900; } -.codehilite .na, .codehilite .sd, .codehilite .se { color: #b58900; } -.codehilite .sd { font-style: italic; } -.codehilite .se { font-weight: bold; } -.codehilite .ss { color: #cb4b16; } -.codehilite .si { color: #cb4b16; font-style: italic; } -.codehilite .cp { color: #268bd2; } -.codehilite .bp, .codehilite .nb, .codehilite .ne { color: #268bd2; } -.codehilite .ow { color: #268bd2; font-weight: bold; } -.codehilite .nn, .codehilite .nx, .codehilite .nc, .codehilite .nl { color: #268bd2; font-weight: bold; } -.codehilite .k, .codehilite .kc, .codehilite .kd, .codehilite .kn, .codehilite .kr { color: #6c71c4; font-weight: bold; } -.codehilite .kp { color: #6c71c4; } -.codehilite .nv, .codehilite .vc, .codehilite .vg, .codehilite .vi, .codehilite .ni { color: #cb4b16; } -.codehilite .ni { font-weight: bold; } -.codehilite .gt { color: #0040d0; } -.codehilite .sr { color: #235388; } -.codehilite .no { color: #60add5; } -.codehilite .gu { color: #800080; font-weight: bold; } -.codehilite .kt { color: #902000; } -.codehilite .sx { color: #c65d09; } -.codehilite .gp { color: #c65d09; font-weight: bold; } - -* { box-sizing: content-box; } - -.wrapper { padding: 0.5em 1em; overflow: overlay; } - -body { font: 100% "Droid Sans", sans-serif; background: #EEE; padding: 0; margin: 0; } - -header, section, footer, article, aside { display: block; padding: 0; margin-bottom: 2em; } - -header { width: 100%; padding: 0; margin: 0; position: fixed; background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(230, 230, 230, 0.7)); background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(230, 230, 230, 0.7)); background-image: -ms-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(230, 230, 230, 0.7)); background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(230, 230, 230, 0.7)); top: 0; left: 0; z-index: 9999; box-shadow: 0 1px 2px #555555; background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(230, 230, 230, 0.7)); background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(230, 230, 230, 0.7)); background-image: -ms-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(230, 230, 230, 0.7)); background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(230, 230, 230, 0.7)); } -header .wrapper { padding: 0 1em; } - -footer { clear: both; padding: 5em 1em 1em; font-size: 80%; } - -#main { margin: 4em 0 0; clear: both; position: relative; } - -#help { padding: 1em; background: white; width: 25em; float: none; position: absolute; top: 1em; right: 0; box-shadow: 0 1px 1px black; border-radius: 3px; border: 1px solid #eeeeee; background: #FFF; } - -section { display: block; text-align: center; } -section article { text-align: left; position: relative; margin: 2em auto; width: 40em; } -section article p { color: #000; text-shadow: 0 1px 1px white; } -section .leak:before { content: ''; display: inline-block; height: 100%; vertical-align: middle; margin-right: -0.25em; /* Adjusts for spacing */ } -section .leak article { display: inline-block; vertical-align: middle; margin: 2em auto 0; } - -article img, article object { display: block; margin: 0.5em auto; } - -article object { max-width: 90%; } - -.slot { text-align: center; } - -.detail { text-align: right; font-size: 80%; display: block; color: #555; } - -#detail { position: fixed; font-size: 80%; bottom: 0; width: 100%; padding: 0; left: 0; margin: 0; } -#detail p { padding: 0 3em; margin: 0; } - -#metadata { float: right; text-align: right; } - -#tagcloud { position: absolute; bottom: 0; text-align: left; margin-top: -1em !important; } - -aside { text-align: left; width: 20%; position: absolute; font-size: 80%; top: 4em; right: 1em; } - -pre, code { font: 110% "Droid Sans Mono", monospace; white-space: pre-wrap; color: #93a1a1; } - -blockquote { font: italic 150% "Georgia-MS", Georgia, serif; width: 70%; margin: 1em auto; } - -a { border: 1px solid transparent; text-decoration: none; color: #268bd2; } -a:hover { text-shadow: 0 -1px 0 white, 0 1px 1px black; } - -a img { border: 0; } - -em { font: italic 100% "Georgia-MS", Georgia, serif; } - -h1, h2, h3, h1 a, h2 a, h3 a { font-weight: normal; } - -h1 { font-weight: normal; } - -h1 .pilcrow { font-size: 70%; display: none; vertical-align: top; } - -h1:hover .pilcrow { display: inline; } - -h2 { font-size: 180%; } - -#wrapper { margin: 0 auto; text-align: left; background: rgba(255, 255, 255, 0.8); border-radius: 15px 15px 0 0; } - -#logo { margin: 0; padding: 0.2em 0; color: #555; font-size: 1.6em; } - -#banner-header { float: right; margin: 0.5em 0; } - -#banner-content { text-align: center; width: 730px; margin: 0 auto; } - -#banner-aside { margin-top: 15px; } - -#author { margin: 1em 0; } - -#author details { font-size: 13px; margin: -1.5em 0; text-align: left; } - -#messages { text-align: left; background: #FE9; border: 1px solid #ffcc00; font-size: 80%; margin: 0; padding: 0 1em; position: fixed; left: 0; top: 0; width: 100%; z-index: 100; list-style: none; } - -#messages li { padding: 0.25em 2em; position: relative; } - -#messages .control { position: absolute; right: 4em; } - -.rewind { position: absolute; bottom: 5em; right: 10em; } - -.banner { clear: both; position: relative; padding: 1em; } - -.gravatar { float: left; margin-right: 0.5em; } - -.caption { margin: 0; padding: 1em; border-color: transparent transparent #eeeeee; border-style: solid; border-width: 0 0 1px; } - -.clear { display: block; clear: both; } - -.pager { display: block; position: fixed; top: 0; padding: 0; height: 100%; width: 3em; outline: 0; } -.pager strong { -moz-transition: all 0.3s; -webkit-transition: all 0.3s; transition: all 0.3s; position: fixed; display: block; padding: 2px 5px; margin-top: 0; top: 50%; font-size: 2em; color: rgba(100, 100, 100, 0.5); font-size: 4em; } -.pager:hover strong { -moz-transition: all 0.1s; -webkit-transition: all 0.1s; transition: all 0.1s; font-size: 8em; margin-top: -0.25em; color: #859900; } - -.prev { left: 1em; } - -.next { right: 1em; } - -.tags { background: url(../img/bg-tags.png) left no-repeat; color: #666666; font-family: Arial,sans-serif; font-size: 11px; line-height: 32px; margin: 2px 2px 2px 0; overflow: visible; padding: 4px 4px 4px 16px; text-decoration: none; min-width: 30px; white-space: nowrap; } - -.hide { display: none; } - -nav { float: right; font-size: 1.5em; padding: 0.25em 0.5em; } -nav .user { font-size: 0.5em; } - -.session { font-size: 100%; } - -.session a:hover { background: transparent; } - -form { padding: 1em 2em; margin: 0 1em; text-align: left; } -form p { position: relative; } -form section { margin-bottom: 1em; width: 50%; position: relative; text-align: left; } - -.submit { text-align: right; padding: 0 1em; } -.submit a { line-height: 2.5em; } - -#formating-help { float: right; width: 30%; font-size: 80%; border: 1px solid white; border-width: 1px 0; border-color: #cccccc transparent white; } - -#formating-help caption { margin: 0 0 1em -2em; text-align: left; } - -#formating-help td { vertical-align: top; border: 1px solid white; border-width: 1px 0; border-color: white transparent #cccccc; padding: 0.25em; } - -input, textarea { border: 1px solid black; font: 1em sans-serif; padding: 0.25em; border-radius: 3px; } - -textarea { font-size: 1.5em; height: 5em; width: 20em; } - -input[type='email']:focus, input[type='password']:focus, input[type='text']:focus, textarea:focus { border: 1px solid #00cc66; outline: 0 !important; box-shadow: 0 0 2px #ffcc00; } - -.error input, .error textarea { border: 1px solid #cc6600 !important; box-shadow: 0 0 2px red !important; } - -.errorlist { list-style: none; font-size: 80%; margin: 0; background: #dc322f; padding: 2px 4px; border-radius: 5px; color: #FFF; text-shadow: 0 1px 0 black; z-index: 99999; position: absolute; left: 8em; border: 1px solid transparent; } -.errorlist:after, .errorlist:before { right: 100%; top: 50%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; } -.errorlist:after { border-color: rgba(136, 183, 213, 0); border-right-color: #dc322f; border-width: 5px; margin-top: -5px; } -.errorlist:before { border-color: rgba(194, 225, 245, 0); border-right-color: transparent; border-width: 7px; margin-top: -7px; } - -label { display: block; margin: 0.5em 0 0; font-size: 80%; } - -form span { font-size: 80%; } - -.required label { font-weight: bold; color: #C60; } - -input[type='submit'] { background-image: -webkit-linear-gradient(top, #859900, #596600); background-image: -moz-linear-gradient(top, #859900, #596600); background-image: -ms-linear-gradient(top, #859900, #596600); background-image: -o-linear-gradient(top, #859900, #596600); -moz-transition: all 0.3s; -webkit-transition: all 0.3s; transition: all 0.3s; border: none; border-radius: 5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 1px rgba(0, 0, 0, 0.05); padding: 2px 6px; font-size: 1.2em; text-shadow: 0 1px 1px #333333; margin: 0 0.3em; color: white; } -input[type='submit']:active { -moz-transition: all 0.1s; -webkit-transition: all 0.1s; transition: all 0.1s; background-image: -webkit-linear-gradient("bottom", #859900, #596600); background-image: -moz-linear-gradient("bottom", #859900, #596600); background-image: -ms-linear-gradient("bottom", #859900, #596600); background-image: -o-linear-gradient("bottom", #859900, #596600); } -input[type='submit']:hover { -moz-transition: all 0.4s; -webkit-transition: all 0.4s; transition: all 0.4s; text-shadow: 0 1px 0 black; cursor: pointer!important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), -1px 1px 3px rgba(0, 0, 0, 0.5); } - -#leak-form input[type='submit'] { float: left; } - -#id_title, #id_description { width: 100%; } - -.ui-autocomplete { list-style: none; position: fixed !important; background: #FFF; width: 10em; padding: 0; margin: 0; } - -.ui-autocomplete a { display: block; font-size: 80%; padding: 0.5em; } - -.ui-state-hover { background: #0C6; color: #FFF; } - -#login-form { float: left; } - -#register-form { float: left; width: 40%; padding: 1em; } -#register-form h3 { text-align: center; } - -#id_description.hover { border: 3px solid #990000; background: #EEE; } - -.hidden-detail { display: none !important; } - -.login { display: inline-block; padding: 0.25em 1em; font-weight: bold; border-radius: 3px; color: white; } -.login:hover { text-shadow: none; } - -.login.facebook { background-image: -webkit-linear-gradient(top, #3b5998, #2d4373); background-image: -moz-linear-gradient(top, #3b5998, #2d4373); background-image: -ms-linear-gradient(top, #3b5998, #2d4373); background-image: -o-linear-gradient(top, #3b5998, #2d4373); } - -.login.google { background-image: -webkit-linear-gradient(top, #f90101, #c60101); background-image: -moz-linear-gradient(top, #f90101, #c60101); background-image: -ms-linear-gradient(top, #f90101, #c60101); background-image: -o-linear-gradient(top, #f90101, #c60101); } diff --git a/ltmo/static/favicon.ico b/ltmo/static/favicon.ico deleted file mode 100644 index 8b75168..0000000 Binary files a/ltmo/static/favicon.ico and /dev/null differ diff --git a/ltmo/static/fonts/fontawesome-webfont.afm b/ltmo/static/fonts/fontawesome-webfont.afm deleted file mode 100644 index c285706..0000000 --- a/ltmo/static/fonts/fontawesome-webfont.afm +++ /dev/null @@ -1,25 +0,0 @@ -StartFontMetrics 2.0 -Comment Generated by FontForge 20120731 -Comment Creation Date: Sun Nov 10 23:21:22 2013 -FontName fontawesome -FullName fontawesome -FamilyName fontawesome -Weight Book -Notice (Created by root with FontForge 2.0 (http://fontforge.sf.net)) -ItalicAngle 0 -IsFixedPitch false -UnderlinePosition -170.667 -UnderlineThickness 85.3333 -Version 001.000 -EncodingScheme ISO10646-1 -FontBBox 0 -75 960 863 -StartCharMetrics 7 -C -1 ; WX 824 ; N user ; B 0 -75 825 825 ; -C -1 ; WX 974 ; N home ; B 15 0 960 752 ; -C -1 ; WX 899 ; N tag ; B 0 -63 888 825 ; -C -1 ; WX 599 ; N tint ; B 0 0 600 863 ; -C -1 ; WX 899 ; N question-sign ; B 0 -75 900 825 ; -C -1 ; WX 374 ; N angle-left ; B 26 45 368 630 ; -C -1 ; WX 374 ; N angle-right ; B 7 45 349 630 ; -EndCharMetrics -EndFontMetrics diff --git a/ltmo/static/fonts/fontawesome-webfont.eot b/ltmo/static/fonts/fontawesome-webfont.eot deleted file mode 100644 index 28c5267..0000000 Binary files a/ltmo/static/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/ltmo/static/fonts/fontawesome-webfont.ttf b/ltmo/static/fonts/fontawesome-webfont.ttf deleted file mode 100644 index a9e8c81..0000000 Binary files a/ltmo/static/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/ltmo/static/fonts/fontawesome-webfont.woff b/ltmo/static/fonts/fontawesome-webfont.woff deleted file mode 100644 index 6d13796..0000000 Binary files a/ltmo/static/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/ltmo/static/img/add.png b/ltmo/static/img/add.png deleted file mode 100644 index 62bc974..0000000 Binary files a/ltmo/static/img/add.png and /dev/null differ diff --git a/ltmo/static/img/apply.png b/ltmo/static/img/apply.png deleted file mode 100644 index a3ea7ff..0000000 Binary files a/ltmo/static/img/apply.png and /dev/null differ diff --git a/ltmo/static/img/arrows.png b/ltmo/static/img/arrows.png deleted file mode 100644 index 5ddad0c..0000000 Binary files a/ltmo/static/img/arrows.png and /dev/null differ diff --git a/ltmo/static/img/bg-tags.png b/ltmo/static/img/bg-tags.png deleted file mode 100644 index 0533498..0000000 Binary files a/ltmo/static/img/bg-tags.png and /dev/null differ diff --git a/ltmo/static/img/favicon.ico b/ltmo/static/img/favicon.ico deleted file mode 100644 index 8b75168..0000000 Binary files a/ltmo/static/img/favicon.ico and /dev/null differ diff --git a/ltmo/static/img/help.png b/ltmo/static/img/help.png deleted file mode 100644 index d886f24..0000000 Binary files a/ltmo/static/img/help.png and /dev/null differ diff --git a/ltmo/static/img/home.png b/ltmo/static/img/home.png deleted file mode 100644 index fe5ee78..0000000 Binary files a/ltmo/static/img/home.png and /dev/null differ diff --git a/ltmo/static/img/login.png b/ltmo/static/img/login.png deleted file mode 100644 index 891b739..0000000 Binary files a/ltmo/static/img/login.png and /dev/null differ diff --git a/ltmo/static/img/logout.png b/ltmo/static/img/logout.png deleted file mode 100644 index cec193c..0000000 Binary files a/ltmo/static/img/logout.png and /dev/null differ diff --git a/ltmo/static/js/jquery.js b/ltmo/static/js/jquery.js deleted file mode 100644 index 198b3ff..0000000 --- a/ltmo/static/js/jquery.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/ltmo/static/js/ltmo.js b/ltmo/static/js/ltmo.js deleted file mode 100644 index f3b789b..0000000 --- a/ltmo/static/js/ltmo.js +++ /dev/null @@ -1,103 +0,0 @@ -(function($) { -$( ".ui-autocomplete-input" ).live( "autocompleteopen", function() { - var autocomplete = $( this ).data( "autocomplete" ), - menu = autocomplete.menu; - menu.activate( $.Event({ type: "mouseenter" }), menu.element.children().first() ); -}); -}( jQuery )); -function viewport(){ - e = window; - a = 'inner'; - if ( !( 'innerWidth' in window ) ){ - a = 'client'; - e = document.documentElement || document.body; - }; - return { width : e[ a+'Width' ] , height : e[ a+'Height' ] }; -}; -function setLayout(){ - vp = viewport(); - padding = $('header').height() * 7; - visible_height = vp.height - padding; - visible_width = $('#main article').width(); - main_img = $('article img')[0]; - if (main_img) { - old_img_width = $('article img')[0].width; - new_img_width = (visible_width / old_img_width * visible_height) - padding; - if (visible_height > main_img.height) { - main_img.height = visible_height; - main_img.width = new_img_width ; - } - width_delta = (visible_width - main_img.width)/2; - $(main_img).css('margin-left', width_delta); - } -}; -$(function(){ - setLayout(); - var hash = window.location.hash; - if (hash){ - $(window).scrollTop($(hash).offset().top-55); - } - - function split( val ) { - return val.split( /,\s*/ ); - } - function extractLast( term ) { - return split( term ).pop(); - } - - $('.control').click(function(){ - target = $(this).attr('href'); - $(target).toggle('blind', 300); - if (target === '#leak-form'){ - window.setTimeout(function(){ - $('#id_description').focus(); - $('#leak-form').bind( "keydown", function(event) { - if ( event.keyCode === $.ui.keyCode.ESCAPE) { - $('#leak-form').hide('blind', 500) - .unbind('keydown'); - } - }); - - },400) - - } - return false; - - }); - $( "#id_tags" ) - .bind( "keydown", function( event ) { - // don't navigate away from the field on tab when selecting an item - if ( event.keyCode === $.ui.keyCode.TAB && - $( this ).data( "autocomplete" ).menu.active ) { - event.preventDefault(); - } - }) - .autocomplete({ - source: function( request, response ) { - $.getJSON( "/tags/", { - tag_name: extractLast( request.term ) - }, response ); - }, - search: function() { - var term = extractLast( this.value ); - if ( term.length < 2 ) { - return false; - } - }, - focus: function() { - return false; - }, - select: function( event, ui ) { - var terms = split( this.value ); - terms.pop(); - terms.push( ui.item.value ); - terms.push( "" ); - this.value = terms.join( ", " ); - return false; - } - }); - window.setTimeout(function(){ - $('#messages .control').click() - }, 1000); -}) - diff --git a/ltmo/static/js/ui.js b/ltmo/static/js/ui.js deleted file mode 100644 index c9d9ef2..0000000 --- a/ltmo/static/js/ui.js +++ /dev/null @@ -1,368 +0,0 @@ -/*! - * jQuery UI 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.10",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, -NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this, -"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position"); -if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f, -"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h, -d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}}); -c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a); -return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent", -true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -;/* - * jQuery UI Position 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Position - */ -(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, -left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= -k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= -m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= -d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= -a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), -g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); -;/* - * jQuery UI Draggable 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- -this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); -d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| -this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&& -this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== -a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| -0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- -(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== -"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"? -0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"), -10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor== -Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop(): -f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY; -if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/ -b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})}, -stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!= -document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= -i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, -arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= -c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, -{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); -if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", -a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); -if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, -c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== -document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length- -1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null}); -this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&& -a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h= -d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)}); -return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g= -d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top= -e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0]; -if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder); -c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length=== -1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top< -this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0], -this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out", -g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e").addClass("ui-autocomplete").appendTo(d(this.options.appendTo|| -"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"), -i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); -this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source=== -"string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b); -else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery); -(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", --1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.attr("scrollTop"),c=this.element.height();if(b<0)this.element.attr("scrollTop",g+b);else b>=c&&this.element.attr("scrollTop",g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})}, -deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0); -e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e, -g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first")); -this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& -e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= -d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| -(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); -this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ -g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", -function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; -this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= --1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; -d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= -d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, -e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); -j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); -if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, -this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, -load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, -"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, -url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.10"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent", -border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c); -return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments); -else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c), -b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c, -a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c, -a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a== -e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(hd)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, -"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, -e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, -"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ -a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, -C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, -s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, -j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, -toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== --1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; -if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", -b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& -!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& -l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H
    a";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), -k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, -scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= -false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= -1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="
    ";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="
    t
    ";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= -"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= -c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); -else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; -if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, -attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& -b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; -c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, -arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= -d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ -c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== -8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== -"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ -d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= -B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== -"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== -0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); -(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; -break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, -q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= -l;g.sort(w);if(h)for(var i=1;i0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, -m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== -true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== -g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]- -0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== -i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; -if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, -g);else if(typeof g.length==="number")for(var p=g.length;n";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); -n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& -function(){var g=k,i=t.createElement("div");i.innerHTML="

    ";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| -p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= -t.createElement("div");g.innerHTML="
    ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? -function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= -h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): -c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, -2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, -b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& -e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/\s]+\/)>/g,P={option:[1, -""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div
    ","
    "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; -else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", -prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| -b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===""&&!x?r.childNodes:[];for(o=k.length- -1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); -d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, -jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, -zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), -h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); -if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= -d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; -e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/)<[^<]*)*<\/script>/gi, -ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== -"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("
    ").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& -!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, -getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", -script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| -!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= -false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; -A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", -b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& -c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| -c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= -encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", -[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), -e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); -if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", -3),a,b,d);else{d=0;for(var e=this.length;d=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, -d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* -Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} -var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; -this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| -this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= -c.timers,b=0;b-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, -e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& -c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); -c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ -b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); diff --git a/ltmo/static/media/ltmo.js b/ltmo/static/media/ltmo.js deleted file mode 100644 index 392100f..0000000 --- a/ltmo/static/media/ltmo.js +++ /dev/null @@ -1,102 +0,0 @@ - (function( $ ) { - - $( ".ui-autocomplete-input" ).live( "autocompleteopen", function() { - var autocomplete = $( this ).data( "autocomplete" ), - menu = autocomplete.menu; - menu.activate( $.Event({ type: "mouseenter" }), menu.element.children().first() ); - }); - - }( jQuery )); - $(document).ready(function(){ - var hash = window.location.hash; - if (hash){ - $(window).scrollTop($(hash).offset().top-55) - } - - function split( val ) { - return val.split( /,\s*/ ); - } - function extractLast( term ) { - return split( term ).pop(); - } - - $('.control').click(function(){ - target = $(this).attr('href'); - $(target).toggle('blind', 300); - if (target === '#leak-form'){ - window.setTimeout(function(){ - $('#id_description').focus(); - $('#leak-form').bind( "keydown", function(event) { - if ( event.keyCode === $.ui.keyCode.ESCAPE) { - $('#leak-form').hide('blind', 300) - .unbind('keydown'); - } - }); - - },400) - - } - return false; - - }); - $('.edit').click(function(){ - url = $(this).attr('href'); - $.getJSON(url, function(data){ - $('#leak-form').attr('action', url); - form_fields = $('#leak-form :input'); - for (x in data) { - $('#id_'+x).val(data[x]); - } - }); - $('#new-leak').click(); - return false; - }) - $('#login-form').submit(function(){ - data = $(this).serializeArray(); - action = $(this).attr('action'); - $.post(action, data, function(data, st, request){ - if (st === 'success'){ - window.location=data['next']; - - }; - - }); - return false; - }) - $( "#id_tags" ) - .bind( "keydown", function( event ) { - // don't navigate away from the field on tab when selecting an item - if ( event.keyCode === $.ui.keyCode.TAB && - $( this ).data( "autocomplete" ).menu.active ) { - event.preventDefault(); - } - }) - .autocomplete({ - source: function( request, response ) { - $.getJSON( "/tags/", { - tag_name: extractLast( request.term ) - }, response ); - }, - search: function() { - var term = extractLast( this.value ); - if ( term.length < 2 ) { - return false; - } - }, - focus: function() { - return false; - }, - select: function( event, ui ) { - var terms = split( this.value ); - terms.pop(); - terms.push( ui.item.value ); - terms.push( "" ); - this.value = terms.join( ", " ); - return false; - } - }); - window.setTimeout(function(){ - $('#messages .control').click() - }, 1000); - }) - diff --git a/ltmo/static/media/style.css b/ltmo/static/media/style.css deleted file mode 100644 index afe8272..0000000 --- a/ltmo/static/media/style.css +++ /dev/null @@ -1,340 +0,0 @@ -body { - font: 100% sans-serif; -} -header, section, footer, article, aside { - display: block; - padding: 0 1em; - margin-bottom: 2em; - -} -header { - width: 97%; - padding:0 1.5%; - margin: 0; - position: fixed; - top:0; - background:#FFF; -} - -footer { - clear: both; - padding: 5em 1em 1em; - font-size: 80%; -} -footer p{ -} - -#main{ - margin:4em auto; - max-width: 70em; - clear: both; -} - -section { - display:block; - float: left; - width: 63% -} - -details { - text-align: right; - font-size:80%; - display:block; - color: #555; -} -aside { - text-align: left; - width: 29%; - float: right; - font-size: 80%; -} -pre, code { - font: 110% monospace; - white-space: pre-wrap; -} - -blockquote{ - font: italic 150% "Georgia-MS", Georgia, serif; - -} - -a { - color:#06C; - text-decoration:none; -} -a:hover { - text-shadow: 1px 1px 1px #CCC, 0 -1px 1px #EBEBEB; -} - -a img{ - border: 0; -} -em { - font: italic 100% "Georgia-MS", Georgia, serif; -} -article img, article object { - display:block; - margin: 1em auto; - max-width: 35em; - -} -h1, h2, h3, h1 a, h2 a, h3 a { - font-weight: normal; -} -h1 { - font-weight: normal; -} -h1 .pilcrow { - font-size:70%; - display:none; - vertical-align: top; -} -h1:hover .pilcrow { - display:inline; -} -h2 { - font-size:180%; -} -nav { - float: right; -} -nav a{ - font-size:2em; - padding: 0 0.5em; -} -nav a:hover { - background: #EEE; -} -#wrapper { - margin: 0 auto; - text-align:left; - background: rgba(255, 255, 255, 0.8); - border-radius: 15px 15px 0 0; -} -#logo { - margin:0; - border-bottom: 1px solid #EEE; -} -#banner-header { - float:right; - margin: 0.5em 0; -} -#banner-content { - text-align:center; -} -#banner-aside { - margin-top:15px; -} -#author { - margin:1em 0; -} -#author details { - font-size:13px; - margin: -1.5em 0; - text-align:left; -} -#messages { - text-align:left; - background: #FE9; - border: 1px solid #FC0; - font-size:80%; - margin:0; - padding:0 1em; - position:fixed; - left:0; - top:0; - width:100%; - z-index:100; - list-style:none; -} -#messages li { - padding: 0.25em 2em; - position: relative; -} -#messages .control { - position: absolute; - right: 4em; -} - -.rewind { - position: absolute; - bottom: 5em; - right: 10em; - -} -.banner { - clear: both; - background: #EEE; - position:relative; - padding: 1em; - border-radius: 0.25em; -} -.gravatar { - float:left; - margin-right:0.5em; -} - -.caption { - margin:0; - padding: 1em; - border-color: transparent transparent #EEEEEE; - border-style: solid; - border-width: 0 0 1px; -} -.clear { - display:block; - clear:both; -} - -.prev { - float:left; - padding: 1em; -} -.next { - float:right; - padding: 1em; -} - -.tags { - background: url(/media/bg-tags.png) left no-repeat; - color: #666666; - font-family: Arial,sans-serif; - font-size: 11px; - line-height: 32px; - margin: 2px 2px 2px 0; - overflow: visible; - padding: 4px 4px 4px 16px; - text-decoration: none; - min-width:30px; - white-space: nowrap; -} - -/* forms */ -.hide { - display:none; -} - - -form { - padding: 1em 2em 0.5em; - background:#EEE; - border-radius: 0 0 5px 5px; - box-shadow: 2px 2px 3px #999; -} -form section{ - margin-bottom:1em; -} -form .control { - line-height:2.5em; - -} -.submit { - text-align: right; -} -#formating-help { - float:right; - width: 30%; - font-size: 80%; - border: 1px solid #FFF; - border-width:1px 0; - border-color: #CCC transparent #FFF; - -} -#formating-help caption { - margin: 0 0 1em -2em; - text-align: left; -} -#formating-help td { - vertical-align: top; - border: 1px solid #FFF; - border-width:1px 0; - border-color: #FFF transparent #CCC; - padding: 0.25em; -} -.field { - clear: left; - padding: 0.25em 0; - position: relative; -} -input, -textarea{ - border: 1px solid #999; - font: 1em sans-serif; - padding: 0.25em; - border-radius: 3px; -} -textarea { - font-size:1.5em; - height:5em; - width:20em; -} - -input[type='text']:focus, -textarea:focus{ - border: 1px solid #0C6; -} -.error { - background: #FEA; - border-radius: 3px; -} -.error input, -.error textarea { - border: 1px solid #C60; -} -.errorlist{ - position:absolute; - right: 3em; - list-style:none; - margin:0.5em; - font-size:80%; -} -.field label { - float:left; - width: 6em; - margin: 0.5em 1em; - text-align:right; -} -.field span { - font-size:80%; -} -.required label { - font-weight:bold; - color:#C60; -} -input[type='submit'] { - float:left; - border:1px solid #366E91; - padding:0.25em 1em; - margin:0.25em 0; - background:#06C; - color:#FFF; - text-shadow: 1px 1px 0px #333; - border-radius:5px; -} -input[type='submit']:hover { - cursor: pointer; - box-shadow: 1px 1px 2px #999; -} -input[type='submit']:active { - margin:4px -2px 0 0; - -} - - -.ui-autocomplete { - list-style: none; - position:fixed !important; - background: #FFF; - width: 10em; - padding:0; - margin:0; -} -.ui-autocomplete a { - display:block; - font-size:80%; - padding: 0.5em; -} -.ui-state-hover { - background:#0C6; - color:#FFF; -} diff --git a/ltmo/static/media/ui.js b/ltmo/static/media/ui.js deleted file mode 100644 index c9d9ef2..0000000 --- a/ltmo/static/media/ui.js +++ /dev/null @@ -1,368 +0,0 @@ -/*! - * jQuery UI 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.10",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, -NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this, -"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position"); -if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f, -"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h, -d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}}); -c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a); -return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent", -true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -;/* - * jQuery UI Position 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Position - */ -(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, -left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= -k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= -m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= -d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= -a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), -g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); -;/* - * jQuery UI Draggable 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- -this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); -d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| -this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&& -this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== -a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| -0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- -(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== -"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"? -0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"), -10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor== -Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop(): -f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY; -if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/ -b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})}, -stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!= -document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= -i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, -arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= -c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, -{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); -if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", -a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); -if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, -c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== -document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length- -1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null}); -this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&& -a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h= -d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)}); -return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g= -d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top= -e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0]; -if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder); -c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length=== -1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top< -this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0], -this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out", -g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e").addClass("ui-autocomplete").appendTo(d(this.options.appendTo|| -"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"), -i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); -this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source=== -"string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b); -else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery); -(function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", --1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.attr("scrollTop"),c=this.element.height();if(b<0)this.element.attr("scrollTop",g+b);else b>=c&&this.element.attr("scrollTop",g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})}, -deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0); -e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e, -g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first")); -this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& -e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= -d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| -(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); -this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ -g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", -function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; -this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= --1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; -d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= -d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, -e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); -j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); -if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, -this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, -load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, -"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, -url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.10"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent", -border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c); -return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments); -else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c), -b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c, -a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c, -a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a== -e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h - ~{{obj.author}}, - {{obj.created|date}}, - {% for tag in tag_list %}{{tag}}, {%endfor%} - - {{obj.metadata}} -

    - {{obj.rendered|safe|truncatewords_html:'150'}} - - diff --git a/ltmo/tests.py b/ltmo/tests.py deleted file mode 100644 index e5571f3..0000000 --- a/ltmo/tests.py +++ /dev/null @@ -1,21 +0,0 @@ -import unittest -from ltmo.models import Leak - -class TestLeak (unittest.TestCase): - - def setUp(self): - self.mock_content = { - 'title': 'This is a test leak', - 'description': '**some** [Markdown](http://markdown.org) text.', - 'author':'pindonga' - } - self.expected_content = { - 'title': 'This is a test leak', - 'description': '**some** [Markdown](http://markdown.org) text.', - 'author': 'pindonga', - 'rendered': u'''

    some Markdown text.

    ''' - } - self.leak = Leak.objects.create(**self.mock_content) - def test_MarkdownOk(self): - self.assertEquals(self.leak.rendered, self.expected_content['rendered']) - diff --git a/ltmo/urls.py b/ltmo/urls.py index 1f04022..4412003 100644 --- a/ltmo/urls.py +++ b/ltmo/urls.py @@ -6,10 +6,13 @@ from django.contrib.sitemaps import GenericSitemap from django.contrib import admin -from ltmo.feeds import LeakFeed -from ltmo.models import Leak +from leaks.feeds import LeakFeed +from leaks.models import Leak +from leaks.views import LeakViewset +from rest_framework import routers -admin.autodiscover() +router = routers.DefaultRouter() +router.register('leak', LeakViewset) info_dict = { 'queryset': Leak.objects.all(), @@ -20,17 +23,18 @@ 'leaks': GenericSitemap(info_dict, priority=0.6), } -urlpatterns = patterns('ltmo.views', - (r'^$','index',{},'index'), - (r'^new/$','edit',{},'new'), - (r'^edit/(?P\d+)$','edit',{},'edit'), - (r'^l/$','by_tag',{}), - (r'^leak/(?P\D+)$','by_tag',{},'by_tag'), - (r'^leak/(?P\d+)$','leak_detail',{},'leak_detail'), - (r'^tags/','tags',{},'tags'), +urlpatterns = patterns( + 'leaks.views', + (r'^$', 'index', {}, 'index'), + (r'^new/$', 'edit', {}, 'new'), + (r'^edit/(?P\d+)$', 'edit', {}, 'edit'), + (r'^l/$', 'by_tag', {}), + (r'^leak/(?P\D+)$', 'by_tag', {}, 'by_tag'), + (r'^leak/(?P\d+)$', 'leak_detail', {}, 'leak_detail'), + (r'^tags/', 'tags', {}, 'tags'), (r'^~$', 'user_profile', {}, 'author'), - (r'^~(?P\w+)/$','user_profile', {}, 'author_detail'), - (r'^register$','register',{},'register'), + (r'^~(?P[\w@\.]+)/$', 'user_profile', {}, 'author_detail'), + (r'^register$', 'register', {}, 'register'), ) urlpatterns += patterns('django.contrib.auth.views', @@ -39,7 +43,8 @@ ) urlpatterns += patterns('', - (r'', include('social_auth.urls'))) + url('', include('social.apps.django_app.urls', namespace='social')) +) urlpatterns += patterns('', (r'^admin/', include(admin.site.urls)), @@ -49,6 +54,12 @@ {'sitemaps': sitemaps}) ) +urlpatterns += patterns('', + url(r'^api/', include(router.urls)), + url(r'^api-auth/', include('rest_framework.urls', + namespace='rest_framework')) +) + if settings.DEBUG: urlpatterns += patterns('', url(r'^media/(?P.*)$', 'django.views.static.serve', { diff --git a/package.json b/package.json new file mode 100644 index 0000000..89abd19 --- /dev/null +++ b/package.json @@ -0,0 +1,48 @@ +{ + "name": "ltmo", + "version": "0.10.0", + "description": "Un sitio para los amigos.", + "main": "cloth/js/main.js", + "directories": { + "doc": "docs", + "src": "cloth/js" + }, + "repository": { + "type": "git", + "url": "https://github.com/tutuca/ltmo.git" + }, + "dependencies": { + "jquery": "*", + "underscore": "*", + "bootstrap": "*", + "backbone": "*", + "react": "*", + "bootstrap-sass": "*", + "font-awesome": "*" + }, + "devDependencies": { + "grunt": "*", + "babel-core": "*", + "node-sass": "*", + "webpack": "*", + "babel-loader": "*", + "react-hot-loader": "*", + "webpack-dev-server": "*", + "grunt-contrib-watch": "*", + "grunt-sass": "*", + "grunt-contrib-copy": "*", + "grunt-webpack": "*", + "grunt-contrib-concat": "*" + }, + "keywords": [ + "sitio", + "leak", + "oil", + "ltmo" + ], + "author": "tutuca", + "license": "MIT", + "bugs": { + "url": "https://github.com/tutuca/ltmo/issues" + } +} diff --git a/requirements.txt b/requirements.txt index b0f4794..1762e8a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,12 @@ -Pillow -django==1.4.9 -django-tagging -Markdown +django +pillow +markdown pygments -django-pagination -django-registration -django-social-auth -psycopg2 -south -django-debug-toolbar -banners \ No newline at end of file +python-social-auth +djangorestframework +django-taggit +django-taggit-templatetags +django-endless-pagination +django-registration-redux +django-filter +django-guardian \ No newline at end of file diff --git a/setup.py b/setup.py index d4ba278..91dc3ed 100644 --- a/setup.py +++ b/setup.py @@ -1,22 +1,36 @@ +#!/usr/bin/env python # -*- coding: utf-8 -*- -from setuptools import setup, find_packages + + +from setuptools import setup +from pip.req import parse_requirements + +try: + requirements = parse_requirements('requirements.txt') +except TypeError: + # travis complains about the former + requirements = parse_requirements('requirements.txt', session=False) + setup( name='ltmo', - version='0.14', + version='0.10', description="light weight blogging, heavy weight time-wasting", - # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers + # http://www.python.org/pypi?%3Aaction=list_classifiers classifiers=[ - "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Framework :: Django", + "Intended Audience :: Developers", + "License :: Public Domain", "Topic :: Software Development :: Libraries :: Python Modules", ], keywords='Blog, Django', - author='Inventta', + author='Matias Iturburu, Fran Herrero', author_email='maturburu@gmail.com', url='http://ltmo.com.ar', - packages=find_packages(exclude=['tests*']), + packages=['ltmo', 'leaks'], package_data={ - 'ltmo': ['templates/*.html'], + 'ltmo': ['templates/*.html', 'static/*.*'], }, include_package_data=True, zip_safe=False, @@ -25,21 +39,5 @@ 'manage = ltmo.manage:do_manage', ], }, - install_requires=[ - 'django', - 'Pillow', - 'markdown', - 'pygments', - 'south', - 'django-tagging', - 'django-pagination', - 'django-registration', - 'django-social-auth', - 'django-debug-toolbar', - 'markdown', - 'pygments', - 'south', - 'banners' - #'psycopg2', - ] + install_requires=[str(r.req) for r in requirements] ) diff --git a/ltmo/templates/404.html b/templates/404.html similarity index 89% rename from ltmo/templates/404.html rename to templates/404.html index e27b375..8ea2b07 100644 --- a/ltmo/templates/404.html +++ b/templates/404.html @@ -3,19 +3,19 @@ {% block title %}Queremos tener el cielo...{% endblock %} - +

    No hay nada acá

    - << Volver
    diff --git a/ltmo/templates/500.html b/templates/500.html similarity index 94% rename from ltmo/templates/500.html rename to templates/500.html index 8836f8c..eb20a4b 100644 --- a/ltmo/templates/500.html +++ b/templates/500.html @@ -3,7 +3,7 @@ {% block title %}Que se creen los ingleses? que son los únicos que pueden hacer derrames???{% endblock %} - + diff --git a/templates/banner.html b/templates/banner.html new file mode 100644 index 0000000..e69de29 diff --git a/ltmo/templates/banners.html b/templates/banners.html similarity index 96% rename from ltmo/templates/banners.html rename to templates/banners.html index 914c1b9..0328621 100644 --- a/ltmo/templates/banners.html +++ b/templates/banners.html @@ -13,7 +13,7 @@

    Publicidad

    - + {% endmacro %} {% macro content %} {% endmacro %} -{% macro twitter %} +{% macro twitter %} {% endmacro %} diff --git a/ltmo/templates/detail.html b/templates/detail.html similarity index 71% rename from ltmo/templates/detail.html rename to templates/detail.html index 0aa8f7c..60431d4 100644 --- a/ltmo/templates/detail.html +++ b/templates/detail.html @@ -1,5 +1,5 @@ {% extends 'layout.html' %} -{% load banner_tags tagging_tags %} +{% load banner_tags %} {% block title %} {{object.title}} {% endblock %} @@ -16,21 +16,12 @@ {{object.rendered|safe}}
    -
    -

    - {% tag_cloud_for_model ltmo.Leak as cloud with steps=20 min_count=8 distribution=log %} - {% for tag in cloud %} - {{tag}} - {% endfor %} -

    +

    {{object.title}} - {% tags_for_object object as tag_list %} - , - {{object.created|date}}, - {% for tag in tag_list %}{{tag}}, {%endfor%} + , + {{object.created|date}}, + {% for tag in object.tags.all %}{{tag}}, {%endfor%} {{object.metadata}} {% if user.is_staff %}editar{% endif %} @@ -57,4 +48,3 @@

    No hay derrames ahún

    {% pop_slot 'content' %}
    {% endblock %} - diff --git a/templates/feeds/description.html b/templates/feeds/description.html new file mode 100644 index 0000000..b06acd3 --- /dev/null +++ b/templates/feeds/description.html @@ -0,0 +1,8 @@ +

    + ~{{obj.author}}, + {{obj.created|date}}, + {% for tag in object.tags %}{{tag}}, {%endfor%} + + {{obj.metadata}} +

    + {{obj.rendered|safe|truncatewords_html:'150'}} diff --git a/ltmo/templates/help.html b/templates/help.html similarity index 100% rename from ltmo/templates/help.html rename to templates/help.html diff --git a/ltmo/templates/index.html b/templates/index.html similarity index 84% rename from ltmo/templates/index.html rename to templates/index.html index bdd11f8..e6b8c62 100644 --- a/ltmo/templates/index.html +++ b/templates/index.html @@ -1,6 +1,6 @@ {% extends "layout.html" %} {% block content %} - {% autopaginate object_list 10 %} + {% paginate object_list 10 %} {% for object in object_list %} {% include 'leak.html' %} {% if forloop.counter == 5 %}{% pop_slot 'content' %}{% endif %} @@ -9,5 +9,5 @@

    No hay derrames ahún

    {% endfor %} - {% paginate %} + {% show_pages %} {% endblock %} diff --git a/ltmo/templates/layout.html b/templates/layout.html similarity index 61% rename from ltmo/templates/layout.html rename to templates/layout.html index 9b389c7..b8eb3a8 100644 --- a/ltmo/templates/layout.html +++ b/templates/layout.html @@ -1,5 +1,7 @@ -{% load tagging_tags pagination_tags banner_tags %} +{% load banner_tags %} +{% load staticfiles %} + @@ -10,14 +12,12 @@ - - - - - + + {% pop_slot 'analytics' %} + - +
    + - - +
    + + {% if 'GET' in allowed_methods %} +
    +
    +
    + GET + + + +
    +
    + + {% endif %} + + {% if options_form %} +
    + {% csrf_token %} + + + + {% endif %} + + {% if delete_form %} +
    + {% csrf_token %} + + + + {% endif %} + +
    + +
    + {% block description %} + {{ description }} + {% endblock %} +
    + + {% if paginator %} + + {% endif %} + +
    +
    {{ request.method }} {{ request.get_full_path }}
    +
    +
    +
    HTTP {{ response.status_code }} {{ response.status_text }}{% autoescape off %}
    +{% for key, val in response_headers.items %}{{ key }}: {{ val|break_long_headers|urlize_quoted_links }}
    +{% endfor %}
    +{{ content|urlize_quoted_links }}
    {% endautoescape %} +
    +
    + + {% if display_edit_forms %} + + {% if post_form or raw_data_post_form %} +
    + {% if post_form %} + + {% endif %} +
    + {% if post_form %} +
    + {% with form=post_form %} +
    +
    + {{ post_form }} +
    + +
    +
    + + {% endwith %} +
    + {% endif %} +
    + {% with form=raw_data_post_form %} +
    +
    + {% include "rest_framework/raw_data_form.html" %} +
    + +
    +
    + + {% endwith %} +
    +
    +
    + {% endif %} + + {% if put_form or raw_data_put_form or raw_data_patch_form %} +
    + {% if put_form %} + + {% endif %} +
    + {% if put_form %} +
    +
    +
    + {{ put_form }} +
    + +
    +
    + +
    + {% endif %} +
    + {% with form=raw_data_put_or_patch_form %} +
    +
    + {% include "rest_framework/raw_data_form.html" %} +
    + {% if raw_data_put_form %} + + {% endif %} + {% if raw_data_patch_form %} + + {% endif %} +
    +
    + + {% endwith %} +
    +
    +
    + {% endif %} + {% endif %} +
    + +
    + + + {% block script %} + + + + + {% endblock %} + + {% endblock %} + diff --git a/templates/single.html b/templates/single.html new file mode 100644 index 0000000..16a6372 --- /dev/null +++ b/templates/single.html @@ -0,0 +1 @@ +{{banner.render_code}} diff --git a/templates/slot.html b/templates/slot.html new file mode 100644 index 0000000..ea3a300 --- /dev/null +++ b/templates/slot.html @@ -0,0 +1,3 @@ +{% for banner in banners %} +{{banner.code|safe}} +{% endfor %} diff --git a/ltmo/templates/success.json b/templates/success.json similarity index 97% rename from ltmo/templates/success.json rename to templates/success.json index 8f22e7b..8ce917a 100644 --- a/ltmo/templates/success.json +++ b/templates/success.json @@ -1,6 +1,6 @@ {% if form.errors %} "form":[ "errors": [{% for error in form.errors %}"{{error|safe}}", {%empty%}"No errors"{% endfor %}], -{% for field in form %}{"{{field}}":[{% for error in field.errors %}"{{error|safe}}", {%empty%}"No errors"{% endfor %}}{% endfor %} +{% for field in form %}{"{{field}}":[{% for error in field.errors %}"{{error|safe}}", {%empty%}"No errors"{% endfor %}}{% endfor %} ]{% else %} {"messages":"No hubo errores, no hubo excesos, son todos asesinos los milicos del proceso", "object_id":"{{object_id}}"}{% endif %} diff --git a/ltmo/templates/tags.html b/templates/tags.html similarity index 86% rename from ltmo/templates/tags.html rename to templates/tags.html index 1511460..3d468af 100644 --- a/ltmo/templates/tags.html +++ b/templates/tags.html @@ -1,11 +1,11 @@ {% extends 'layout.html' %} -{% load pagination_tags banner_tags tagging_tags %} +{% load endless banner_tags %} {% block logo %} {{block.super}}{{tag_name|default:'leaks'}} {% endblock %} {% block content %} {% regroup object_list by tags as object_list %} -{% autopaginate object_list 10 %} +{% paginate object_list %} {% for tag in object_list %} {%if not tag_name%}

    {{tag.grouper}}/

    @@ -16,5 +16,5 @@

    {{tag.grouper}}/

    {% endfor %} {% if forloop.counter == 5 %}{% pop_slot 'content' %}{% endif %} {% endfor %} -{% paginate %} +{% show_pages %} {% endblock %}